CMakeCUDACompilerId.cu.in 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __CUDACC__
  2. # error "A C or C++ compiler has been selected for CUDA"
  3. #endif
  4. @CMAKE_CUDA_COMPILER_ID_CONTENT@
  5. /* Construct the string literal in pieces to prevent the source from
  6. getting matched. Store it in a pointer rather than an array
  7. because some compilers will just produce instructions to fill the
  8. array rather than assigning a pointer to a static array. */
  9. char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
  10. @CMAKE_CUDA_COMPILER_ID_PLATFORM_CONTENT@
  11. @CMAKE_CUDA_COMPILER_ID_ERROR_FOR_TEST@
  12. const char* info_language_dialect_default = "INFO" ":" "dialect_default["
  13. #if __cplusplus >= 201402L
  14. "14"
  15. #elif __cplusplus >= 201103L
  16. "11"
  17. #else
  18. "98"
  19. #endif
  20. "]";
  21. /*--------------------------------------------------------------------------*/
  22. int main(int argc, char* argv[])
  23. {
  24. int require = 0;
  25. require += info_compiler[argc];
  26. require += info_platform[argc];
  27. #ifdef COMPILER_VERSION_MAJOR
  28. require += info_version[argc];
  29. #endif
  30. require += info_language_dialect_default[argc];
  31. (void)argv;
  32. return require;
  33. }