CMakeCUDACompilerId.cu.in 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #ifdef SIMULATE_ID
  11. char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
  12. #endif
  13. @CMAKE_CUDA_COMPILER_ID_PLATFORM_CONTENT@
  14. @CMAKE_CUDA_COMPILER_ID_ERROR_FOR_TEST@
  15. const char* info_language_dialect_default = "INFO" ":" "dialect_default["
  16. #if __cplusplus > 201402L
  17. "17"
  18. #elif __cplusplus >= 201402L
  19. "14"
  20. #elif __cplusplus >= 201103L
  21. "11"
  22. #else
  23. "98"
  24. #endif
  25. "]";
  26. /*--------------------------------------------------------------------------*/
  27. int main(int argc, char* argv[])
  28. {
  29. int require = 0;
  30. require += info_compiler[argc];
  31. require += info_platform[argc];
  32. #ifdef COMPILER_VERSION_MAJOR
  33. require += info_version[argc];
  34. #endif
  35. #ifdef SIMULATE_ID
  36. require += info_simulate[argc];
  37. #endif
  38. #ifdef SIMULATE_VERSION_MAJOR
  39. require += info_simulate_version[argc];
  40. #endif
  41. require += info_language_dialect_default[argc];
  42. (void)argv;
  43. return require;
  44. }