disabling nvcc preincludes


How do you disable the pre-including of header files that nvcc does when compiling *.cu files? For example this file will compile if compiled as a .cu file even though the headers aren’t there.

#include <stdio.h>


main(int argc, char* argv[])


	void* dev;

	cudaError_t err;

	err = cudaMalloc(&dev, 1024);


	return 0;


It will compile with nvcc -o test test.cu. nvcc -E test.cu shows a bunch of include files being shoved into this automatically. How do I disable this?

I don’t think you can, those headers are part of the compilation environment and responsible for quite a lot of the CUDA “built in” things. Why would you want to?