Same error with the -v options, results below.
A couple of interesting things
This seem wrong : -D"DEVICE_LAUNCH_PARAMETERS_H"
(BTW --define-macro does the same thing)
And nvcc is adding its own includes, which I think would be okay of the quotes were not put around DEVICE_LAUNCH_PARAMETERS_H
[codebox]nvcc -v -D__DEVICE_LAUNCH_PARAMETERS_H__ -c ptxvars.cu
#$ SPACE=
#$ MODE=DEVICE
#$ HERE=/usr/local/cuda/bin
#$ THERE=/usr/local/cuda/bin
#$ TOP=/usr/local/cuda/bin/…
#$ LD_LIBRARY_PATH=/usr/local/cuda/bin/…/lib:/usr/local/cuda/bin/…/extools/lib:/usr/local/cuda/lib:/home/krys/opts/lib:/usr/local/cuda/cudaprof/bin
#$ PATH=/usr/local/cuda/bin/…/open64/bin:/usr/local/cuda/bin/…/bin:/home/krys/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/cuda/bin:/usr/local/cuda/cudaprof/bin:/usr/local/matlab/bin
#$ INCLUDES=“-I/usr/local/cuda/bin/…/include” “-I/usr/local/cuda/bin/…/include/cudart”
#$ LIBRARIES= “-L/usr/local/cuda/bin/…/lib” -lcudart
#$ CUDAFE_FLAGS=
#$ OPENCC_FLAGS=
#$ PTXAS_FLAGS=
#$ gcc -D__CUDA_ARCH__=100 -E -x c++ -DCUDA_NO_SM_12_ATOMIC_INTRINSICS -DCUDA_NO_SM_13_DOUBLE_INTRINSICS -DCUDA_FLOAT_MATH_FUNCTIONS -DCUDA_NO_SM_11_ATOMIC_INTRINSICS “-I/usr/local/cuda/bin/…/include” “-I/usr/local/cuda/bin/…/include/cudart” -I. -D__CUDACC__ -C -D"DEVICE_LAUNCH_PARAMETERS_H" -include “cuda_runtime.h” -m64 -o “/tmp/tmpxft_0000472e_00000000-4_ptxvars.cpp1.ii” “ptxvars.cu”
#$ cudafe --m64 --gnu_version=40204 --diag_error=host_device_limited_call --diag_error=ms_asm_decl_not_allowed -tused --gen_c_file_name “/tmp/tmpxft_0000472e_00000000-1_ptxvars.cudafe1.c” --stub_file_name “/tmp/tmpxft_0000472e_00000000-1_ptxvars.cudafe1.stub.c” --stub_header_file_name “/tmp/tmpxft_0000472e_00000000-1_ptxvars.cudafe1.stub.h” --gen_device_file_name “/tmp/tmpxft_0000472e_00000000-1_ptxvars.cudafe1.gpu” --include_file_name “/tmp/tmpxft_0000472e_00000000-3_ptxvars.fatbin.c” “/tmp/tmpxft_0000472e_00000000-4_ptxvars.cpp1.ii”
#$ gcc -D__CUDA_ARCH__=100 -E -x c -DCUDA_NO_SM_12_ATOMIC_INTRINSICS -DCUDA_NO_SM_13_DOUBLE_INTRINSICS -DCUDA_FLOAT_MATH_FUNCTIONS -DCUDA_NO_SM_11_ATOMIC_INTRINSICS “-I/usr/local/cuda/bin/…/include” “-I/usr/local/cuda/bin/…/include/cudart” -I. -D__CUDACC__ -C -m64 -o “/tmp/tmpxft_0000472e_00000000-5_ptxvars.cpp2.i” “/tmp/tmpxft_0000472e_00000000-1_ptxvars.cudafe1.gpu”
#$ cudafe --m64 --gnu_version=40204 --c --gen_c_file_name “/tmp/tmpxft_0000472e_00000000-6_ptxvars.cudafe2.c” --stub_file_name “/tmp/tmpxft_0000472e_00000000-6_ptxvars.cudafe2.stub.c” --stub_header_file_name “/tmp/tmpxft_0000472e_00000000-6_ptxvars.cudafe2.stub.h” --gen_device_file_name “/tmp/tmpxft_0000472e_00000000-6_ptxvars.cudafe2.gpu” --include_file_name “/tmp/tmpxft_0000472e_00000000-3_ptxvars.fatbin.c” “/tmp/tmpxft_0000472e_00000000-5_ptxvars.cpp2.i”
ptxvars.cu(14): error: declaration is incompatible with “const struct uint3 threadIdx”
/usr/local/cuda/bin/…/include/device_launch_parameters.h(53): here
ptxvars.cu(15): error: declaration is incompatible with “const struct uint3 blockIdx”
/usr/local/cuda/bin/…/include/device_launch_parameters.h(55): here
ptxvars.cu(16): error: declaration is incompatible with “const struct dim3 blockDim”
/usr/local/cuda/bin/…/include/device_launch_parameters.h(57): here
ptxvars.cu(17): error: declaration is incompatible with “const struct dim3 gridDim”
/usr/local/cuda/bin/…/include/device_launch_parameters.h(59): here
4 errors detected in the compilation of “/tmp/tmpxft_0000472e_00000000-5_ptxvars.cpp2.i”.
–error 0x200 –
[/codebox]