Linking a kernel to a PTX function

人走茶凉 提交于 2019-12-02 04:19:26
JackOLantern

You can load the file containing PTX code in your own code from the filesystem by cuModuleLoad and cuModuleGetFunction as follows:

CUmodule module;
CUfunction function;

const char* module_file = "my_ptx_file.ptx";
const char* kernel_name = "my_kernel_name";

err = cuModuleLoad(&module, module_file);
err = cuModuleGetFunction(&function, module, kernel_name);

You can also pass the PTX code to the CUDA driver directly as a string, see Passing the PTX program to the CUDA driver directly.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!