Skip to content

Commit

Permalink
Improve builtin detection
Browse files Browse the repository at this point in the history
  • Loading branch information
fbusato committed Oct 4, 2024
1 parent d041193 commit df3fbd7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libcudacxx/include/cuda/std/__cccl/builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
#endif // _CCCL_HAS_BUILTIN(__array_extent)

#if _CCCL_HAS_BUILTIN(__builtin_assume_aligned) || (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION >= 1923) \
|| defined(_CCCL_COMPILER_GCC)
|| defined(_CCCL_COMPILER_GCC) || defined(_CCCL_COMPILER_NVHPC) || defined(_CCCL_COMPILER_CLANG) \
|| defined(_CCCL_CUDA_COMPILER_NVCC)
# define _CCCL_BUILTIN_ASSUME_ALIGNED(...) __builtin_assume_aligned(__VA_ARGS__)
#endif // _CCCL_HAS_BUILTIN(__builtin_assume_aligned)

Expand Down Expand Up @@ -136,7 +137,8 @@
#endif // _CCCL_CHECK_BUILTIN(builtin_expect)

#if _CCCL_CHECK_BUILTIN(builtin_is_constant_evaluated) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 90000) \
|| (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION > 1924 && !defined(_CCCL_CUDACC_BELOW_11_3))
|| (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION > 1924 && !defined(_CCCL_CUDACC_BELOW_11_3)) \
|| defined(_CCCL_COMPILER_CLANG) || defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_COMPILER_NVHPC)
# define _CCCL_BUILTIN_IS_CONSTANT_EVALUATED(...) __builtin_is_constant_evaluated(__VA_ARGS__)
#endif // _CCCL_CHECK_BUILTIN(builtin_is_constant_evaluated)

Expand Down

0 comments on commit df3fbd7

Please sign in to comment.