CUDA中有没有针对PTX ISA的instrinsic function?

zenny_chen 2010-06-26 04:01:25
CUDA中不能直接使用PTX指令集,但有没有intrinsic function或built-in function可以使用呢?
比如说像bit reverse这类指令在CUDA C/C++中是无法被表达的,但是要用的话该咋办?
...全文
114 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zenny_chen 2010-06-26
  • 打赏
  • 举报
回复
哦,感谢老程序员回答,呵呵呵。
  • 打赏
  • 举报
回复
cuda中可以直接使用ptx指令写的程序。呵呵。
1)ptx写的kenerl程序文件可以直接加在工程中被nvcc编译并链接到程序中。
2)cuModuleLoad函数可以动态调入并编译执行ptx写的kenerl程序。(JIT)
cuModuleLoad ( CUmodule * module,
const char * fname
)

Takes a filename fname and loads the corresponding module module into the current context. The CUDA driver API does not attempt to lazily allocate the resources needed by a module; if the memory for functions and data (constant and global) needed by the module cannot be allocated, cuModuleLoad() fails. The file should be a cubin file as output by nvcc or a PTX file, either as output by nvcc or handwrtten.

353

社区成员

发帖
与我相关
我的任务
社区描述
CUDA高性能计算讨论
社区管理员
  • CUDA高性能计算讨论社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧