4 ms·
This comes at a good time as it's something I've been looking for. We have a physics engine and we want to allow users to write custom c++ functions that can be
by jclay 9y ago
This comes at a good time as it's something I've been looking for. We have a physics engine and we want to allow users to write custom c++ functions that can be linked in at run-time. We'd like to allow our users to swap in their own custom integration or timestep methods for example.
As an aside, do you know if it is possible to use this to JIT C++ for CUDA kernels?
- Mic92 9y agoYou probably want to use libcling directly instead.
- zokier 9y ago> We have a physics engine and we want to allow users to write custom c++ functions that can be linked in at run-time. We'd like to allow our users to swap in their own custom integration or timestep methods for example. Can't you achieve that with plain old dlopen etc? I suppose name mangling can be bit of pita if you want to have truly c++ interfaces instead of extern c ones.
- lahwran 9y agoAre you imagining this running inside a cuda kernel? If yes, the problem with doing anything of the kind is that, even if you run your kernel with one warp and mask all but one thread, you still then need round trips to the cpu to do io, and you need to dynamically load code, both of which the gpu is quite bad about. If no, it is probably doable if a bit hard to generate kernels on the fly.
- tmearnest 9y ago> As an aside, do you know if it is possible to use this to JIT C++ for CUDA kernels? Are you aware of NVRTC?
- watmough 9y agoHopefully this is relevant, but you can certainly kick off nvcc -ptx in a shell to generate ptx files, then just load those in through driver calls. I'm totally planning to do something like this for some bulk data processing I have in mind.