cuda.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_LANGUAGE_CUDA_H
  8. #define BOOST_PREDEF_LANGUAGE_CUDA_H
  9. #include <boost/predef/version_number.h>
  10. #include <boost/predef/make.h>
  11. /*`
  12. [heading `BOOST_LANG_CUDA`]
  13. [@https://en.wikipedia.org/wiki/CUDA CUDA C/C++] language.
  14. If available, the version is detected as VV.RR.P.
  15. [table
  16. [[__predef_symbol__] [__predef_version__]]
  17. [[`__CUDACC__`] [__predef_detection__]]
  18. [[`__CUDA__`] [__predef_detection__]]
  19. [[`CUDA_VERSION`] [VV.RR.P]]
  20. ]
  21. */
  22. #define BOOST_LANG_CUDA BOOST_VERSION_NUMBER_NOT_AVAILABLE
  23. #if defined(__CUDACC__) || defined(__CUDA__)
  24. # undef BOOST_LANG_CUDA
  25. # include <cuda.h>
  26. # if defined(CUDA_VERSION)
  27. # define BOOST_LANG_CUDA BOOST_PREDEF_MAKE_10_VVRRP(CUDA_VERSION)
  28. # else
  29. # define BOOST_LANG_CUDA BOOST_VERSION_NUMBER_AVAILABLE
  30. # endif
  31. #endif
  32. #if BOOST_LANG_CUDA
  33. # define BOOST_LANG_CUDA_AVAILABLE
  34. #endif
  35. #define BOOST_LANG_CUDA_NAME "CUDA C/C++"
  36. #endif
  37. #include <boost/predef/detail/test.h>
  38. BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_CUDA,BOOST_LANG_CUDA_NAME)