Skip to content

Support for double precision math functions #83

@vlovero

Description

@vlovero

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions