|
36 | 36 | # define THRUST_DEFAULT = default; |
37 | 37 | # define THRUST_NOEXCEPT noexcept |
38 | 38 | # define THRUST_FINAL final |
39 | | -# define THRUST_STATIC_CONSTANT static constexpr |
40 | 39 | #else |
41 | 40 | # define THRUST_CONSTEXPR |
42 | 41 | # define THRUST_OVERRIDE |
43 | 42 | # define THRUST_DEFAULT {} |
44 | 43 | # define THRUST_NOEXCEPT throw() |
45 | 44 | # define THRUST_FINAL |
46 | | -# define THRUST_STATIC_CONSTANT static const |
47 | 45 | #endif |
48 | 46 |
|
49 | 47 | #ifndef THRUST_NODISCARD |
50 | 48 | # define THRUST_NODISCARD |
51 | 49 | #endif |
52 | 50 |
|
| 51 | +// FIXME: Combine THRUST_INLINE_CONSTANT and |
| 52 | +// THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT into one macro when NVCC properly |
| 53 | +// supports `constexpr` globals in host and device code. |
53 | 54 | #ifdef __CUDA_ARCH__ |
54 | | -# if THRUST_CPP_DIALECT >= 2017 |
55 | | -# define THRUST_INLINE_CONSTANT inline const __device__ |
56 | | -# elif THRUST_CPP_DIALECT >= 2011 |
57 | | -# define THRUST_INLINE_CONSTANT static const __device__ |
| 55 | +// FIXME: Add this when NVCC supports inline variables. |
| 56 | +//# if THRUST_CPP_DIALECT >= 2017 |
| 57 | +//# define THRUST_INLINE_CONSTANT inline constexpr |
| 58 | +//# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT inline constexpr |
| 59 | +# if THRUST_CPP_DIALECT >= 2011 |
| 60 | +# define THRUST_INLINE_CONSTANT static constexpr |
| 61 | +# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static constexpr |
58 | 62 | # else |
59 | | -# define THRUST_INLINE_CONSTANT static const __device__ |
| 63 | +# define THRUST_INLINE_CONSTANT static const __device__ |
| 64 | +# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static const |
60 | 65 | # endif |
61 | 66 | #else |
62 | | -# if THRUST_CPP_DIALECT >= 2017 |
63 | | -# define THRUST_INLINE_CONSTANT inline constexpr |
64 | | -# elif THRUST_CPP_DIALECT >= 2011 |
65 | | -# define THRUST_INLINE_CONSTANT static constexpr |
| 67 | +// FIXME: Add this when NVCC supports inline variables. |
| 68 | +//# if THRUST_CPP_DIALECT >= 2017 |
| 69 | +//# define THRUST_INLINE_CONSTANT inline constexpr |
| 70 | +//# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT inline constexpr |
| 71 | +# if THRUST_CPP_DIALECT >= 2011 |
| 72 | +# define THRUST_INLINE_CONSTANT static constexpr |
| 73 | +# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static constexpr |
66 | 74 | # else |
67 | | -# define THRUST_INLINE_CONSTANT static const |
| 75 | +# define THRUST_INLINE_CONSTANT static const |
| 76 | +# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static const |
68 | 77 | # endif |
69 | 78 | #endif |
70 | 79 |
|
0 commit comments