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

Brooks Moses picture Brooks Moses · Mar 6, 2010 · Viewed 23.8k times · Source

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-specific header files? Is there one?

Answer

Tom picture Tom · Mar 6, 2010

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.