Cuda内核准时(jit)编译可能? [英] Cuda kernel just-in-time (jit) compilation possible?
问题描述
CUDA是否支持cuda内核的JIT编译?
Does CUDA support JIT compilation of a cuda kernel?
我知道OpenCL提供此功能。
I know that OpenCL offers this feature.
我有一些变量在运行时没有改变(即只依赖于输入文件),因此我想在内核compiletime(即在运行时)使用宏定义这些值。
I have some variables which are not changed during runtime (i.e. only depend on the input file), therefore I would like to define these values with a macro at kernel compiletime(i.e at runtime).
如果我在compiletime手动定义这些值,我的注册使用从53下降到46,并大大提高性能。
If I define these values manually at compiletime my register usage drops from 53 to 46 and greatly improves performance.
谢谢。 b $ b
推荐答案
它提供了cuda 7.0的nvrtc库。通过此库,您可以在运行时编译您的cuda代码。
It became available with nvrtc library of cuda 7.0. By this library you can compile your cuda codes during runtime.
http://devblogs.nvidia.com/parallelforall/cuda-7-release-candidate-feature-overview/
Bu你能获得什么样的优势?在我看来,我找不到动态编译的巨大优势。
Bu what kind of advantages you can gain? In my view, i couldn't find so much dramatic advantages of dynamic compilation.
这篇关于Cuda内核准时(jit)编译可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!