CUDA_VERSION in 7.5RC, and taking different code paths depending on NVCC version and/or C++11 suppor

Hi,

is it expected behavior to see a CUDA_VERSION of 7000 indicated with the 7.5RC?

Also: is there a preprocessor define that returns the NVCC version? I would like to do a compile time check so I can take different compile paths depending on the support for lambda functions and other C++11 features, for example.

Would you guys happen to know what __cplusplus returns when I use the --std=c++11 option in nvcc vs. when I don’t give that option?

Christian

Here’s what it says in the CUDA 7.5 RC NVCC Compiler Driver PDF:

nvcc predefines the following macros:

  • __NVCC__ Defined when compiling C/C++/CUDA source files.
  • __CUDACC__ Defined when compiling CUDA source files.
  • __CUDACC_RDC__ Defined when compiling CUDA sources files in relocatable device code mode
  • __CUDACC_VER_MAJOR__ Defined with the major version number of nvcc.
  • __CUDACC_VER_MINOR__ Defined with the minor version number of nvcc.
  • __CUDACC_VER_BUILD__ Defined with the build version number of nvcc.
  • __CUDACC_VER__ Defined with the full version number of nvcc, represented as __CUDACC_VER_MAJOR__ * 10000 + __CUDACC_VER_MINOR__ * 100 + __CUDACC_VER_BUILD__