Skip to content

Commit

Permalink
Ensure that we only use the inline variable trait when it is actually…
Browse files Browse the repository at this point in the history
… available
  • Loading branch information
miscco committed Nov 6, 2024
1 parent 2a7889b commit 7fc2fbd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libcudacxx/include/cuda/std/__cccl/dialect.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@
# define _CCCL_ELSE_IF_CONSTEXPR else if
#endif // _CCCL_STD_VER <= 2014

#if _CCCL_STD_VER >= 2017
# define _CCCL_TRAIT(__TRAIT, ...) __TRAIT##_v<__VA_ARGS__>
#else // ^^^ C++17 ^^^ / vvv C++14 vvv
# define _CCCL_TRAIT(__TRAIT, ...) __TRAIT<__VA_ARGS__>::value
#endif // _CCCL_STD_VER <= 2014

// In nvcc prior to 11.3 global variables could not be marked constexpr
#if defined(_CCCL_CUDACC_BELOW_11_3)
# define _CCCL_CONSTEXPR_GLOBAL const
Expand All @@ -110,6 +104,12 @@
# define _CCCL_NO_VARIABLE_TEMPLATES
#endif // _CCCL_STD_VER <= 2011

#if defined(_CCCL_NO_INLINE_VARIABLES)
# define _CCCL_TRAIT(__TRAIT, ...) __TRAIT<__VA_ARGS__>::value
#else // ^^^ _CCCL_NO_INLINE_VARIABLES ^^^ / vvv !_CCCL_NO_INLINE_VARIABLES vvv
# define _CCCL_TRAIT(__TRAIT, ...) __TRAIT##_v<__VA_ARGS__>
#endif // _CCCL_NO_INLINE_VARIABLES

// We need to treat host and device separately
#if defined(__CUDA_ARCH__)
# define _CCCL_GLOBAL_CONSTANT _CCCL_DEVICE _CCCL_CONSTEXPR_GLOBAL
Expand Down

0 comments on commit 7fc2fbd

Please sign in to comment.