NativeJIT icon indicating copy to clipboard operation
NativeJIT copied to clipboard

Support for double precision math functions

Open vlovero opened this issue 4 years ago • 0 comments

Using double precision version of functions from standard math library fails to compile with the following error,

The code

// does not compile
ExecutionBuffer codeAllocator(8192);
Allocator allocator(8192);
FunctionBuffer code(codeAllocator, 8192);
Function<double, double> scalers(allocator, code);
auto & sinFunction = scalers.Immediate(sin);

causes the compiler error

func.cpp:25:34: error: no matching member function for call to 'Immediate'
    auto & sinFunction = scalers.Immediate(sin);
./jit/Include/NativeJIT/ExpressionNodeFactory.h:67:46: note: candidate template ignored: couldn't
      infer template argument 'T'
    ImmediateNode<T>& ExpressionNodeFactory::Immediate(T value)

meanwhile the code,

// works perfectly fine
Function<float, float> scalers(allocator, code);
auto & sinFunction = scalers.Immediate(sinf);

works entirely as expected. I am compiling with Apple clang 11.0.3 on x86_64 Is there a workaround for this?

vlovero avatar Apr 23 '21 14:04 vlovero