How to compile PTX code

前端 未结 6 1621
旧巷少年郎
旧巷少年郎 2020-12-15 11:35

I need to modify the PTX code and compile it directly. The reason is that I want to have some specific instructions right after each other and it is difficult to write a cud

6条回答
  •  孤街浪徒
    2020-12-15 11:59

    You can load cubin or fatbin at runtime using cuModuleLoad* functions in CUDA: Here's the API

    You can use it to include PTX into your build, though the method is somewhat convoluted. For instance, suricata compiles its .cu files into PTX files for different architectures and then converts them into an .h file that contains PTX code as a 'C' array, and then just includes it from one of the files during the build.

提交回复
热议问题