nvcc .cpp file


is there any way to compile a file with cuda kernel in it but with extension .cpp? if it’s .cu, nvcc could work straight out, but if it’s changed to .cpp, nvcc would treat it as something else.


I don’t believe so. nvcc uses the file extension to determine the compilation trajectory and won’t try extracting and compiling device code if the file doesn’t have the correct extension.