nvcc uses the file extension to determine how to handle the contents of the file. If you have CUDA syntax inside the file, it must have a .cu extension, otherwise nvcc will just pass the file untouched to the host compiler, resulting in a syntax error.
talonmies
source share