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