nvcc.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. Copyright Benjamin Worpitz 2018
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. #ifndef BOOST_PREDEF_COMPILER_NVCC_H
  8. #define BOOST_PREDEF_COMPILER_NVCC_H
  9. #include <boost/predef/version_number.h>
  10. #include <boost/predef/make.h>
  11. /*`
  12. [heading `BOOST_COMP_NVCC`]
  13. [@https://en.wikipedia.org/wiki/NVIDIA_CUDA_Compiler NVCC] compiler.
  14. Version number available as major, minor, and patch beginning with version 7.5.
  15. [table
  16. [[__predef_symbol__] [__predef_version__]]
  17. [[`__NVCC__`] [__predef_detection__]]
  18. [[`__CUDACC_VER_MAJOR__`, `__CUDACC_VER_MINOR__`, `__CUDACC_VER_BUILD__`] [V.R.P]]
  19. ]
  20. */
  21. #define BOOST_COMP_NVCC BOOST_VERSION_NUMBER_NOT_AVAILABLE
  22. #if defined(__NVCC__)
  23. # if !defined(__CUDACC_VER_MAJOR__) || !defined(__CUDACC_VER_MINOR__) || !defined(__CUDACC_VER_BUILD__)
  24. # define BOOST_COMP_NVCC_DETECTION BOOST_VERSION_NUMBER_AVAILABLE
  25. # else
  26. # define BOOST_COMP_NVCC_DETECTION BOOST_VERSION_NUMBER(__CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, __CUDACC_VER_BUILD__)
  27. # endif
  28. #endif
  29. #ifdef BOOST_COMP_NVCC_DETECTION
  30. # if defined(BOOST_PREDEF_DETAIL_COMP_DETECTED)
  31. # define BOOST_COMP_NVCC_EMULATED BOOST_COMP_NVCC_DETECTION
  32. # else
  33. # undef BOOST_COMP_NVCC
  34. # define BOOST_COMP_NVCC BOOST_COMP_NVCC_DETECTION
  35. # endif
  36. # define BOOST_COMP_NVCC_AVAILABLE
  37. # include <boost/predef/detail/comp_detected.h>
  38. #endif
  39. #define BOOST_COMP_NVCC_NAME "NVCC"
  40. #endif
  41. #include <boost/predef/detail/test.h>
  42. BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_NVCC,BOOST_COMP_NVCC_NAME)
  43. #ifdef BOOST_COMP_NVCC_EMULATED
  44. #include <boost/predef/detail/test.h>
  45. BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_NVCC_EMULATED,BOOST_COMP_NVCC_NAME)
  46. #endif