From 968bb3075a188035ef7164cd5854e7a2cc7f9f6f Mon Sep 17 00:00:00 2001 From: David Bayer <48736217+davebayer@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:20:23 +0100 Subject: [PATCH] move `_CCCL_COMPILER_CLANG` to the new macro (#2859) --- cub/cub/block/block_load.cuh | 4 ++-- cub/cub/util_compiler.cuh | 6 +++--- cub/cub/util_cpp_dialect.cuh | 2 +- cub/cub/util_deprecated.cuh | 2 +- cub/cub/util_type.cuh | 2 +- .../include/cuda/experimental/__async/utility.cuh | 2 +- libcudacxx/include/cuda/std/__cccl/attributes.h | 8 ++++---- libcudacxx/include/cuda/std/__cccl/builtin.h | 8 ++++---- libcudacxx/include/cuda/std/__cccl/compiler.h | 5 ++--- libcudacxx/include/cuda/std/__cccl/diagnostic.h | 8 ++++---- libcudacxx/include/cuda/std/__cccl/rtti.h | 4 ++-- libcudacxx/include/cuda/std/__cccl/system_header.h | 4 ++-- .../include/cuda/std/__concepts/__concept_macros.h | 2 +- .../cuda/std/detail/libcxx/include/__config | 14 +++++++------- thrust/testing/unittest/runtime_static_assert.h | 2 +- thrust/thrust/detail/config/compiler.h | 6 +++--- thrust/thrust/detail/config/compiler_fence.h | 2 +- thrust/thrust/detail/config/cpp_dialect.h | 2 +- thrust/thrust/detail/config/deprecated.h | 2 +- 19 files changed, 42 insertions(+), 43 deletions(-) diff --git a/cub/cub/block/block_load.cuh b/cub/cub/block/block_load.cuh index 284ac4401e0..641ff6d5d09 100644 --- a/cub/cub/block/block_load.cuh +++ b/cub/cub/block/block_load.cuh @@ -199,9 +199,9 @@ InternalLoadDirectBlockedVectorized(int linear_tid, const T* block_src_ptr, T (& // Find biggest memory access word that T is a whole multiple of using device_word_t = typename UnitWord::DeviceWord; _CCCL_DIAG_PUSH -# if defined(CUB_CLANG_VERSION) && CUB_CLANG_VERSION >= 100000 +# if _CCCL_COMPILER(CLANG, >=, 10) _CCCL_DIAG_SUPPRESS_CLANG("-Wsizeof-array-div") -# endif // defined(CUB_CLANG_VERSION) && CUB_CLANG_VERSION >= 100000 +# endif // _CCCL_COMPILER(CLANG, >=, 10) constexpr int total_words = static_cast(sizeof(dst_items) / sizeof(device_word_t)); _CCCL_DIAG_POP constexpr int vector_size = (total_words % 4 == 0) ? 4 : (total_words % 2 == 0) ? 2 : 1; diff --git a/cub/cub/util_compiler.cuh b/cub/cub/util_compiler.cuh index d0d4ae79098..6385e795045 100644 --- a/cub/cub/util_compiler.cuh +++ b/cub/cub/util_compiler.cuh @@ -73,11 +73,11 @@ # define CUB_MSVC_VERSION _CCCL_MSVC_VERSION //! deprecated [Since 2.7] # define CUB_MSVC_VERSION_FULL _CCCL_MSVC_VERSION_FULL -#elif defined(_CCCL_COMPILER_CLANG) +#elif _CCCL_COMPILER(CLANG) //! deprecated [Since 2.7] # define CUB_HOST_COMPILER CUB_HOST_COMPILER_CLANG //! deprecated [Since 2.7] -# define CUB_CLANG_VERSION _CCCL_CLANG_VERSION +# define CUB_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) #elif _CCCL_COMPILER(GCC) //! deprecated [Since 2.7] # define CUB_HOST_COMPILER CUB_HOST_COMPILER_GCC @@ -95,7 +95,7 @@ #elif _CCCL_COMPILER(GCC) //! deprecated [Since 2.7] # define CUB_DEVICE_COMPILER CUB_DEVICE_COMPILER_GCC -#elif defined(_CCCL_COMPILER_CLANG) +#elif _CCCL_COMPILER(CLANG) // CUDA-capable clang should behave similar to NVCC. # if defined(_CCCL_CUDA_COMPILER_NVCC) //! deprecated [Since 2.7] diff --git a/cub/cub/util_cpp_dialect.cuh b/cub/cub/util_cpp_dialect.cuh index fdf65e49431..006a070a7e9 100644 --- a/cub/cub/util_cpp_dialect.cuh +++ b/cub/cub/util_cpp_dialect.cuh @@ -99,7 +99,7 @@ // Compiler checks: # if _CCCL_COMPILER(GCC, <, 5) CUB_COMPILER_DEPRECATION(GCC 5.0); -# elif defined(_CCCL_COMPILER_CLANG) && _CCCL_CLANG_VERSION < 70000 +# elif _CCCL_COMPILER(CLANG, <, 7) CUB_COMPILER_DEPRECATION(Clang 7.0); # elif defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION < 1910 // <2017. Hard upgrade message: diff --git a/cub/cub/util_deprecated.cuh b/cub/cub/util_deprecated.cuh index 68e1e6bce53..250c3f53b16 100644 --- a/cub/cub/util_deprecated.cuh +++ b/cub/cub/util_deprecated.cuh @@ -58,7 +58,7 @@ #elif defined(_CCCL_COMPILER_MSVC) # define CUB_DEPRECATED __declspec(deprecated) # define CUB_DEPRECATED_BECAUSE(MSG) __declspec(deprecated(MSG)) -#elif defined(_CCCL_COMPILER_CLANG) +#elif _CCCL_COMPILER(CLANG) # define CUB_DEPRECATED __attribute__((deprecated)) # define CUB_DEPRECATED_BECAUSE(MSG) __attribute__((deprecated(MSG))) #elif _CCCL_COMPILER(GCC) diff --git a/cub/cub/util_type.cuh b/cub/cub/util_type.cuh index ed3c9607e69..42ffef0f6b0 100644 --- a/cub/cub/util_type.cuh +++ b/cub/cub/util_type.cuh @@ -74,7 +74,7 @@ CUB_NAMESPACE_BEGIN # endif // !defined(__CUDACC_RTC_INT128__) # else // !defined(__CUDACC_RTC__) # if _CCCL_CUDACC_AT_LEAST(11, 5) -# if _CCCL_COMPILER(GCC) || defined(_CCCL_COMPILER_CLANG) || _CCCL_COMPILER(ICC) || _CCCL_COMPILER(NVHPC) +# if _CCCL_COMPILER(GCC) || _CCCL_COMPILER(CLANG) || _CCCL_COMPILER(ICC) || _CCCL_COMPILER(NVHPC) # define CUB_IS_INT128_ENABLED 1 # endif // GCC || CLANG || ICC || NVHPC # endif // _CCCL_CUDACC_AT_LEAST(11, 5) diff --git a/cudax/include/cuda/experimental/__async/utility.cuh b/cudax/include/cuda/experimental/__async/utility.cuh index b38cefe6b15..f349fe3ddc9 100644 --- a/cudax/include/cuda/experimental/__async/utility.cuh +++ b/cudax/include/cuda/experimental/__async/utility.cuh @@ -176,7 +176,7 @@ constexpr size_t __next(long) // Prior to Clang 12, we can't use the __slot trick to erase long type names // because of a compiler bug. We'll just use the original type name in that case. -#if defined(_CCCL_COMPILER_CLANG) && _CCCL_CLANG_VERSION < 120000 +#if _CCCL_COMPILER(CLANG, <, 12) template using __zip = _Type; diff --git a/libcudacxx/include/cuda/std/__cccl/attributes.h b/libcudacxx/include/cuda/std/__cccl/attributes.h index 397baf28335..7a8bcb49f0b 100644 --- a/libcudacxx/include/cuda/std/__cccl/attributes.h +++ b/libcudacxx/include/cuda/std/__cccl/attributes.h @@ -76,9 +76,9 @@ // Passing objects with nested [[no_unique_address]] to kernels leads to data corruption // This happens up to clang18 -#if !defined(_CCCL_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS) && defined(_CCCL_COMPILER_CLANG) +#if !defined(_CCCL_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS) && _CCCL_COMPILER(CLANG) # define _CCCL_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS -#endif // !_CCCL_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS && _CCCL_COMPILER_CLANG +#endif // !_CCCL_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS && _CCCL_COMPILER(CLANG) #if _CCCL_HAS_CPP_ATTRIBUTE(nodiscard) || (defined(_CCCL_COMPILER_MSVC) && _CCCL_STD_VER >= 2017) # define _CCCL_NODISCARD [[nodiscard]] @@ -88,11 +88,11 @@ // NVCC below 11.3 does not support nodiscard on friend operators // It always fails with clang -#if _CCCL_CUDACC_BELOW(11, 3) || defined(_CCCL_COMPILER_CLANG) +#if _CCCL_CUDACC_BELOW(11, 3) || _CCCL_COMPILER(CLANG) # define _CCCL_NODISCARD_FRIEND friend #else // ^^^ _CCCL_CUDACC_BELOW(11, 3) ^^^ / vvv _CCCL_CUDACC_AT_LEAST(11, 3) vvv # define _CCCL_NODISCARD_FRIEND _CCCL_NODISCARD friend -#endif // _CCCL_CUDACC_AT_LEAST(11, 3) && !_CCCL_COMPILER_CLANG +#endif // _CCCL_CUDACC_AT_LEAST(11, 3) && !_CCCL_COMPILER(CLANG) // NVCC below 11.3 does not support attributes on alias declarations #if _CCCL_CUDACC_BELOW(11, 3) diff --git a/libcudacxx/include/cuda/std/__cccl/builtin.h b/libcudacxx/include/cuda/std/__cccl/builtin.h index 69d621697cf..ac93b0f8caf 100644 --- a/libcudacxx/include/cuda/std/__cccl/builtin.h +++ b/libcudacxx/include/cuda/std/__cccl/builtin.h @@ -123,7 +123,7 @@ // clang prior to clang-10 supports __builtin_bit_cast but it is not a constant expression // NVCC prior to 11.7 cannot parse __builtin_bit_cast -#if (defined(_CCCL_COMPILER_CLANG) && _CCCL_CLANG_VERSION < 100000) || _CCCL_CUDACC_BELOW(11, 7) +#if _CCCL_COMPILER(CLANG, <, 10) || _CCCL_CUDACC_BELOW(11, 7) # undef _CCCL_BUILTIN_BIT_CAST #endif // clang < 10 || nvcc < 11.7 @@ -189,7 +189,7 @@ // NVCC prior to 11.3 and clang prior to clang-10 accept __builtin_launder but break with a compiler error about an // invalid return type -#if (defined(_CCCL_COMPILER_CLANG) && _CCCL_CLANG_VERSION < 100000) || _CCCL_CUDACC_BELOW(11, 3) +#if _CCCL_COMPILER(CLANG, <, 10) || _CCCL_CUDACC_BELOW(11, 3) # undef _CCCL_BUILTIN_LAUNDER #endif // clang < 10 || nvcc < 11.3 @@ -264,7 +264,7 @@ #endif // _CCCL_CHECK_BUILTIN(is_array) // clang prior to clang-19 gives wrong results for __is_array of _Tp[0] -#if defined(_CCCL_COMPILER_CLANG) && _CCCL_CLANG_VERSION < 190000 +#if _CCCL_COMPILER(CLANG, <, 19) # undef _CCCL_BUILTIN_IS_ARRAY #endif // clang < 19 @@ -333,7 +333,7 @@ #endif // _CCCL_CHECK_BUILTIN(is_fundamental) // clang prior to clang-10 gives wrong results for __is_fundamental -#if defined(_CCCL_COMPILER_CLANG) && _CCCL_CLANG_VERSION < 100000 +#if _CCCL_COMPILER(CLANG, <, 10) # undef _CCCL_BUILTIN_IS_FUNDAMENTAL #endif // clang < 10 diff --git a/libcudacxx/include/cuda/std/__cccl/compiler.h b/libcudacxx/include/cuda/std/__cccl/compiler.h index 932f7099d09..89c054a12a1 100644 --- a/libcudacxx/include/cuda/std/__cccl/compiler.h +++ b/libcudacxx/include/cuda/std/__cccl/compiler.h @@ -23,8 +23,7 @@ #elif defined(__NVCOMPILER) # define _CCCL_COMPILER_NVHPC _CCCL_COMPILER_MAKE_VERSION(__NVCOMPILER_MAJOR__, __NVCOMPILER_MINOR__) #elif defined(__clang__) -# define _CCCL_COMPILER_CLANG -# define _CCCL_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) +# define _CCCL_COMPILER_CLANG _CCCL_COMPILER_MAKE_VERSION(__clang_major__, __clang_minor__) #elif defined(__GNUC__) # define _CCCL_COMPILER_GCC _CCCL_COMPILER_MAKE_VERSION(__GNUC__, __GNUC_MINOR__) #elif defined(_MSC_VER) @@ -69,7 +68,7 @@ # define _CCCL_CUDA_COMPILER_NVCC #elif defined(_NVHPC_CUDA) # define _CCCL_CUDA_COMPILER_NVHPC -#elif defined(__CUDA__) && defined(_CCCL_COMPILER_CLANG) +#elif defined(__CUDA__) && _CCCL_COMPILER(CLANG) # define _CCCL_CUDA_COMPILER_CLANG #endif diff --git a/libcudacxx/include/cuda/std/__cccl/diagnostic.h b/libcudacxx/include/cuda/std/__cccl/diagnostic.h index 77dfc8a1469..4183fd96bf7 100644 --- a/libcudacxx/include/cuda/std/__cccl/diagnostic.h +++ b/libcudacxx/include/cuda/std/__cccl/diagnostic.h @@ -23,7 +23,7 @@ #endif // no system header // Enable us to selectively silence host compiler warnings -#ifdef _CCCL_COMPILER_CLANG +#if _CCCL_COMPILER(CLANG) # define _CCCL_DIAG_PUSH _CCCL_PRAGMA(clang diagnostic push) # define _CCCL_DIAG_POP _CCCL_PRAGMA(clang diagnostic pop) # define _CCCL_DIAG_SUPPRESS_CLANG(str) _CCCL_PRAGMA(clang diagnostic ignored str) @@ -74,7 +74,7 @@ #endif // Convenient shortcuts to silence common warnings -#if defined(_CCCL_COMPILER_CLANG) +#if _CCCL_COMPILER(CLANG) # define _CCCL_SUPPRESS_DEPRECATED_PUSH \ _CCCL_DIAG_PUSH \ _CCCL_DIAG_SUPPRESS_CLANG("-Wdeprecated") \ @@ -101,11 +101,11 @@ _CCCL_DIAG_PUSH \ _CCCL_DIAG_SUPPRESS_MSVC(4996) # define _CCCL_SUPPRESS_DEPRECATED_POP _CCCL_DIAG_POP -#else // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER(ICC) && && !_CCCL_COMPILER(GCC) && !_CCCL_COMPILER(NVHPC) && +#else // !_CCCL_COMPILER(CLANG) && !_CCCL_COMPILER(ICC) && && !_CCCL_COMPILER(GCC) && !_CCCL_COMPILER(NVHPC) && // !_CCCL_COMPILER_MSVC # define _CCCL_SUPPRESS_DEPRECATED_PUSH # define _CCCL_SUPPRESS_DEPRECATED_POP -#endif // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER(ICC) && && !_CCCL_COMPILER(GCC) && !_CCCL_COMPILER(NVHPC) && +#endif // !_CCCL_COMPILER(CLANG) && !_CCCL_COMPILER(ICC) && && !_CCCL_COMPILER(GCC) && !_CCCL_COMPILER(NVHPC) && // !_CCCL_COMPILER_MSVC // Enable us to selectively silence cuda compiler warnings diff --git a/libcudacxx/include/cuda/std/__cccl/rtti.h b/libcudacxx/include/cuda/std/__cccl/rtti.h index 80f216ef0d6..502407a0607 100644 --- a/libcudacxx/include/cuda/std/__cccl/rtti.h +++ b/libcudacxx/include/cuda/std/__cccl/rtti.h @@ -42,7 +42,7 @@ # if _CPPRTTI == 0 # define _CCCL_NO_RTTI # endif -# elif defined(_CCCL_COMPILER_CLANG) +# elif _CCCL_COMPILER(CLANG) # if !_CCCL_HAS_FEATURE(cxx_rtti) # define _CCCL_NO_RTTI # endif @@ -67,7 +67,7 @@ # define _CCCL_NO_TYPEID # elif defined(_CCCL_COMPILER_MSVC) // No-op, MSVC always supports typeid even when RTTI is disabled -# elif defined(_CCCL_COMPILER_CLANG) +# elif _CCCL_COMPILER(CLANG) # if !_CCCL_HAS_FEATURE(cxx_rtti) # define _CCCL_NO_TYPEID # endif diff --git a/libcudacxx/include/cuda/std/__cccl/system_header.h b/libcudacxx/include/cuda/std/__cccl/system_header.h index 1a46e108213..2285bcf1651 100644 --- a/libcudacxx/include/cuda/std/__cccl/system_header.h +++ b/libcudacxx/include/cuda/std/__cccl/system_header.h @@ -17,7 +17,7 @@ // Enforce that cccl headers are treated as system headers #if _CCCL_COMPILER(GCC) || _CCCL_COMPILER(NVHPC) || _CCCL_COMPILER(ICC) # define _CCCL_FORCE_SYSTEM_HEADER_GCC -#elif defined(_CCCL_COMPILER_CLANG) +#elif _CCCL_COMPILER(CLANG) # define _CCCL_FORCE_SYSTEM_HEADER_CLANG #elif defined(_CCCL_COMPILER_MSVC) # define _CCCL_FORCE_SYSTEM_HEADER_MSVC @@ -29,7 +29,7 @@ && !defined(_LIBCUDACXX_DISABLE_PRAGMA_GCC_SYSTEM_HEADER) # if _CCCL_COMPILER(GCC) || _CCCL_COMPILER(NVHPC) || _CCCL_COMPILER(ICC) # define _CCCL_IMPLICIT_SYSTEM_HEADER_GCC -# elif defined(_CCCL_COMPILER_CLANG) +# elif _CCCL_COMPILER(CLANG) # define _CCCL_IMPLICIT_SYSTEM_HEADER_CLANG # elif defined(_CCCL_COMPILER_MSVC) # define _CCCL_IMPLICIT_SYSTEM_HEADER_MSVC diff --git a/libcudacxx/include/cuda/std/__concepts/__concept_macros.h b/libcudacxx/include/cuda/std/__concepts/__concept_macros.h index 0a1332c52c8..c2a06d4bcad 100644 --- a/libcudacxx/include/cuda/std/__concepts/__concept_macros.h +++ b/libcudacxx/include/cuda/std/__concepts/__concept_macros.h @@ -435,7 +435,7 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool _Is_true() return true; } -# if defined(_CCCL_COMPILER_CLANG) || defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(CLANG) || defined(_CCCL_COMPILER_MSVC) template _LIBCUDACXX_HIDE_FROM_ABI _Concept::_Enable_if_t<_Bp> _Requires() {} diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/__config b/libcudacxx/include/cuda/std/detail/libcxx/include/__config index f75776e3c96..2cdeeb4c1ef 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/__config +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/__config @@ -315,11 +315,11 @@ extern "C++" { # if defined(_CCCL_CUDA_COMPILER) # define _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(size, ptr) (size <= 8) -# elif defined(_CCCL_COMPILER_CLANG) || _CCCL_COMPILER(GCC) +# elif _CCCL_COMPILER(CLANG) || _CCCL_COMPILER(GCC) # define _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(...) __atomic_always_lock_free(__VA_ARGS__) # endif // _CCCL_CUDA_COMPILER -# if defined(_CCCL_COMPILER_CLANG) +# if _CCCL_COMPILER(CLANG) // _LIBCUDACXX_ALTERNATE_STRING_LAYOUT is an old name for // _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility. @@ -447,7 +447,7 @@ typedef __char32_t char32_t; # if !defined(__SANITIZE_ADDRESS__) # define _LIBCUDACXX_HAS_NO_ASAN # endif // !__SANITIZE_ADDRESS__ -# elif defined(_CCCL_COMPILER_CLANG) +# elif _CCCL_COMPILER(CLANG) # if !_CCCL_HAS_FEATURE(address_sanitizer) # define _LIBCUDACXX_HAS_NO_ASAN # endif // !_CCCL_HAS_FEATURE(address_sanitizer) @@ -570,13 +570,13 @@ typedef unsigned short char16_t; typedef unsigned int char32_t; # endif // _LIBCUDACXX_HAS_NO_UNICODE_CHARS -# if _CCCL_COMPILER(GCC) || defined(_CCCL_COMPILER_CLANG) +# if _CCCL_COMPILER(GCC) || _CCCL_COMPILER(CLANG) # define _LIBCUDACXX_NOALIAS __attribute__((__malloc__)) # else # define _LIBCUDACXX_NOALIAS # endif -# if _CCCL_HAS_FEATURE(cxx_explicit_conversions) || _CCCL_COMPILER(GCC) || defined(_CCCL_COMPILER_CLANG) +# if _CCCL_HAS_FEATURE(cxx_explicit_conversions) || _CCCL_COMPILER(GCC) || _CCCL_COMPILER(CLANG) # define _LIBCUDACXX_EXPLICIT explicit # else # define _LIBCUDACXX_EXPLICIT @@ -738,7 +738,7 @@ typedef unsigned int char32_t; // # define _LIBCUDACXX_HAS_C_ATOMIC_IMP # if _CCCL_COMPILER(ICC) # define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP -# elif defined(_CCCL_COMPILER_CLANG) +# elif _CCCL_COMPILER(CLANG) # define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP # elif _CCCL_COMPILER(GCC) # define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP @@ -876,7 +876,7 @@ typedef unsigned int char32_t; // NVRTC has a bug that prevented the use of delegated constructors, as it did not accept execution space annotations. // This creates a whole lot of boilerplate that we can avoid through a macro (see nvbug3961621) -# if _CCCL_COMPILER(NVRTC) || (_CCCL_CUDACC_BELOW(11, 3) && defined(_CCCL_COMPILER_CLANG)) +# if _CCCL_COMPILER(NVRTC) || (_CCCL_CUDACC_BELOW(11, 3) && _CCCL_COMPILER(CLANG)) # define _LIBCUDACXX_DELEGATE_CONSTRUCTORS(__class, __baseclass, ...) \ using __base = __baseclass<__VA_ARGS__>; \ template = 0> \ diff --git a/thrust/testing/unittest/runtime_static_assert.h b/thrust/testing/unittest/runtime_static_assert.h index 7b6f22680d9..73cb1d235b2 100644 --- a/thrust/testing/unittest/runtime_static_assert.h +++ b/thrust/testing/unittest/runtime_static_assert.h @@ -97,7 +97,7 @@ class static_assert_exception namespace detail { -#if _CCCL_COMPILER(GCC) || defined(_CCCL_COMPILER_CLANG) +#if _CCCL_COMPILER(GCC) || _CCCL_COMPILER(CLANG) __attribute__((used)) #endif _CCCL_DEVICE static static_assert_exception* device_exception = nullptr; diff --git a/thrust/thrust/detail/config/compiler.h b/thrust/thrust/detail/config/compiler.h index fce56c605c9..6b73b04f55e 100644 --- a/thrust/thrust/detail/config/compiler.h +++ b/thrust/thrust/detail/config/compiler.h @@ -65,11 +65,11 @@ #elif _CCCL_COMPILER(ICC) //! deprecated [Since 2.7] # define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_INTEL -#elif defined(_CCCL_COMPILER_CLANG) +#elif _CCCL_COMPILER(CLANG) //! deprecated [Since 2.7] # define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_CLANG //! deprecated [Since 2.7] -# define THRUST_CLANG_VERSION _CCCL_CLANG_VERSION +# define THRUST_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) #elif _CCCL_COMPILER(GCC) //! deprecated [Since 2.7] # define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_GCC @@ -97,7 +97,7 @@ #elif _CCCL_COMPILER(GCC) //! deprecated [Since 2.7] # define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_GCC -#elif defined(_CCCL_COMPILER_CLANG) +#elif _CCCL_COMPILER(CLANG) // CUDA-capable clang should behave similar to NVCC. # if defined(__CUDA__) //! deprecated [Since 2.7] diff --git a/thrust/thrust/detail/config/compiler_fence.h b/thrust/thrust/detail/config/compiler_fence.h index ef9c0ef8153..fc8cda95682 100644 --- a/thrust/thrust/detail/config/compiler_fence.h +++ b/thrust/thrust/detail/config/compiler_fence.h @@ -66,7 +66,7 @@ # endif // _CCCL_COMPILER(GCC, >=, 4, 2) // unknown case -#elif defined(_CCCL_COMPILER_CLANG) +#elif _CCCL_COMPILER(CLANG) # define __thrust_compiler_fence() __sync_synchronize() #else diff --git a/thrust/thrust/detail/config/cpp_dialect.h b/thrust/thrust/detail/config/cpp_dialect.h index 9f3f99be4cc..e7589b39638 100644 --- a/thrust/thrust/detail/config/cpp_dialect.h +++ b/thrust/thrust/detail/config/cpp_dialect.h @@ -87,7 +87,7 @@ // Compiler checks: # if _CCCL_COMPILER(GCC, <, 5) THRUST_COMPILER_DEPRECATION(GCC 5.0); -# elif defined(_CCCL_COMPILER_CLANG) && THRUST_CLANG_VERSION < 70000 +# elif _CCCL_COMPILER(CLANG, <, 7) THRUST_COMPILER_DEPRECATION(Clang 7.0); # elif defined(_CCCL_COMPILER_MSVC) && THRUST_MSVC_VERSION < 1910 // <2017. Hard upgrade message: diff --git a/thrust/thrust/detail/config/deprecated.h b/thrust/thrust/detail/config/deprecated.h index 1ff1bb48752..af53047212d 100644 --- a/thrust/thrust/detail/config/deprecated.h +++ b/thrust/thrust/detail/config/deprecated.h @@ -46,7 +46,7 @@ #elif defined(_CCCL_COMPILER_MSVC) # define THRUST_DEPRECATED __declspec(deprecated) # define THRUST_DEPRECATED_BECAUSE(MSG) __declspec(deprecated(MSG)) -#elif defined(_CCCL_COMPILER_CLANG) +#elif _CCCL_COMPILER(CLANG) # define THRUST_DEPRECATED __attribute__((deprecated)) # define THRUST_DEPRECATED_BECAUSE(MSG) __attribute__((deprecated(MSG))) #elif _CCCL_COMPILER(GCC)