开发者

CUDA source files get a .cu extension. What do header files get?

The standard convention seems to be to give CUDA source-code files a .cu extension, to distinguish them from C files with a .c extension. What's the corresponding convention for CUDA-specifi开发者_JAVA百科c header files? Is there one?


Some people (including the CUDA SDK) use .cuh for CUDA header files, and if you're including device code in the header then perhaps this may help. However really there is no special meaning attached to the extension of the header file (unlike for the source file where it determines which compiler to use) so personally I stick with .h.


No - just use .h for header files. The CUDA source files have a different suffix to make lt easy to ensure that the various source files in a build get compiled with the right compiler (think makefile rules).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜