nvcc.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 MSGPACK_PREDEF_COMPILER_NVCC_H
  8. #define MSGPACK_PREDEF_COMPILER_NVCC_H
  9. #include <msgpack/predef/version_number.h>
  10. #include <msgpack/predef/make.h>
  11. /*`
  12. [heading `MSGPACK_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 MSGPACK_COMP_NVCC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
  22. #if defined(__NVCC__)
  23. # if !defined(__CUDACC_VER_MAJOR__) || !defined(__CUDACC_VER_MINOR__) || !defined(__CUDACC_VER_BUILD__)
  24. # define MSGPACK_COMP_NVCC_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
  25. # else
  26. # define MSGPACK_COMP_NVCC_DETECTION MSGPACK_VERSION_NUMBER(__CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, __CUDACC_VER_BUILD__)
  27. # endif
  28. #endif
  29. #ifdef MSGPACK_COMP_NVCC_DETECTION
  30. # if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
  31. # define MSGPACK_COMP_NVCC_EMULATED MSGPACK_COMP_NVCC_DETECTION
  32. # else
  33. # undef MSGPACK_COMP_NVCC
  34. # define MSGPACK_COMP_NVCC MSGPACK_COMP_NVCC_DETECTION
  35. # endif
  36. # define MSGPACK_COMP_NVCC_AVAILABLE
  37. # include <msgpack/predef/detail/comp_detected.h>
  38. #endif
  39. #define MSGPACK_COMP_NVCC_NAME "NVCC"
  40. #endif
  41. #include <msgpack/predef/detail/test.h>
  42. MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_NVCC,MSGPACK_COMP_NVCC_NAME)
  43. #ifdef MSGPACK_COMP_NVCC_EMULATED
  44. #include <msgpack/predef/detail/test.h>
  45. MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_NVCC_EMULATED,MSGPACK_COMP_NVCC_NAME)
  46. #endif