Kasper Ziemianek
Kasper Ziemianek

Reputation: 1349

Read math functions from file and calculate

I'm creating program which will read model described by math functions from file into memory. I need to make these functions invokable. Is there any other way to achive it instead of implementing RPN ? Performance is the most important factor.

Maybe something like creating and compiling functions during runtime, after reading model from file ?

Upvotes: 1

Views: 89

Answers (1)

talonmies
talonmies

Reputation: 72348

CUDA currently only has JIT compilation for device code written in PTX assembly code. So your only "native" JIT option would be to have your code translate the functions into PTX code and compile them.

Realistically, your best option would be to write your front end in Python and use PyCUDA, which includes some very powerful metaprogramming and JIT compilation features, or to use OpenCL, which has native C99 JIT compilation, at the expense of an uglier and more verbose host API and a lack of C++ language support.

Upvotes: 3

Related Questions