From 5fa8e0a36d458348e4bc470ffd54743c59a8dc72 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Sun, 17 Nov 2024 18:10:15 +0100 Subject: [PATCH 1/2] Move `_CCCL_COMPILER_NVRTC` to the new macro definition --- cub/cub/detail/detect_cuda_runtime.cuh | 4 +- .../cache_modified_input_iterator.cuh | 16 ++--- cub/cub/iterator/counting_input_iterator.cuh | 14 ++--- cub/cub/util_type.cuh | 12 ++-- .../cuda/__barrier/barrier_block_scope.h | 6 +- .../cuda/std/__atomic/functions/host.h | 4 +- libcudacxx/include/cuda/std/__cccl/assert.h | 12 ++-- .../include/cuda/std/__cccl/attributes.h | 2 +- libcudacxx/include/cuda/std/__cccl/builtin.h | 60 +++++++++---------- libcudacxx/include/cuda/std/__cccl/compiler.h | 4 +- .../include/cuda/std/__cccl/diagnostic.h | 2 +- .../include/cuda/std/__cccl/exceptions.h | 2 +- .../std/__cccl/is_non_narrowing_convertible.h | 2 +- libcudacxx/include/cuda/std/__cccl/ptx_isa.h | 4 +- libcudacxx/include/cuda/std/__cccl/rtti.h | 4 +- .../include/cuda/std/__cccl/system_header.h | 6 +- .../include/cuda/std/__cccl/visibility.h | 16 ++--- .../include/cuda/std/__complex/nvbf16.h | 12 ++-- .../include/cuda/std/__complex/nvfp16.h | 12 ++-- .../include/cuda/std/__cuda/climits_prelude.h | 6 +- .../include/cuda/std/__cuda/cstddef_prelude.h | 4 +- .../include/cuda/std/__cuda/cstdint_prelude.h | 6 +- .../include/cuda/std/__exception/cuda_error.h | 4 +- .../cuda/std/__functional/bind_front.h | 2 +- .../include/cuda/std/__functional/not_fn.h | 2 +- .../cuda/std/__iterator/iterator_traits.h | 10 ++-- .../__mdspan/standard_layout_static_array.h | 12 ++-- .../include/cuda/std/__mdspan/static_array.h | 12 ++-- .../include/cuda/std/__memory/allocator.h | 4 +- .../include/cuda/std/__memory/construct_at.h | 4 +- libcudacxx/include/cuda/std/__new/allocate.h | 8 +-- .../std/__tuple_dir/structured_bindings.h | 8 +-- libcudacxx/include/cuda/std/__utility/pair.h | 32 +++++----- libcudacxx/include/cuda/std/cassert | 4 +- libcudacxx/include/cuda/std/cfloat | 4 +- .../cuda/std/detail/libcxx/include/__config | 30 +++++----- .../cuda/std/detail/libcxx/include/chrono | 4 +- .../cuda/std/detail/libcxx/include/cmath | 22 +++---- .../cuda/std/detail/libcxx/include/complex | 16 ++--- .../cuda/std/detail/libcxx/include/cstdint | 4 +- .../cuda/std/detail/libcxx/include/cstdlib | 8 +-- .../cuda/std/detail/libcxx/include/cstring | 8 +-- .../cuda/std/detail/libcxx/include/ctime | 8 +-- .../cuda/std/detail/libcxx/include/limits | 12 ++-- .../cuda/std/detail/libcxx/include/span | 4 +- libcudacxx/include/cuda/std/initializer_list | 4 +- libcudacxx/include/cuda/std/version | 4 +- .../test/libcudacxx/cuda/type_list.pass.cpp | 2 +- .../tuple_size_structured_bindings.pass.cpp | 2 +- libcudacxx/test/support/count_new.h | 4 +- libcudacxx/test/support/cuda_space_selector.h | 2 +- 51 files changed, 224 insertions(+), 226 deletions(-) diff --git a/cub/cub/detail/detect_cuda_runtime.cuh b/cub/cub/detail/detect_cuda_runtime.cuh index 211e31345da..35c52f4aedb 100644 --- a/cub/cub/detail/detect_cuda_runtime.cuh +++ b/cub/cub/detail/detect_cuda_runtime.cuh @@ -45,9 +45,9 @@ #endif // no system header // CUDA headers might not be present when using NVRTC, see NVIDIA/cccl#2095 for detail -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) # include -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) #ifdef DOXYGEN_SHOULD_SKIP_THIS // Only parse this during doxygen passes: diff --git a/cub/cub/iterator/cache_modified_input_iterator.cuh b/cub/cub/iterator/cache_modified_input_iterator.cuh index 89903d01ebb..eeb2a78f4b5 100644 --- a/cub/cub/iterator/cache_modified_input_iterator.cuh +++ b/cub/cub/iterator/cache_modified_input_iterator.cuh @@ -43,15 +43,15 @@ # pragma system_header #endif // no system header -#ifdef _CCCL_COMPILER_NVRTC +#if _CCCL_COMPILER(NVRTC) # include -#else // _CCCL_COMPILER_NVRTC +#else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ // vvv !_CCCL_COMPILER(NVRTC) vvv # include # include # include # include -#endif // _CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) #include #include @@ -123,15 +123,15 @@ public: /// The type of a reference to an element the iterator can point to using reference = ValueType; -#ifdef _CCCL_COMPILER_NVRTC +#if _CCCL_COMPILER(NVRTC) using iterator_category = ::cuda::std::random_access_iterator_tag; -#else // _CCCL_COMPILER_NVRTC +#else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ // vvv !_CCCL_COMPILER(NVRTC) vvv using iterator_category = typename THRUST_NS_QUALIFIER::detail::iterator_facade_category< THRUST_NS_QUALIFIER::device_system_tag, THRUST_NS_QUALIFIER::random_access_traversal_tag, value_type, reference>::type; -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) public: /// Wrapped native pointer @@ -228,12 +228,12 @@ public: } /// ostream operator -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) friend std::ostream& operator<<(std::ostream& os, const self_type& /*itr*/) { return os; } -#endif +#endif // !_CCCL_COMPILER(NVRTC) }; CUB_NAMESPACE_END diff --git a/cub/cub/iterator/counting_input_iterator.cuh b/cub/cub/iterator/counting_input_iterator.cuh index bee7f1349dd..529d6a990b1 100644 --- a/cub/cub/iterator/counting_input_iterator.cuh +++ b/cub/cub/iterator/counting_input_iterator.cuh @@ -48,12 +48,12 @@ #include -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) # include # include # include -#endif // _CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) CUB_NAMESPACE_BEGIN @@ -110,15 +110,15 @@ public: /// The type of a reference to an element the iterator can point to using reference = ValueType; -#ifdef _CCCL_COMPILER_NVRTC +#if _CCCL_COMPILER(NVRTC) using iterator_category = ::cuda::std::random_access_iterator_tag; -#else // _CCCL_COMPILER_NVRTC +#else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ // vvv !_CCCL_COMPILER(NVRTC) vvv using iterator_category = typename THRUST_NS_QUALIFIER::detail::iterator_facade_category< THRUST_NS_QUALIFIER::any_system_tag, THRUST_NS_QUALIFIER::random_access_traversal_tag, value_type, reference>::type; -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) private: ValueType val; @@ -217,13 +217,13 @@ public: } /// ostream operator -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) friend std::ostream& operator<<(std::ostream& os, const self_type& itr) { os << "[" << itr.val << "]"; return os; } -#endif // _CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) }; CUB_NAMESPACE_END diff --git a/cub/cub/util_type.cuh b/cub/cub/util_type.cuh index 714f25dbf83..8935ff3e17b 100644 --- a/cub/cub/util_type.cuh +++ b/cub/cub/util_type.cuh @@ -59,11 +59,11 @@ _CCCL_DIAG_POP # endif // _CCCL_CUDACC_AT_LEAST(11, 8) #endif // _CCCL_HAS_NV_BF16 -#ifdef _CCCL_COMPILER_NVRTC +#if _CCCL_COMPILER(NVRTC) # include -#else // !defined(_CCCL_COMPILER_NVRTC) +#else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ // vvv !_CCCL_COMPILER(NVRTC) vvv # include -#endif // defined(_CCCL_COMPILER_NVRTC) +#endif // _CCCL_COMPILER(NVRTC) CUB_NAMESPACE_BEGIN @@ -94,11 +94,11 @@ namespace detail // only defer to the libcu++ implementation for NVRTC. template using value_t = -# ifdef _CCCL_COMPILER_NVRTC +# if _CCCL_COMPILER(NVRTC) typename ::cuda::std::iterator_traits::value_type; -# else // !defined(_CCCL_COMPILER_NVRTC) +# else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ // vvv !_CCCL_COMPILER(NVRTC) vvv typename std::iterator_traits::value_type; -# endif // defined(_CCCL_COMPILER_NVRTC) +# endif // !_CCCL_COMPILER(NVRTC) template >::value> struct non_void_value_impl diff --git a/libcudacxx/include/cuda/__barrier/barrier_block_scope.h b/libcudacxx/include/cuda/__barrier/barrier_block_scope.h index e794b7046fa..163aad61da1 100644 --- a/libcudacxx/include/cuda/__barrier/barrier_block_scope.h +++ b/libcudacxx/include/cuda/__barrier/barrier_block_scope.h @@ -38,11 +38,11 @@ #include -#if defined(_CCCL_COMPILER_NVRTC) +#if _CCCL_COMPILER(NVRTC) # define _LIBCUDACXX_OFFSET_IS_ZERO(type, member) !(&(((type*) 0)->member)) -#else // ^^^ _CCCL_COMPILER_NVRTC ^^^ / vvv !_CCCL_COMPILER_NVRTC vvv +#else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ / vvv !_CCCL_COMPILER(NVRTC) vvv # define _LIBCUDACXX_OFFSET_IS_ZERO(type, member) !offsetof(type, member) -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) _LIBCUDACXX_BEGIN_NAMESPACE_CUDA diff --git a/libcudacxx/include/cuda/std/__atomic/functions/host.h b/libcudacxx/include/cuda/std/__atomic/functions/host.h index 67bdc13194d..bb30d7acac9 100644 --- a/libcudacxx/include/cuda/std/__atomic/functions/host.h +++ b/libcudacxx/include/cuda/std/__atomic/functions/host.h @@ -33,7 +33,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD _CCCL_DIAG_PUSH _CCCL_DIAG_SUPPRESS_CLANG("-Watomic-alignment") -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) template struct _CCCL_ALIGNAS(sizeof(_Tp)) __atomic_alignment_wrapper @@ -198,7 +198,7 @@ inline remove_cv_t<_Tp> __atomic_fetch_min_host(_Tp* __a, _Td __val, memory_orde return __expected; } -#endif // !defined(_CCCL_COMPILER_NVRTC) +#endif // !_CCCL_COMPILER(NVRTC) _CCCL_DIAG_POP diff --git a/libcudacxx/include/cuda/std/__cccl/assert.h b/libcudacxx/include/cuda/std/__cccl/assert.h index 13de9ade35b..ea9d4f8527a 100644 --- a/libcudacxx/include/cuda/std/__cccl/assert.h +++ b/libcudacxx/include/cuda/std/__cccl/assert.h @@ -27,9 +27,9 @@ #include #include -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) # include -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) #include @@ -62,7 +62,7 @@ //! Use the different standard library implementations to implement host side asserts //! _CCCL_ASSERT_IMPL_HOST should never be used directly -#if defined(_CCCL_COMPILER_NVRTC) // There is no host standard library in nvrtc +#if _CCCL_COMPILER(NVRTC) // There is no host standard library in nvrtc # define _CCCL_ASSERT_IMPL_HOST(expression, message) ((void) 0) #elif _CCCL_HAS_INCLUDE() && defined(_CCCL_COMPILER_MSVC) // MSVC uses _STL_VERIFY from # include @@ -74,8 +74,8 @@ extern "C" { # if !defined(_CCCL_CUDA_COMPILER_CLANG) _CCCL_HOST_DEVICE # endif // !_CCCL_CUDA_COMPILER_CLANG -void -__assert_fail(const char* __assertion, const char* __file, unsigned int __line, const char* __function) noexcept + void + __assert_fail(const char* __assertion, const char* __file, unsigned int __line, const char* __function) noexcept __attribute__((__noreturn__)); } # endif // NDEBUG @@ -92,7 +92,7 @@ __assert_fail(const char* __assertion, const char* __file, unsigned int __line, //! Use custom implementations with nvcc on device and the host ones with clang-cuda and nvhpc //! _CCCL_ASSERT_IMPL_DEVICE should never be used directly -#if defined(_CCCL_COMPILER_NVRTC) +#if _CCCL_COMPILER(NVRTC) # define _CCCL_ASSERT_IMPL_DEVICE(expression, message) \ _CCCL_BUILTIN_EXPECT(static_cast(expression), 1) \ ? (void) 0 : __assertfail(message, __FILE__, __LINE__, __func__, sizeof(char)) diff --git a/libcudacxx/include/cuda/std/__cccl/attributes.h b/libcudacxx/include/cuda/std/__cccl/attributes.h index c507a9875fb..f9a7c61931c 100644 --- a/libcudacxx/include/cuda/std/__cccl/attributes.h +++ b/libcudacxx/include/cuda/std/__cccl/attributes.h @@ -39,7 +39,7 @@ // Use a function like macro to imply that it must be followed by a semicolon #if _CCCL_STD_VER >= 2017 && _CCCL_HAS_CPP_ATTRIBUTE(fallthrough) # define _CCCL_FALLTHROUGH() [[fallthrough]] -#elif defined(_CCCL_COMPILER_NVRTC) +#elif _CCCL_COMPILER(NVRTC) # define _CCCL_FALLTHROUGH() ((void) 0) #elif _CCCL_HAS_CPP_ATTRIBUTE(clang::fallthrough) # define _CCCL_FALLTHROUGH() [[clang::fallthrough]] diff --git a/libcudacxx/include/cuda/std/__cccl/builtin.h b/libcudacxx/include/cuda/std/__cccl/builtin.h index d942bbd2f0c..33c8fc814b7 100644 --- a/libcudacxx/include/cuda/std/__cccl/builtin.h +++ b/libcudacxx/include/cuda/std/__cccl/builtin.h @@ -179,8 +179,7 @@ #endif // _CCCL_CHECK_BUILTIN(builtin_is_constant_evaluated) // NVCC and NVRTC in C++11 mode freaks out about `__builtin_is_constant_evaluated`. -#if _CCCL_STD_VER < 2014 \ - && (defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_COMPILER_NVRTC) || _CCCL_COMPILER(NVHPC)) +#if _CCCL_STD_VER < 2014 && (defined(_CCCL_CUDA_COMPILER_NVCC) || _CCCL_COMPILER(NVRTC) || _CCCL_COMPILER(NVHPC)) # undef _CCCL_BUILTIN_IS_CONSTANT_EVALUATED #endif // _CCCL_STD_VER < 2014 && _CCCL_CUDA_COMPILER_NVCC @@ -218,27 +217,27 @@ #endif // _CCCL_HAS_BUILTIN(__decay) && clang-cuda #if _CCCL_CHECK_BUILTIN(has_nothrow_assign) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_NOTHROW_ASSIGN(...) __has_nothrow_assign(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_nothrow_assign) && gcc >= 4.3 #if _CCCL_CHECK_BUILTIN(has_nothrow_constructor) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_NOTHROW_CONSTRUCTOR(...) __has_nothrow_constructor(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_nothrow_constructor) && gcc >= 4.3 #if _CCCL_CHECK_BUILTIN(has_nothrow_copy) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_NOTHROW_COPY(...) __has_nothrow_copy(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_nothrow_copy) && gcc >= 4.3 #if _CCCL_CHECK_BUILTIN(has_trivial_constructor) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_TRIVIAL_CONSTRUCTOR(...) __has_trivial_constructor(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_trivial_constructor) && gcc >= 4.3 #if _CCCL_CHECK_BUILTIN(has_trivial_destructor) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_TRIVIAL_DESTRUCTOR(...) __has_trivial_destructor(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_trivial_destructor) && gcc >= 4.3 @@ -248,7 +247,7 @@ #endif // _CCCL_CHECK_BUILTIN(has_unique_object_representations) && gcc >= 7.0 #if _CCCL_CHECK_BUILTIN(has_virtual_destructor) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_VIRTUAL_DESTRUCTOR(...) __has_virtual_destructor(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_virtual_destructor) && gcc >= 4.3 @@ -257,7 +256,7 @@ #endif // _CCCL_HAS_BUILTIN(__integer_pack) #if _CCCL_CHECK_BUILTIN(is_aggregate) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 70000) \ - || (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION > 1914) || defined(_CCCL_COMPILER_NVRTC) + || (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION > 1914) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_AGGREGATE(...) __is_aggregate(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_aggregate) && gcc >= 7.0 @@ -276,12 +275,12 @@ #endif // _CCCL_CHECK_BUILTIN(is_assignable) && gcc >= 9.0 #if _CCCL_CHECK_BUILTIN(is_base_of) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_BASE_OF(...) __is_base_of(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_base_of) && gcc >= 4.3 #if _CCCL_CHECK_BUILTIN(is_class) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_CLASS(...) __is_class(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_class) && gcc >= 4.3 @@ -294,11 +293,11 @@ #endif // _CCCL_HAS_BUILTIN(__is_const) #if _CCCL_CHECK_BUILTIN(is_constructible) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 80000) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_CONSTRUCTIBLE(...) __is_constructible(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_constructible) && gcc >= 8.0 -#if _CCCL_CHECK_BUILTIN(is_convertible_to) || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) +#if _CCCL_CHECK_BUILTIN(is_convertible_to) || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_CONVERTIBLE_TO(...) __is_convertible_to(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_convertible_to) @@ -307,17 +306,17 @@ #endif // _CCCL_CHECK_BUILTIN(is_destructible) #if _CCCL_CHECK_BUILTIN(is_empty) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_EMPTY(...) __is_empty(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_empty) && gcc >= 4.3 #if _CCCL_CHECK_BUILTIN(is_enum) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_ENUM(...) __is_enum(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_enum) && gcc >= 4.3 #if _CCCL_CHECK_BUILTIN(is_final) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40700) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_FINAL(...) __is_final(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_final) && gcc >= 4.7 @@ -344,7 +343,7 @@ #endif // _CCCL_HAS_BUILTIN(__is_integral) #if _CCCL_CHECK_BUILTIN(is_literal_type) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40600) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_LITERAL(...) __is_literal_type(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_literal_type) && gcc >= 4.6 @@ -369,15 +368,15 @@ # define _CCCL_BUILTIN_IS_MEMBER_POINTER(...) __is_member_pointer(__VA_ARGS__) #endif // _CCCL_HAS_BUILTIN(__is_member_pointer) -#if _CCCL_CHECK_BUILTIN(is_nothrow_assignable) || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) +#if _CCCL_CHECK_BUILTIN(is_nothrow_assignable) || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_NOTHROW_ASSIGNABLE(...) __is_nothrow_assignable(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_nothrow_assignable) -#if _CCCL_CHECK_BUILTIN(is_nothrow_constructible) || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) +#if _CCCL_CHECK_BUILTIN(is_nothrow_constructible) || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_NOTHROW_CONSTRUCTIBLE(...) __is_nothrow_constructible(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_nothrow_constructible) -#if _CCCL_CHECK_BUILTIN(is_nothrow_destructible) || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) +#if _CCCL_CHECK_BUILTIN(is_nothrow_destructible) || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_NOTHROW_DESTRUCTIBLE(...) __is_nothrow_destructible(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_nothrow_destructible) @@ -391,7 +390,7 @@ #endif // _CCCL_CUDACC_BELOW(11, 3) #if _CCCL_CHECK_BUILTIN(is_pod) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_POD(...) __is_pod(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_pod) && gcc >= 4.3 @@ -401,7 +400,7 @@ #endif // _CCCL_HAS_BUILTIN(__is_pointer) #if _CCCL_CHECK_BUILTIN(is_polymorphic) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_POLYMORPHIC(...) __is_polymorphic(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_polymorphic) && gcc >= 4.3 @@ -433,27 +432,27 @@ #endif // _CCCL_HAS_BUILTIN(__is_signed) #if _CCCL_CHECK_BUILTIN(is_standard_layout) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40700) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_STANDARD_LAYOUT(...) __is_standard_layout(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_standard_layout) && gcc >= 4.7 #if _CCCL_CHECK_BUILTIN(is_trivial) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40500) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_TRIVIAL(...) __is_trivial(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_trivial) && gcc >= 4.5 #if _CCCL_CHECK_BUILTIN(is_trivially_assignable) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 50100) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_TRIVIALLY_ASSIGNABLE(...) __is_trivially_assignable(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_trivially_assignable) && gcc >= 5.1 #if _CCCL_CHECK_BUILTIN(is_trivially_constructible) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 50100) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE(...) __is_trivially_constructible(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_trivially_constructible) && gcc >= 5.1 #if _CCCL_CHECK_BUILTIN(is_trivially_copyable) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 50100) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_TRIVIALLY_COPYABLE(...) __is_trivially_copyable(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_trivially_copyable) && gcc >= 5.1 @@ -462,7 +461,7 @@ #endif // _CCCL_CHECK_BUILTIN(is_trivially_destructible) #if _CCCL_CHECK_BUILTIN(is_union) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40300) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_UNION(...) __is_union(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_union) && gcc >= 4.3 @@ -555,7 +554,7 @@ #endif // _CCCL_CUDACC_BELOW(12, 2) #if _CCCL_CHECK_BUILTIN(underlying_type) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 40700) \ - || defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) + || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_UNDERLYING_TYPE(...) __underlying_type(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(underlying_type) && gcc >= 4.7 @@ -574,8 +573,7 @@ // GCC's builtin_strlen isn't reliable at constexpr time // MSVC does not expose builtin_strlen before C++17 // NVRTC does not expose builtin_strlen -#if !defined(_CCCL_COMPILER_GCC) && !defined(_CCCL_COMPILER_NVRTC) \ - && !(defined(_CCCL_COMPILER_MSVC) && _CCCL_STD_VER < 2017) +#if !defined(_CCCL_COMPILER_GCC) && !_CCCL_COMPILER(NVRTC) && !(defined(_CCCL_COMPILER_MSVC) && _CCCL_STD_VER < 2017) # define _CCCL_BUILTIN_STRLEN(...) __builtin_strlen(__VA_ARGS__) #endif diff --git a/libcudacxx/include/cuda/std/__cccl/compiler.h b/libcudacxx/include/cuda/std/__cccl/compiler.h index a3b791d6712..561a26781bf 100644 --- a/libcudacxx/include/cuda/std/__cccl/compiler.h +++ b/libcudacxx/include/cuda/std/__cccl/compiler.h @@ -33,7 +33,7 @@ # define _CCCL_MSVC_VERSION _MSC_VER # define _CCCL_MSVC_VERSION_FULL _MSC_FULL_VER #elif defined(__CUDACC_RTC__) -# define _CCCL_COMPILER_NVRTC +# define _CCCL_COMPILER_NVRTC _CCCL_COMPILER_MAKE_VERSION(__CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__) #endif #define _CCCL_COMPILER_COMPARE_VERSION_1(_COMP) _COMP @@ -75,7 +75,7 @@ // Shorthand to check whether there is a cuda compiler available #if defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_CUDA_COMPILER_NVHPC) || defined(_CCCL_CUDA_COMPILER_CLANG) \ - || defined(_CCCL_COMPILER_NVRTC) + || _CCCL_COMPILER(NVRTC) # define _CCCL_CUDA_COMPILER #endif // cuda compiler available diff --git a/libcudacxx/include/cuda/std/__cccl/diagnostic.h b/libcudacxx/include/cuda/std/__cccl/diagnostic.h index 8aeb054817d..bcf12a30fce 100644 --- a/libcudacxx/include/cuda/std/__cccl/diagnostic.h +++ b/libcudacxx/include/cuda/std/__cccl/diagnostic.h @@ -166,7 +166,7 @@ #endif // !_CCCL_COMPILER_MSVC #ifndef _CCCL_HAS_NO_PRAGMA_PUSH_POP_MACRO -# if defined(_CCCL_COMPILER_MSVC_2017) || defined(_CCCL_COMPILER_NVRTC) +# if defined(_CCCL_COMPILER_MSVC_2017) || _CCCL_COMPILER(NVRTC) # define _CCCL_HAS_NO_PRAGMA_PUSH_POP_MACRO # endif #endif // _CCCL_HAS_NO_PRAGMA_PUSH_POP_MACRO diff --git a/libcudacxx/include/cuda/std/__cccl/exceptions.h b/libcudacxx/include/cuda/std/__cccl/exceptions.h index 17910a184db..24124bfa126 100644 --- a/libcudacxx/include/cuda/std/__cccl/exceptions.h +++ b/libcudacxx/include/cuda/std/__cccl/exceptions.h @@ -25,7 +25,7 @@ #ifndef _CCCL_NO_EXCEPTIONS # if defined(CCCL_DISABLE_EXCEPTIONS) // Escape hatch for users to manually disable exceptions # define _CCCL_NO_EXCEPTIONS -# elif defined(_CCCL_COMPILER_NVRTC) || (defined(_CCCL_COMPILER_MSVC) && _CPPUNWIND == 0) \ +# elif _CCCL_COMPILER(NVRTC) || (defined(_CCCL_COMPILER_MSVC) && _CPPUNWIND == 0) \ || (!defined(_CCCL_COMPILER_MSVC) && !__EXCEPTIONS) // Catches all non msvc based compilers # define _CCCL_NO_EXCEPTIONS # endif diff --git a/libcudacxx/include/cuda/std/__cccl/is_non_narrowing_convertible.h b/libcudacxx/include/cuda/std/__cccl/is_non_narrowing_convertible.h index e9b49d2472f..c3e0a69b8c8 100644 --- a/libcudacxx/include/cuda/std/__cccl/is_non_narrowing_convertible.h +++ b/libcudacxx/include/cuda/std/__cccl/is_non_narrowing_convertible.h @@ -24,7 +24,7 @@ namespace __cccl_internal { -#if defined(_CCCL_CUDA_COMPILER) && (defined(__CUDACC__) || defined(_NVHPC_CUDA) || defined(_CCCL_COMPILER_NVRTC)) +#if defined(_CCCL_CUDA_COMPILER) && (defined(__CUDACC__) || defined(_NVHPC_CUDA) || _CCCL_COMPILER(NVRTC)) template __host__ __device__ _Tp&& __cccl_declval(int); template diff --git a/libcudacxx/include/cuda/std/__cccl/ptx_isa.h b/libcudacxx/include/cuda/std/__cccl/ptx_isa.h index 0ad8ada1dc0..c351d402a31 100644 --- a/libcudacxx/include/cuda/std/__cccl/ptx_isa.h +++ b/libcudacxx/include/cuda/std/__cccl/ptx_isa.h @@ -99,12 +99,12 @@ #endif // __cccl_ptx_isa >= 800 // NVRTC uses its own header, so we need to manually tell it when we expect SM90a to be available -#if defined(_CCCL_COMPILER_NVRTC) && !defined(NV_HAS_FEATURE_SM_90a) +#if _CCCL_COMPILER(NVRTC) && !defined(NV_HAS_FEATURE_SM_90a) # if (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 900) && defined(__CUDA_ARCH_FEAT_SM90_ALL)) # define NV_HAS_FEATURE_SM_90a NV_PROVIDES_SM_90 # else // ^^^ SM90a ^^^ / vvv !SM90a vvv # define NV_HAS_FEATURE_SM_90a NV_NO_TARGET # endif // -#endif // _CCCL_COMPILER_NVRTC && !NV_HAS_FEATURE_SM_90a +#endif // _CCCL_COMPILER(NVRTC) && !NV_HAS_FEATURE_SM_90a #endif // __CCCL_PTX_ISA_H_ diff --git a/libcudacxx/include/cuda/std/__cccl/rtti.h b/libcudacxx/include/cuda/std/__cccl/rtti.h index e12f7fc69e4..50b6fbbf0e3 100644 --- a/libcudacxx/include/cuda/std/__cccl/rtti.h +++ b/libcudacxx/include/cuda/std/__cccl/rtti.h @@ -36,7 +36,7 @@ # if __RTTI == 0 && __INTEL_RTTI__ == 0 && __GXX_RTTI == 0 && _CPPRTTI == 0 # define _CCCL_NO_RTTI # endif -# elif defined(_CCCL_COMPILER_NVRTC) +# elif _CCCL_COMPILER(NVRTC) # define _CCCL_NO_RTTI # elif defined(_CCCL_COMPILER_MSVC) # if _CPPRTTI == 0 @@ -63,7 +63,7 @@ # if !defined(_MSC_VER) && __RTTI == 0 && __INTEL_RTTI__ == 0 && __GXX_RTTI == 0 && _CPPRTTI == 0 # define _CCCL_NO_TYPEID # endif -# elif defined(_CCCL_COMPILER_NVRTC) +# elif _CCCL_COMPILER(NVRTC) # define _CCCL_NO_TYPEID # elif defined(_CCCL_COMPILER_MSVC) // No-op, MSVC always supports typeid even when RTTI is disabled diff --git a/libcudacxx/include/cuda/std/__cccl/system_header.h b/libcudacxx/include/cuda/std/__cccl/system_header.h index 3ef9cc8148e..d26ccddddd6 100644 --- a/libcudacxx/include/cuda/std/__cccl/system_header.h +++ b/libcudacxx/include/cuda/std/__cccl/system_header.h @@ -24,9 +24,9 @@ #endif // other compilers // Potentially enable that cccl headers are treated as system headers -#if !defined(_CCCL_NO_SYSTEM_HEADER) \ - && !(defined(_CCCL_COMPILER_MSVC) && defined(_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING)) \ - && !defined(_CCCL_COMPILER_NVRTC) && !defined(_LIBCUDACXX_DISABLE_PRAGMA_GCC_SYSTEM_HEADER) +#if !defined(_CCCL_NO_SYSTEM_HEADER) \ + && !(defined(_CCCL_COMPILER_MSVC) && defined(_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING)) && !_CCCL_COMPILER(NVRTC) \ + && !defined(_LIBCUDACXX_DISABLE_PRAGMA_GCC_SYSTEM_HEADER) # if defined(_CCCL_COMPILER_GCC) || _CCCL_COMPILER(NVHPC) || defined(_CCCL_COMPILER_ICC) # define _CCCL_IMPLICIT_SYSTEM_HEADER_GCC # elif defined(_CCCL_COMPILER_CLANG) diff --git a/libcudacxx/include/cuda/std/__cccl/visibility.h b/libcudacxx/include/cuda/std/__cccl/visibility.h index 53ed5d5134e..b994b3d627d 100644 --- a/libcudacxx/include/cuda/std/__cccl/visibility.h +++ b/libcudacxx/include/cuda/std/__cccl/visibility.h @@ -37,27 +37,27 @@ #endif // _CCCL_COMPILER(NVHPC) // Enable us to hide kernels -#if defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) +#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_VISIBILITY_HIDDEN -#else // ^^^ _CCCL_COMPILER_NVRTC ^^^ / vvv _CCCL_COMPILER_NVRTC vvv +#else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ / vvv _CCCL_COMPILER(NVRTC) vvv # define _CCCL_VISIBILITY_HIDDEN __attribute__((__visibility__("hidden"))) -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) #if defined(_CCCL_COMPILER_MSVC) # define _CCCL_VISIBILITY_DEFAULT __declspec(dllimport) -#elif defined(_CCCL_COMPILER_NVRTC) // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv _CCCL_COMPILER_NVRTC vvv +#elif _CCCL_COMPILER(NVRTC) // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv _CCCL_COMPILER(NVRTC) vvv # define _CCCL_VISIBILITY_DEFAULT -#else // ^^^ _CCCL_COMPILER_NVRTC ^^^ / vvv !_CCCL_COMPILER_NVRTC vvv +#else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ / vvv !_CCCL_COMPILER(NVRTC) vvv # define _CCCL_VISIBILITY_DEFAULT __attribute__((__visibility__("default"))) -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) -#if defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) +#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_TYPE_VISIBILITY_DEFAULT #elif _CCCL_HAS_ATTRIBUTE(__type_visibility__) # define _CCCL_TYPE_VISIBILITY_DEFAULT __attribute__((__type_visibility__("default"))) #else // ^^^ _CCCL_HAS_ATTRIBUTE(__type_visibility__) ^^^ / vvv !_CCCL_HAS_ATTRIBUTE(__type_visibility__) vvv # define _CCCL_TYPE_VISIBILITY_DEFAULT _CCCL_VISIBILITY_DEFAULT -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) #if defined(_CCCL_COMPILER_MSVC) # define _CCCL_FORCEINLINE __forceinline diff --git a/libcudacxx/include/cuda/std/__complex/nvbf16.h b/libcudacxx/include/cuda/std/__complex/nvbf16.h index 43b802788d2..b456a53139a 100644 --- a/libcudacxx/include/cuda/std/__complex/nvbf16.h +++ b/libcudacxx/include/cuda/std/__complex/nvbf16.h @@ -37,9 +37,9 @@ _CCCL_DIAG_POP # include # include -# if !defined(_CCCL_COMPILER_NVRTC) +# if !_CCCL_COMPILER(NVRTC) # include // for std::basic_ostringstream -# endif // !_CCCL_COMPILER_NVRTC +# endif // !_CCCL_COMPILER(NVRTC) // This is a workaround against the user defining macros __CUDA_NO_HALF_CONVERSIONS__ __CUDA_NO_HALF_OPERATORS__ namespace __cccl_internal @@ -146,7 +146,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT _CCCL_ALIGNAS(alignof(__nv_bfloat162)) compl return *this; } -# if !defined(_CCCL_COMPILER_NVRTC) +# if !_CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI complex(const ::std::complex<_Up>& __other) : __repr_(_LIBCUDACXX_ACCESS_STD_COMPLEX_REAL(__other), _LIBCUDACXX_ACCESS_STD_COMPLEX_IMAG(__other)) @@ -164,7 +164,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT _CCCL_ALIGNAS(alignof(__nv_bfloat162)) compl { return {__repr_.x, __repr_.y}; } -# endif // !_CCCL_COMPILER_NVRTC +# endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_HIDE_FROM_ABI value_type real() const { @@ -295,7 +295,7 @@ _LIBCUDACXX_HIDE_FROM_ABI complex<__nv_bfloat16> acos(const complex<__nv_bfloat1 return complex<__nv_bfloat16>{_CUDA_VSTD::acos(complex{__x})}; } -# if !defined(_CCCL_COMPILER_NVRTC) +# if !_CCCL_COMPILER(NVRTC) template ::std::basic_istream<_CharT, _Traits>& operator>>(::std::basic_istream<_CharT, _Traits>& __is, complex<__nv_bfloat16>& __x) @@ -312,7 +312,7 @@ operator<<(::std::basic_ostream<_CharT, _Traits>& __os, const complex<__nv_bfloa { return __os << complex{__x}; } -# endif // !_CCCL_COMPILER_NVRTC +# endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_END_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/__complex/nvfp16.h b/libcudacxx/include/cuda/std/__complex/nvfp16.h index bfabc2359c0..de8b2538f94 100644 --- a/libcudacxx/include/cuda/std/__complex/nvfp16.h +++ b/libcudacxx/include/cuda/std/__complex/nvfp16.h @@ -34,9 +34,9 @@ # include # include -# if !defined(_CCCL_COMPILER_NVRTC) +# if !_CCCL_COMPILER(NVRTC) # include // for std::basic_ostringstream -# endif // !_CCCL_COMPILER_NVRTC +# endif // !_CCCL_COMPILER(NVRTC) // This is a workaround against the user defining macros __CUDA_NO_HALF_CONVERSIONS__ __CUDA_NO_HALF_OPERATORS__ namespace __cccl_internal @@ -143,7 +143,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT _CCCL_ALIGNAS(alignof(__half2)) complex<__ha return *this; } -# if !defined(_CCCL_COMPILER_NVRTC) +# if !_CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI complex(const ::std::complex<_Up>& __other) : __repr_(_LIBCUDACXX_ACCESS_STD_COMPLEX_REAL(__other), _LIBCUDACXX_ACCESS_STD_COMPLEX_IMAG(__other)) @@ -161,7 +161,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT _CCCL_ALIGNAS(alignof(__half2)) complex<__ha { return {__repr_.x, __repr_.y}; } -# endif // !_CCCL_COMPILER_NVRTC +# endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_HIDE_FROM_ABI value_type real() const { @@ -292,7 +292,7 @@ _LIBCUDACXX_HIDE_FROM_ABI complex<__half> acos(const complex<__half>& __x) return complex<__half>{_CUDA_VSTD::acos(complex{__x})}; } -# if !defined(_LIBCUDACXX_HAS_NO_LOCALIZATION) && !defined(_CCCL_COMPILER_NVRTC) +# if !defined(_LIBCUDACXX_HAS_NO_LOCALIZATION) && !_CCCL_COMPILER(NVRTC) template ::std::basic_istream<_CharT, _Traits>& operator>>(::std::basic_istream<_CharT, _Traits>& __is, complex<__half>& __x) { @@ -308,7 +308,7 @@ operator<<(::std::basic_ostream<_CharT, _Traits>& __os, const complex<__half>& _ { return __os << complex{__x}; } -# endif // !_LIBCUDACXX_HAS_NO_LOCALIZATION && !_CCCL_COMPILER_NVRTC +# endif // !_LIBCUDACXX_HAS_NO_LOCALIZATION && !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_END_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/__cuda/climits_prelude.h b/libcudacxx/include/cuda/std/__cuda/climits_prelude.h index c2a4274b8e3..e788eaa29ea 100644 --- a/libcudacxx/include/cuda/std/__cuda/climits_prelude.h +++ b/libcudacxx/include/cuda/std/__cuda/climits_prelude.h @@ -21,12 +21,12 @@ # pragma system_header #endif // no system header -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) # include # include # include -#else // ^^^ !_CCCL_COMPILER_NVRTC ^^^ / vvv _CCCL_COMPILER_NVRTC vvv +#else // ^^^ !_CCCL_COMPILER(NVRTC) ^^^ / vvv _CCCL_COMPILER(NVRTC) vvv # define CHAR_BIT 8 # define SCHAR_MIN (-128) @@ -100,6 +100,6 @@ static _CCCL_DEVICE _CCCL_FORCEINLINE _To __cowchild_cast(_From __from) # define __builtin_huge_val() __cowchild_cast(0x7ff0000000000000) # define __builtin_nan(__dummy) __cowchild_cast(0x7ff8000000000000) # define __builtin_nans(__dummy) __cowchild_cast(0x7ff4000000000000) -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) #endif // _LIBCUDACXX___CUDA_CLIMITS_PRELUDE_H diff --git a/libcudacxx/include/cuda/std/__cuda/cstddef_prelude.h b/libcudacxx/include/cuda/std/__cuda/cstddef_prelude.h index 33c8aded2bc..600c98d48db 100644 --- a/libcudacxx/include/cuda/std/__cuda/cstddef_prelude.h +++ b/libcudacxx/include/cuda/std/__cuda/cstddef_prelude.h @@ -21,13 +21,13 @@ # pragma system_header #endif // no system header -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) # include # include #else # define offsetof(type, member) (_CUDA_VSTD::size_t)((char*) &(((type*) 0)->member) - (char*) 0) -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) _LIBCUDACXX_BEGIN_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/__cuda/cstdint_prelude.h b/libcudacxx/include/cuda/std/__cuda/cstdint_prelude.h index ad60f25a734..5111e9dd82a 100644 --- a/libcudacxx/include/cuda/std/__cuda/cstdint_prelude.h +++ b/libcudacxx/include/cuda/std/__cuda/cstdint_prelude.h @@ -21,9 +21,9 @@ # pragma system_header #endif // no system header -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) # include -#else // ^^^ !_CCCL_COMPILER_NVRTC ^^^ / vvv _CCCL_COMPILER_NVRTC vvv +#else // ^^^ !_CCCL_COMPILER(NVRTC) ^^^ / vvv _CCCL_COMPILER(NVRTC) vvv typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; @@ -85,6 +85,6 @@ typedef uint64_t uintmax_t; # define UINT64_C(X) ((uint_least64_t) (X)) # define INTMAX_C(X) ((intmax_t) (X)) # define UINTMAX_C(X) ((uintmax_t) (X)) -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) #endif // _LIBCUDACXX___CUDA_CSTDINT_PRELUDE_H diff --git a/libcudacxx/include/cuda/std/__exception/cuda_error.h b/libcudacxx/include/cuda/std/__exception/cuda_error.h index 143cf4f12f2..386a1930eab 100644 --- a/libcudacxx/include/cuda/std/__exception/cuda_error.h +++ b/libcudacxx/include/cuda/std/__exception/cuda_error.h @@ -28,10 +28,10 @@ #include -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) # include # include -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) #include diff --git a/libcudacxx/include/cuda/std/__functional/bind_front.h b/libcudacxx/include/cuda/std/__functional/bind_front.h index 5ddbff62d33..cadc17cf2a3 100644 --- a/libcudacxx/include/cuda/std/__functional/bind_front.h +++ b/libcudacxx/include/cuda/std/__functional/bind_front.h @@ -50,7 +50,7 @@ template struct __bind_front_t : __perfect_forward<__bind_front_op, _Fn, _BoundArgs...> { using __base = __perfect_forward<__bind_front_op, _Fn, _BoundArgs...>; -# if defined(_CCCL_COMPILER_NVRTC) +# if _CCCL_COMPILER(NVRTC) _CCCL_HIDE_FROM_ABI constexpr __bind_front_t() noexcept = default; template diff --git a/libcudacxx/include/cuda/std/__functional/not_fn.h b/libcudacxx/include/cuda/std/__functional/not_fn.h index b2ee6abc17e..7aff1d5d5cf 100644 --- a/libcudacxx/include/cuda/std/__functional/not_fn.h +++ b/libcudacxx/include/cuda/std/__functional/not_fn.h @@ -48,7 +48,7 @@ template struct __not_fn_t : __perfect_forward<__not_fn_op, _Fn> { using __base = __perfect_forward<__not_fn_op, _Fn>; -# if defined(_CCCL_COMPILER_NVRTC) // nvbug 3961621 +# if _CCCL_COMPILER(NVRTC) // nvbug 3961621 _CCCL_HIDE_FROM_ABI constexpr __not_fn_t() noexcept = default; _LIBCUDACXX_TEMPLATE(class _OrigFn) diff --git a/libcudacxx/include/cuda/std/__iterator/iterator_traits.h b/libcudacxx/include/cuda/std/__iterator/iterator_traits.h index c75d7f411e2..b6714e0350b 100644 --- a/libcudacxx/include/cuda/std/__iterator/iterator_traits.h +++ b/libcudacxx/include/cuda/std/__iterator/iterator_traits.h @@ -39,7 +39,7 @@ #include #include -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) # if defined(_CCCL_COMPILER_MSVC) # include // for ::std::input_iterator_tag # else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv @@ -63,7 +63,7 @@ struct __cccl_std_contiguous_iterator_tag_exists : __cccl_type_is_defined= 2020 -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_BEGIN_NAMESPACE_STD @@ -118,7 +118,7 @@ template struct _CCCL_TYPE_VISIBILITY_DEFAULT iterator_traits; #endif // _CCCL_STD_VER <= 2014 -#if defined(_CCCL_COMPILER_NVRTC) +#if _CCCL_COMPILER(NVRTC) struct _CCCL_TYPE_VISIBILITY_DEFAULT input_iterator_tag {}; @@ -135,7 +135,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT contiguous_iterator_tag : public random_acc {}; # endif // _CCCL_STD_VER >= 2014 -#else // ^^^ _CCCL_COMPILER_NVRTC ^^^ / vvv !_CCCL_COMPILER_NVRTC vvv +#else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ / vvv !_CCCL_COMPILER(NVRTC) vvv using input_iterator_tag = ::std::input_iterator_tag; using output_iterator_tag = ::std::output_iterator_tag; @@ -155,7 +155,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT contiguous_iterator_tag : public random_acc {}; # endif // _CCCL_STD_VER >= 2014 -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) template struct __iter_traits_cache diff --git a/libcudacxx/include/cuda/std/__mdspan/standard_layout_static_array.h b/libcudacxx/include/cuda/std/__mdspan/standard_layout_static_array.h index 0794152dfc1..b7f03529c63 100644 --- a/libcudacxx/include/cuda/std/__mdspan/standard_layout_static_array.h +++ b/libcudacxx/include/cuda/std/__mdspan/standard_layout_static_array.h @@ -627,15 +627,15 @@ struct __partially_static_sizes_tagged using __tag_t = _Tag; using __psa_impl_t = __standard_layout_psa<_Tag, T, _static_t, _CUDA_VSTD::integer_sequence<_static_t, __values_or_sentinals...>>; -# if defined(_CCCL_COMPILER_NVRTC) || _CCCL_CUDACC_BELOW(11, 3) +# if _CCCL_COMPILER(NVRTC) || _CCCL_CUDACC_BELOW(11, 3) template = 0> __MDSPAN_FORCE_INLINE_FUNCTION constexpr __partially_static_sizes_tagged(_Args&&... __args) noexcept( noexcept(__psa_impl_t(_CUDA_VSTD::declval<_Args>()...))) : __psa_impl_t(_CUDA_VSTD::forward<_Args>(__args)...) {} -# else // ^^^ _CCCL_COMPILER_NVRTC || nvcc < 11.3 ^^^ / vvv !_CCCL_COMPILER_NVRTC || nvcc >= 11.3 vvv +# else // ^^^ _CCCL_COMPILER(NVRTC) || nvcc < 11.3 ^^^ / vvv !_CCCL_COMPILER(NVRTC) || nvcc >= 11.3 vvv using __psa_impl_t::__psa_impl_t; -# endif // !_CCCL_COMPILER_NVRTC || nvcc >= 11.3 +# endif // !_CCCL_COMPILER(NVRTC) || nvcc >= 11.3 # ifdef __MDSPAN_DEFAULTED_CONSTRUCTORS_INHERITANCE_WORKAROUND _LIBCUDACXX_HIDE_FROM_ABI # endif @@ -680,15 +680,15 @@ struct __partially_static_sizes : __partially_static_sizes_tagged<__no_tag, T, _ {} public: -# if defined(_CCCL_COMPILER_NVRTC) || _CCCL_CUDACC_BELOW(11, 3) +# if _CCCL_COMPILER(NVRTC) || _CCCL_CUDACC_BELOW(11, 3) template = 0> __MDSPAN_FORCE_INLINE_FUNCTION constexpr __partially_static_sizes(_Args&&... __args) noexcept( noexcept(__base_t(_CUDA_VSTD::declval<_Args>()...))) : __base_t(_CUDA_VSTD::forward<_Args>(__args)...) {} -# else // ^^^ _CCCL_COMPILER_NVRTC || nvcc < 11.3 ^^^ / vvv !_CCCL_COMPILER_NVRTC || nvcc >= 11.3 vvv +# else // ^^^ _CCCL_COMPILER(NVRTC) || nvcc < 11.3 ^^^ / vvv !_CCCL_COMPILER(NVRTC) || nvcc >= 11.3 vvv using __base_t::__base_t; -# endif // !_CCCL_COMPILER_NVRTC || nvcc >= 11.3 +# endif // !_CCCL_COMPILER(NVRTC) || nvcc >= 11.3 # ifdef __MDSPAN_DEFAULTED_CONSTRUCTORS_INHERITANCE_WORKAROUND _LIBCUDACXX_HIDE_FROM_ABI diff --git a/libcudacxx/include/cuda/std/__mdspan/static_array.h b/libcudacxx/include/cuda/std/__mdspan/static_array.h index 70715173bd6..70f45b35860 100644 --- a/libcudacxx/include/cuda/std/__mdspan/static_array.h +++ b/libcudacxx/include/cuda/std/__mdspan/static_array.h @@ -254,7 +254,7 @@ class __partially_static_array_with_sentinal using __base_t = typename __partially_static_array_impl_maker<_Tp, _static_t, _ValsSeq, __sentinal>::__impl_base; public: -# if defined(_CCCL_COMPILER_NVRTC) || _CCCL_CUDACC_BELOW(11, 3) +# if _CCCL_COMPILER(NVRTC) || _CCCL_CUDACC_BELOW(11, 3) _CCCL_HIDE_FROM_ABI constexpr __partially_static_array_with_sentinal() = default; template @@ -262,9 +262,9 @@ class __partially_static_array_with_sentinal noexcept(__base_t(_CUDA_VSTD::declval<_Args>()...))) : __base_t(_CUDA_VSTD::forward<_Args>(__args)...) {} -# else // ^^^ _CCCL_COMPILER_NVRTC || nvcc < 11.3 ^^^ / vvv !_CCCL_COMPILER_NVRTC || nvcc >= 11.3 vvv +# else // ^^^ _CCCL_COMPILER(NVRTC) || nvcc < 11.3 ^^^ / vvv !_CCCL_COMPILER(NVRTC) || nvcc >= 11.3 vvv using __base_t::__base_t; -# endif // !_CCCL_COMPILER_NVRTC || nvcc >= 11.3 +# endif // !_CCCL_COMPILER(NVRTC) || nvcc >= 11.3 }; //============================================================================== @@ -282,7 +282,7 @@ struct __partially_static_sizes _CUDA_VSTD::integer_sequence<_static_t, __values_or_sentinals...>>; public: -# if defined(_CCCL_COMPILER_NVRTC) || _CCCL_CUDACC_BELOW(11, 3) +# if _CCCL_COMPILER(NVRTC) || _CCCL_CUDACC_BELOW(11, 3) _CCCL_HIDE_FROM_ABI constexpr __partially_static_sizes() = default; template @@ -290,9 +290,9 @@ struct __partially_static_sizes noexcept(__base_t(_CUDA_VSTD::declval<_Args>()...))) : __base_t(_CUDA_VSTD::forward<_Args>(__args)...) {} -# else // ^^^ _CCCL_COMPILER_NVRTC || nvcc < 11.3 ^^^ / vvv !_CCCL_COMPILER_NVRTC || nvcc >= 11.3 vvv +# else // ^^^ _CCCL_COMPILER(NVRTC) || nvcc < 11.3 ^^^ / vvv !_CCCL_COMPILER(NVRTC) || nvcc >= 11.3 vvv using __base_t::__base_t; -# endif // !_CCCL_COMPILER_NVRTC || nvcc >= 11.3 +# endif // !_CCCL_COMPILER(NVRTC) || nvcc >= 11.3 template __MDSPAN_FORCE_INLINE_FUNCTION constexpr __partially_static_sizes __with_tag() const noexcept diff --git a/libcudacxx/include/cuda/std/__memory/allocator.h b/libcudacxx/include/cuda/std/__memory/allocator.h index 14876b27238..fecac15b13f 100644 --- a/libcudacxx/include/cuda/std/__memory/allocator.h +++ b/libcudacxx/include/cuda/std/__memory/allocator.h @@ -33,9 +33,9 @@ #include #include -#if defined(_CCCL_HAS_CONSTEXPR_ALLOCATION) && !defined(_CCCL_COMPILER_NVRTC) +#if defined(_CCCL_HAS_CONSTEXPR_ALLOCATION) && !_CCCL_COMPILER(NVRTC) # include -#endif // _CCCL_HAS_CONSTEXPR_ALLOCATION && !_CCCL_COMPILER_NVRTC +#endif // _CCCL_HAS_CONSTEXPR_ALLOCATION && !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_BEGIN_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/__memory/construct_at.h b/libcudacxx/include/cuda/std/__memory/construct_at.h index 8e640e04060..0e0a85147c0 100644 --- a/libcudacxx/include/cuda/std/__memory/construct_at.h +++ b/libcudacxx/include/cuda/std/__memory/construct_at.h @@ -43,9 +43,9 @@ #endif // _CCCL_CUDA_COMPILER_CLANG #if _CCCL_STD_VER >= 2020 // need to backfill ::std::construct_at -# ifndef _CCCL_COMPILER_NVRTC +# if !_CCCL_COMPILER(NVRTC) # include -# endif // _CCCL_COMPILER_NVRTC +# endif // _CCCL_COMPILER(NVRTC) # ifndef __cpp_lib_constexpr_dynamic_alloc namespace std diff --git a/libcudacxx/include/cuda/std/__new/allocate.h b/libcudacxx/include/cuda/std/__new/allocate.h index b37e9348728..2e1f8e9f302 100644 --- a/libcudacxx/include/cuda/std/__new/allocate.h +++ b/libcudacxx/include/cuda/std/__new/allocate.h @@ -24,9 +24,9 @@ #include -#if !defined(_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION) && !defined(_CCCL_COMPILER_NVRTC) +#if !defined(_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION) && !_CCCL_COMPILER(NVRTC) # include // for ::std::std::align_val_t -#endif // !_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION !_CCCL_COMPILER_NVRTC +#endif // !_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION !_CCCL_COMPILER(NVRTC) #if !defined(__cpp_sized_deallocation) || __cpp_sized_deallocation < 201309L # define _LIBCUDACXX_HAS_NO_LANGUAGE_SIZED_DEALLOCATION @@ -41,9 +41,9 @@ # define _LIBCUDACXX_HAS_NO_SIZED_DEALLOCATION #endif -#if !defined(_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION) && !defined(_CCCL_COMPILER_NVRTC) +#if !defined(_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION) && !_CCCL_COMPILER(NVRTC) # include // for ::std::align_val_t -#endif // !_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION !_CCCL_COMPILER_NVRTC +#endif // !_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_BEGIN_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/__tuple_dir/structured_bindings.h b/libcudacxx/include/cuda/std/__tuple_dir/structured_bindings.h index 92387672d8a..8c381a9af91 100644 --- a/libcudacxx/include/cuda/std/__tuple_dir/structured_bindings.h +++ b/libcudacxx/include/cuda/std/__tuple_dir/structured_bindings.h @@ -23,12 +23,12 @@ _CCCL_DIAG_PUSH _CCCL_DIAG_SUPPRESS_CLANG("-Wmismatched-tags") -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) // Fetch utility to get primary template for ::std::tuple_size necessary for the specialization of // ::std::tuple_size to enable structured bindings. // See https://github.com/NVIDIA/libcudacxx/issues/316 # include -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) #include #include @@ -44,13 +44,13 @@ _CCCL_DIAG_SUPPRESS_CLANG("-Wmismatched-tags") #if _CCCL_STD_VER >= 2017 namespace std { -# if defined(_CCCL_COMPILER_NVRTC) +# if _CCCL_COMPILER(NVRTC) template struct tuple_size; template struct tuple_element; -# endif // _CCCL_COMPILER_NVRTC +# endif // _CCCL_COMPILER(NVRTC) template struct tuple_size<_CUDA_VSTD::array<_Tp, _Size>> : _CUDA_VSTD::tuple_size<_CUDA_VSTD::array<_Tp, _Size>> diff --git a/libcudacxx/include/cuda/std/__utility/pair.h b/libcudacxx/include/cuda/std/__utility/pair.h index bcb55d395e6..5de5dc0b2b1 100644 --- a/libcudacxx/include/cuda/std/__utility/pair.h +++ b/libcudacxx/include/cuda/std/__utility/pair.h @@ -62,9 +62,9 @@ #include // Provide compatability between `std::pair` and `cuda::std::pair` -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) # include -#endif // !defined(_CCCL_COMPILER_NVRTC) +#endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_BEGIN_NAMESPACE_STD @@ -330,7 +330,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> {} // std compatability -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) template , @@ -366,7 +366,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> _CCCL_TRAIT(is_nothrow_constructible, _T1, _U1) && _CCCL_TRAIT(is_nothrow_constructible, _T2, _U2)) : __base(_CUDA_VSTD::forward<_U1>(__p.first), _CUDA_VSTD::forward<_U2>(__p.second)) {} -#endif // !defined(_CCCL_COMPILER_NVRTC) +#endif // !_CCCL_COMPILER(NVRTC) // assignments _CCCL_HIDE_FROM_ABI pair& operator=(const pair&) = default; @@ -397,7 +397,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> } // std assignments -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) template ::value && is_copy_assignable<_T2>::value, int> = 0> _CCCL_HOST _CCCL_CONSTEXPR_CXX14 pair& operator=(::std::pair<_T1, _T2> const& __p) noexcept( _CCCL_TRAIT(is_nothrow_copy_assignable, _T1) && _CCCL_TRAIT(is_nothrow_copy_assignable, _T2)) @@ -415,7 +415,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> this->second = _CUDA_VSTD::forward<_T2>(__p.second); return *this; } -#endif // !defined(_CCCL_COMPILER_NVRTC) +#endif // !_CCCL_COMPILER(NVRTC) #if _CCCL_STD_VER >= 2023 _LIBCUDACXX_HIDE_FROM_ABI constexpr const pair& operator=(pair const& __p) const @@ -427,7 +427,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> return *this; } -# if !defined(_CCCL_COMPILER_NVRTC) +# if !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_HOST constexpr const pair& operator=(::std::pair<_T1, _T2> const& __p) const noexcept(_CCCL_TRAIT(is_nothrow_copy_assignable, const _T1) && _CCCL_TRAIT(is_nothrow_copy_assignable, const _T2)) requires(is_copy_assignable_v && is_copy_assignable_v) @@ -436,7 +436,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> this->second = __p.second; return *this; } -# endif // !defined(_CCCL_COMPILER_NVRTC) +# endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_HIDE_FROM_ABI constexpr const pair& operator=(pair&& __p) const noexcept(_CCCL_TRAIT(is_nothrow_assignable, const _T1&, _T1) && _CCCL_TRAIT(is_nothrow_assignable, const _T2&, _T2)) @@ -447,7 +447,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> return *this; } -# if !defined(_CCCL_COMPILER_NVRTC) +# if !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_HOST constexpr const pair& operator=(::std::pair<_T1, _T2>&& __p) const noexcept(_CCCL_TRAIT(is_nothrow_assignable, const _T1&, _T1) && _CCCL_TRAIT(is_nothrow_assignable, const _T2&, _T2)) requires(is_assignable_v && is_assignable_v) @@ -456,7 +456,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> this->second = _CUDA_VSTD::forward<_T2>(__p.second); return *this; } -# endif // !defined(_CCCL_COMPILER_NVRTC) +# endif // !_CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI constexpr const pair& operator=(const pair<_U1, _U2>& __p) const @@ -467,7 +467,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> return *this; } -# if !defined(_CCCL_COMPILER_NVRTC) +# if !_CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI _CCCL_HOST constexpr const pair& operator=(const ::std::pair<_U1, _U2>& __p) const requires(is_assignable_v && is_assignable_v) @@ -476,7 +476,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> this->second = __p.second; return *this; } -# endif // !defined(_CCCL_COMPILER_NVRTC) +# endif // !_CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI constexpr const pair& operator=(pair<_U1, _U2>&& __p) const @@ -487,7 +487,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> return *this; } -# if !defined(_CCCL_COMPILER_NVRTC) +# if !_CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI _CCCL_HOST constexpr const pair& operator=(::std::pair<_U1, _U2>&& __p) const requires(is_assignable_v && is_assignable_v) @@ -496,7 +496,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> this->second = _CUDA_VSTD::forward<_U2>(__p.second); return *this; } -# endif // !defined(_CCCL_COMPILER_NVRTC) +# endif // !_CCCL_COMPILER(NVRTC) #endif // _CCCL_STD_VER >= 2023 _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void @@ -517,12 +517,12 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT pair : public __pair_base<_T1, _T2> } #endif // _CCCL_STD_VER >= 2023 -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) _CCCL_HOST _CCCL_CONSTEXPR_CXX14 operator ::std::pair<_T1, _T2>() const { return {this->first, this->second}; } -#endif // !defined(_CCCL_COMPILER_NVRTC) +#endif // !_CCCL_COMPILER(NVRTC) }; #if _CCCL_STD_VER > 2014 && !defined(_LIBCUDACXX_HAS_NO_DEDUCTION_GUIDES) diff --git a/libcudacxx/include/cuda/std/cassert b/libcudacxx/include/cuda/std/cassert index 4c6a4c27249..b8816743844 100644 --- a/libcudacxx/include/cuda/std/cassert +++ b/libcudacxx/include/cuda/std/cassert @@ -21,8 +21,8 @@ # pragma system_header #endif // no system header -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) # include -#endif //_CCCL_COMPILER_NVRTC +#endif //_CCCL_COMPILER(NVRTC) #endif // _CUDA_STD_CASSERT diff --git a/libcudacxx/include/cuda/std/cfloat b/libcudacxx/include/cuda/std/cfloat index 34b9d377b40..79e309ac8dd 100644 --- a/libcudacxx/include/cuda/std/cfloat +++ b/libcudacxx/include/cuda/std/cfloat @@ -23,11 +23,11 @@ _CCCL_PUSH_MACROS -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) # include # include -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) _CCCL_POP_MACROS diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/__config b/libcudacxx/include/cuda/std/detail/libcxx/include/__config index a68d0713cdd..e482dbd7e2e 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/__config +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/__config @@ -46,7 +46,7 @@ extern "C++" { # error libcu++ requires C++11 or later # endif -# if (_CCCL_COMPILER(NVHPC) && defined(__linux__)) || defined(_CCCL_COMPILER_NVRTC) +# if (_CCCL_COMPILER(NVHPC) && defined(__linux__)) || _CCCL_COMPILER(NVRTC) # ifndef __ELF__ # define __ELF__ # endif // !__ELF__ @@ -98,7 +98,7 @@ extern "C++" { # define __has_declspec_attribute(__x) 0 # endif -# if !defined(_CCCL_CUDA_COMPILER_NVCC) && !defined(_CCCL_COMPILER_NVRTC) +# if !defined(_CCCL_CUDA_COMPILER_NVCC) && !_CCCL_COMPILER(NVRTC) // If NVCC is not being used can safely use `long double` without warnings # define _LIBCUDACXX_HAS_COMPLEX_LONG_DOUBLE // NVCC does not have a way of silencing non '_' prefixed UDLs @@ -242,7 +242,7 @@ extern "C++" { # endif # ifndef _LIBCUDACXX_LITTLE_ENDIAN -# if defined(_CCCL_COMPILER_NVRTC) +# if _CCCL_COMPILER(NVRTC) # define _LIBCUDACXX_LITTLE_ENDIAN # endif # endif // _LIBCUDACXX_LITTLE_ENDIAN @@ -289,9 +289,9 @@ extern "C++" { # endif // __linux__ # endif -# if defined(_CCCL_COMPILER_NVRTC) +# if _CCCL_COMPILER(NVRTC) # define __alignof(x) alignof(x) -# endif // _CCCL_COMPILER_NVRTC +# endif // _CCCL_COMPILER(NVRTC) # if defined(_CCCL_COMPILER_MSVC) # define __alignof__ __alignof @@ -424,7 +424,7 @@ typedef __char32_t char32_t; # define _LIBCUDACXX_HAS_NO_VECTOR_EXTENSION -# elif defined(_CCCL_COMPILER_NVRTC) || _CCCL_COMPILER(NVHPC) +# elif _CCCL_COMPILER(NVRTC) || _CCCL_COMPILER(NVHPC) # define _LIBCUDACXX_DISABLE_EXTENSION_WARNING @@ -435,7 +435,7 @@ typedef __char32_t char32_t; # endif // !_LIBCUDACXX_FREESTANDING # ifndef _LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS -# if defined(_CCCL_COMPILER_NVRTC) || defined(_CCCL_CUDA_COMPILER_NVHPC) +# if _CCCL_COMPILER(NVRTC) || defined(_CCCL_CUDA_COMPILER_NVHPC) # define _LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS # endif # endif // _LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS @@ -467,7 +467,7 @@ typedef __char32_t char32_t; # endif // _LIBCUDACXX_HAS_NO_CXX20_CHRONO_LITERALS # ifndef _LIBCUDACXX_HAS_NO_INT128 -# if defined(_CCCL_COMPILER_MSVC) || (defined(_CCCL_COMPILER_NVRTC) && !defined(__CUDACC_RTC_INT128__)) \ +# if defined(_CCCL_COMPILER_MSVC) || (_CCCL_COMPILER(NVRTC) && !defined(__CUDACC_RTC_INT128__)) \ || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 5)) || !defined(__SIZEOF_INT128__) # define _LIBCUDACXX_HAS_NO_INT128 # endif @@ -675,7 +675,7 @@ typedef unsigned int char32_t; // Thread API # ifndef _LIBCUDACXX_HAS_THREAD_API_EXTERNAL -# if defined(_CCCL_COMPILER_NVRTC) || defined(__EMSCRIPTEN__) +# if _CCCL_COMPILER(NVRTC) || defined(__EMSCRIPTEN__) # define _LIBCUDACXX_HAS_THREAD_API_EXTERNAL # endif # endif // _LIBCUDACXX_HAS_THREAD_API_EXTERNAL @@ -755,7 +755,7 @@ typedef unsigned int char32_t; # endif // CUDA Atomics supersede host atomics in order to insert the host/device dispatch layer -# if defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_COMPILER_NVRTC) || _CCCL_COMPILER(NVHPC) || _CCCL_CUDACC +# if defined(_CCCL_CUDA_COMPILER_NVCC) || _CCCL_COMPILER(NVRTC) || _CCCL_COMPILER(NVHPC) || _CCCL_CUDACC # define _LIBCUDACXX_HAS_CUDA_ATOMIC_IMPL # endif @@ -826,7 +826,7 @@ typedef unsigned int char32_t; // We need `is_constant_evaluated` for clang and gcc. MSVC also needs extensive rework # if !defined(_CCCL_BUILTIN_IS_CONSTANT_EVALUATED) # define _LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS -# elif defined(_CCCL_COMPILER_NVRTC) +# elif _CCCL_COMPILER(NVRTC) # define _LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS # elif defined(_CCCL_COMPILER_MSVC) # define _LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS @@ -873,7 +873,7 @@ typedef unsigned int char32_t; // We can only expose constexpr allocations if the compiler supports it # if defined(__cpp_constexpr_dynamic_alloc) && defined(__cpp_lib_constexpr_dynamic_alloc) && _CCCL_STD_VER >= 2020 \ - && !defined(_CCCL_COMPILER_NVRTC) + && !_CCCL_COMPILER(NVRTC) # define _CCCL_HAS_CONSTEXPR_ALLOCATION # define _CCCL_CONSTEXPR_CXX20_ALLOCATION constexpr # else // ^^^ __cpp_constexpr_dynamic_alloc ^^^ / vvv !__cpp_constexpr_dynamic_alloc vvv @@ -882,7 +882,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 defined(_CCCL_COMPILER_NVRTC) || (_CCCL_CUDACC_BELOW(11, 3) && defined(_CCCL_COMPILER_CLANG)) +# if _CCCL_COMPILER(NVRTC) || (_CCCL_CUDACC_BELOW(11, 3) && defined(_CCCL_COMPILER_CLANG)) # define _LIBCUDACXX_DELEGATE_CONSTRUCTORS(__class, __baseclass, ...) \ using __base = __baseclass<__VA_ARGS__>; \ template = 0> \ @@ -891,12 +891,12 @@ typedef unsigned int char32_t; : __base(_CUDA_VSTD::forward<_Args>(__args)...) \ {} \ _CCCL_HIDE_FROM_ABI constexpr __class() noexcept = default; -# else // ^^^ _CCCL_COMPILER_NVRTC || nvcc < 11.3 ^^^ / vvv !_CCCL_COMPILER_NVRTC || nvcc >= 11.3 vvv +# else // ^^^ _CCCL_COMPILER(NVRTC) || nvcc < 11.3 ^^^ / vvv !_CCCL_COMPILER(NVRTC) || nvcc >= 11.3 vvv # define _LIBCUDACXX_DELEGATE_CONSTRUCTORS(__class, __baseclass, ...) \ using __base = __baseclass<__VA_ARGS__>; \ using __base::__base; \ _CCCL_HIDE_FROM_ABI constexpr __class() noexcept = default; -# endif // !_CCCL_COMPILER_NVRTC || nvcc >= 11.3 +# endif // !_CCCL_COMPILER(NVRTC) || nvcc >= 11.3 # define _LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/chrono b/libcudacxx/include/cuda/std/detail/libcxx/include/chrono index 895d14dc469..613ff3ffb62 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/chrono +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/chrono @@ -834,9 +834,9 @@ constexpr chrono::year operator ""y(unsigned lo #endif // no system header #ifdef __cuda_std__ -# ifndef _CCCL_COMPILER_NVRTC +# if !_CCCL_COMPILER(NVRTC) # include -# endif // _CCCL_COMPILER_NVRTC +# endif // _CCCL_COMPILER(NVRTC) #endif // __cuda_std__ #include diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/cmath b/libcudacxx/include/cuda/std/detail/libcxx/include/cmath index 7f47a56bcbf..911a8195a0c 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/cmath +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/cmath @@ -310,9 +310,9 @@ long double truncl(long double x); # pragma system_header #endif // no system header -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) # include -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) #if _CCCL_COMPILER(NVHPC) # include @@ -330,11 +330,11 @@ long double truncl(long double x); # include #endif // _LIBCUDACXX_HAS_NVBF16 -#ifdef _CCCL_COMPILER_NVRTC +#if _CCCL_COMPILER(NVRTC) # include # define INFINITY __builtin_huge_val() # define NAN __builtin_nan() -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) _CCCL_PUSH_MACROS @@ -396,7 +396,7 @@ using ::hypotf; using ::abs; #endif -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) using ::fpclassify; using ::isgreater; @@ -582,7 +582,7 @@ using ::scalbnl; using ::tgammal; using ::truncl; -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) #if _CCCL_STD_VER > 2014 && !defined(__cuda_std__) _LIBCUDACXX_HIDE_FROM_ABI float hypot(float x, float y, float z) @@ -683,7 +683,7 @@ __constexpr_isfinite(_A1 __lcpp_x) noexcept return isfinite(__lcpp_x); } -#if defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) +#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI _A1 __constexpr_copysign(_A1 __x, _A1 __y) noexcept { @@ -717,7 +717,7 @@ __constexpr_copysign(_A1 __x, _A2 __y) noexcept } #endif // !_CCCL_COMPILER_MSVC -#if defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) +#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI _A1 __constexpr_fabs(_A1 __x) noexcept { @@ -746,7 +746,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 double __constexpr_fabs(_Tp __x) } #endif // !_CCCL_COMPILER_MSVC -#if defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) +#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI _A1 __constexpr_fmax(_A1 __x, _A1 __y) noexcept { @@ -831,7 +831,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX __promote_t<_Tp, _Up> __ } #endif // !_CCCL_COMPILER_MSVC -#if defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) || defined(_CCCL_CUDA_COMPILER_CLANG) +#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) || defined(_CCCL_CUDA_COMPILER_CLANG) template _LIBCUDACXX_HIDE_FROM_ABI _A1 __constexpr_logb(_A1 __x) { @@ -874,7 +874,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX _Tp __constexpr_logb(_Tp } #endif // !_MSVC -#if defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC) || defined(_CCCL_CUDA_COMPILER_CLANG) +#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) || defined(_CCCL_CUDA_COMPILER_CLANG) template _LIBCUDACXX_HIDE_FROM_ABI _Tp __constexpr_scalbn(_Tp __x, int __i) { diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/complex b/libcudacxx/include/cuda/std/detail/libcxx/include/complex index 7a24039ba2b..68d59129e4e 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/complex +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/complex @@ -256,13 +256,13 @@ template complex tanh (const complex&); #include // Compatability helpers for thrust to convert between `std::complex` and `cuda::std::complex` -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) # include # include // for std::basic_ostringstream # define _LIBCUDACXX_ACCESS_STD_COMPLEX_REAL(__c) reinterpret_cast(__c)[0] # define _LIBCUDACXX_ACCESS_STD_COMPLEX_IMAG(__c) reinterpret_cast(__c)[1] -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) _CCCL_PUSH_MACROS @@ -324,7 +324,7 @@ public: return *this; } -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI complex(const ::std::complex<_Up>& __other) : __re_(_LIBCUDACXX_ACCESS_STD_COMPLEX_REAL(__other)) @@ -343,7 +343,7 @@ public: { return {__re_, __im_}; } -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_HIDE_FROM_ABI constexpr value_type real() const { @@ -794,7 +794,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool operator!=(const _Tp& __x, } #endif // _CCCL_STD_VER <= 2017 -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool operator==(const complex<_Tp>& __x, const ::std::complex<_Up>& __y) { @@ -822,7 +822,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool operator!=(const ::std::com return !(__x == __y); } # endif // _CCCL_STD_VER <= 2017 -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) // real @@ -1418,7 +1418,7 @@ _LIBCUDACXX_HIDE_FROM_ABI complex<_Tp> tan(const complex<_Tp>& __x) return complex<_Tp>(__z.imag(), -__z.real()); } -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) template ::std::basic_istream<_CharT, _Traits>& operator>>(::std::basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) { @@ -1433,7 +1433,7 @@ template { return __os << static_cast<::std::complex<_Tp>>(__x); } -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) #if _CCCL_STD_VER > 2011 && defined(_LIBCUDACXX_HAS_STL_LITERALS) // Literal suffix for complex number literals [complex.literals] diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/cstdint b/libcudacxx/include/cuda/std/detail/libcxx/include/cstdint index 152ea76fbb3..d467c173bf9 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/cstdint +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/cstdint @@ -154,9 +154,9 @@ Types: #include #include -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) # include -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) _CCCL_PUSH_MACROS diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/cstdlib b/libcudacxx/include/cuda/std/detail/libcxx/include/cstdlib index 1eb18897f4b..ca8b298e39f 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/cstdlib +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/cstdlib @@ -91,15 +91,15 @@ void *aligned_alloc(size_t alignment, size_t size); // C11 # pragma system_header #endif // no system header -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) # include -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) _CCCL_PUSH_MACROS _LIBCUDACXX_BEGIN_NAMESPACE_STD -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) using ::div_t; using ::ldiv_t; using ::size_t; @@ -161,7 +161,7 @@ using ::quick_exit; # if _CCCL_STD_VER > 2014 && defined(_LIBCUDACXX_HAS_C11_FEATURES) using ::aligned_alloc; # endif -#endif // !defined(_CCCL_COMPILER_NVRTC) +#endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_END_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/cstring b/libcudacxx/include/cuda/std/detail/libcxx/include/cstring index 8adaddc8ca0..45e0437a426 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/cstring +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/cstring @@ -20,9 +20,9 @@ # pragma system_header #endif // no system header -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) # include -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_BEGIN_NAMESPACE_STD @@ -30,7 +30,7 @@ using ::memcpy; using ::memset; using ::size_t; -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) using ::memchr; using ::memcmp; using ::memmove; @@ -53,7 +53,7 @@ using ::strtok; # endif // _LIBCUDACXX_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS using ::strerror; using ::strlen; -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) _LIBCUDACXX_END_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/ctime b/libcudacxx/include/cuda/std/detail/libcxx/include/ctime index e63b722411a..998d9c572eb 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/ctime +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/ctime @@ -55,11 +55,11 @@ int timespec_get( struct timespec *ts, int base); // C++17 # pragma system_header #endif // no system header -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) # include #else typedef long long int time_t; -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) _CCCL_PUSH_MACROS @@ -69,7 +69,7 @@ using ::clock_t; using ::size_t; using ::time_t; -#ifndef _CCCL_COMPILER_NVRTC +#if !_CCCL_COMPILER(NVRTC) using ::tm; # if _CCCL_STD_VER > 2014 && defined(_LIBCUDACXX_HAS_C11_FEATURES) @@ -89,7 +89,7 @@ using ::strftime; # if _CCCL_STD_VER > 2014 && defined(_LIBCUDACXX_HAS_TIMESPEC_GET) using ::timespec_get; # endif -#endif // _CCCL_COMPILER_NVRTC +#endif // _CCCL_COMPILER(NVRTC) _LIBCUDACXX_END_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/limits b/libcudacxx/include/cuda/std/detail/libcxx/include/limits index 823aa4d683c..06845b5f664 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/limits +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/limits @@ -428,7 +428,7 @@ protected: static constexpr bool has_signaling_NaN = true; static constexpr float_denorm_style has_denorm = denorm_present; static constexpr bool has_denorm_loss = false; -#ifdef _CCCL_COMPILER_NVRTC +#if _CCCL_COMPILER(NVRTC) _LIBCUDACXX_HIDE_FROM_ABI static type infinity() noexcept { return __builtin_huge_valf(); @@ -441,7 +441,7 @@ protected: { return __builtin_nansf(""); } -#else +#else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ // vvv !_CCCL_COMPILER(NVRTC) vvv _LIBCUDACXX_HIDE_FROM_ABI static constexpr type infinity() noexcept { return __builtin_huge_valf(); @@ -454,7 +454,7 @@ protected: { return __builtin_nansf(""); } -#endif +#endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_HIDE_FROM_ABI static constexpr type denorm_min() noexcept { return __FLT_DENORM_MIN__; @@ -516,7 +516,7 @@ protected: static constexpr bool has_signaling_NaN = true; static constexpr float_denorm_style has_denorm = denorm_present; static constexpr bool has_denorm_loss = false; -#ifdef _CCCL_COMPILER_NVRTC +#if _CCCL_COMPILER(NVRTC) _LIBCUDACXX_HIDE_FROM_ABI static type infinity() noexcept { return __builtin_huge_val(); @@ -529,7 +529,7 @@ protected: { return __builtin_nans(""); } -#else +#else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ // vvv !_CCCL_COMPILER(NVRTC) vvv _LIBCUDACXX_HIDE_FROM_ABI static constexpr type infinity() noexcept { return __builtin_huge_val(); @@ -542,7 +542,7 @@ protected: { return __builtin_nans(""); } -#endif +#endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_HIDE_FROM_ABI static constexpr type denorm_min() noexcept { return __DBL_DENORM_MIN__; diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/span b/libcudacxx/include/cuda/std/detail/libcxx/include/span index ab67136accb..99e68563b90 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/span +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/span @@ -369,7 +369,7 @@ public: } # endif // !_CCCL_SPAN_USES_RANGES -# if defined(_CCCL_COMPILER_NVRTC) || defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_COMPILER(NVRTC) || defined(_CCCL_COMPILER_MSVC_2017) template = 0> _LIBCUDACXX_HIDE_FROM_ABI constexpr span(type_identity_t (&__arr)[_Sz]) noexcept : __data_{__arr} @@ -378,7 +378,7 @@ public: _LIBCUDACXX_HIDE_FROM_ABI constexpr span(type_identity_t (&__arr)[_Extent]) noexcept : __data_{__arr} {} -# endif // !_CCCL_COMPILER_NVRTC && !_CCCL_COMPILER_MSVC_2017 +# endif // !_CCCL_COMPILER(NVRTC) && !_CCCL_COMPILER_MSVC_2017 _LIBCUDACXX_TEMPLATE(class _OtherElementType) _LIBCUDACXX_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) diff --git a/libcudacxx/include/cuda/std/initializer_list b/libcudacxx/include/cuda/std/initializer_list index 5c98b33a8ab..dc86cb29566 100644 --- a/libcudacxx/include/cuda/std/initializer_list +++ b/libcudacxx/include/cuda/std/initializer_list @@ -21,9 +21,9 @@ # pragma system_header #endif // no system header -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) # include -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) _LIBCUDACXX_BEGIN_NAMESPACE_STD using ::std::initializer_list; diff --git a/libcudacxx/include/cuda/std/version b/libcudacxx/include/cuda/std/version index ad5d476730a..c2724358e9f 100644 --- a/libcudacxx/include/cuda/std/version +++ b/libcudacxx/include/cuda/std/version @@ -25,9 +25,9 @@ // At the same time we want bring in all feature test macros from host #if _CCCL_HAS_INCLUDE() // should be the smallest include possible # include -#elif !defined(_CCCL_COMPILER_NVRTC) +#elif !_CCCL_COMPILER(NVRTC) # include // otherwise go for the smallest possible header -#endif +#endif // !_CCCL_COMPILER(NVRTC) #if _CCCL_STD_VER >= 2014 # define __cccl_lib_bit_cast 201806L diff --git a/libcudacxx/test/libcudacxx/cuda/type_list.pass.cpp b/libcudacxx/test/libcudacxx/cuda/type_list.pass.cpp index 9db7b7220c5..5fb735dc2f8 100644 --- a/libcudacxx/test/libcudacxx/cuda/type_list.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/type_list.pass.cpp @@ -16,7 +16,7 @@ #include #include -#if defined(_CCCL_COMPILER_ICC) || defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_COMPILER_NVRTC) \ +#if defined(_CCCL_COMPILER_ICC) || defined(_CCCL_CUDA_COMPILER_NVCC) || _CCCL_COMPILER(NVRTC) \ || defined(_CCCL_CUDA_COMPILER_CLANG) // These compilers have trouble making substitution failures during // alias template instantiation non-fatal. diff --git a/libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp index c1b4ac14c2c..26b796db7fe 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp @@ -153,7 +153,7 @@ __host__ __device__ void test_after_tuple_size_specialization() { Test const t{99}; auto& [p] = t; -#if !(defined(_CCCL_COMPILER_NVRTC) && defined(__CUDA_ARCH__)) // nvbug4053842 +#if !(_CCCL_COMPILER(NVRTC) && defined(__CUDA_ARCH__)) // nvbug4053842 assert(p == -1); #endif } diff --git a/libcudacxx/test/support/count_new.h b/libcudacxx/test/support/count_new.h index c4fabbe9d21..0777c2c787e 100644 --- a/libcudacxx/test/support/count_new.h +++ b/libcudacxx/test/support/count_new.h @@ -12,9 +12,9 @@ #include #include -#if !defined(_CCCL_COMPILER_NVRTC) +#if !_CCCL_COMPILER(NVRTC) # include -#endif // !_CCCL_COMPILER_NVRTC +#endif // !_CCCL_COMPILER(NVRTC) #include "test_macros.h" diff --git a/libcudacxx/test/support/cuda_space_selector.h b/libcudacxx/test/support/cuda_space_selector.h index 66cf7aeebfd..2217699fbee 100644 --- a/libcudacxx/test/support/cuda_space_selector.h +++ b/libcudacxx/test/support/cuda_space_selector.h @@ -20,7 +20,7 @@ # include #endif -#ifdef _CCCL_COMPILER_NVRTC +#if _CCCL_COMPILER(NVRTC) # define LAMBDA [=] #else # define LAMBDA [=] __host__ __device__ From 64aa0028e9f5a252012e34e20ab35397b3b6d340 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Sun, 17 Nov 2024 18:14:34 +0100 Subject: [PATCH 2/2] Move `_CCCL_COMPILER_ICC` to the new macro --- cub/cub/util_macro.cuh | 4 ++-- cub/cub/util_type.cuh | 3 +-- .../cuda/experimental/__detail/config.cuh | 6 +++--- libcudacxx/include/cuda/std/__cccl/assert.h | 6 +++--- libcudacxx/include/cuda/std/__cccl/compiler.h | 2 +- .../include/cuda/std/__cccl/diagnostic.h | 10 +++++----- libcudacxx/include/cuda/std/__cccl/rtti.h | 4 ++-- .../include/cuda/std/__cccl/system_header.h | 4 ++-- .../include/cuda/std/__cccl/visibility.h | 6 +++--- .../cuda/std/detail/libcxx/include/__config | 2 +- .../cuda/std/detail/libcxx/include/cmath | 18 +++++++++--------- .../test/libcudacxx/cuda/type_list.pass.cpp | 2 +- thrust/testing/async_copy.cu | 4 ++-- thrust/testing/scan.cu | 2 +- thrust/thrust/complex.h | 10 +++++----- thrust/thrust/detail/config/compiler.h | 2 +- 16 files changed, 42 insertions(+), 43 deletions(-) diff --git a/cub/cub/util_macro.cuh b/cub/cub/util_macro.cuh index af9977ece7b..f98751b2ddf 100644 --- a/cub/cub/util_macro.cuh +++ b/cub/cub/util_macro.cuh @@ -112,12 +112,12 @@ _CCCL_DIAG_SUPPRESS_CLANG("-Wattributes") # if !defined(_CCCL_CUDA_COMPILER_NVHPC) _CCCL_DIAG_SUPPRESS_NVHPC(attribute_requires_external_linkage) # endif // !_CCCL_CUDA_COMPILER_NVHPC -# if defined(_CCCL_COMPILER_ICC) +# if _CCCL_COMPILER(ICC) # pragma nv_diag_suppress 1407 // the "__visibility__" attribute can only appear on functions and // variables with external linkage' # pragma warning(disable : 1890) // the "__visibility__" attribute can only appear on functions and // variables with external linkage' -# endif // _CCCL_COMPILER_ICC +# endif // _CCCL_COMPILER(ICC) #endif // !CUB_DISABLE_KERNEL_VISIBILITY_WARNING_SUPPRESSION #ifndef CUB_DEFINE_KERNEL_GETTER diff --git a/cub/cub/util_type.cuh b/cub/cub/util_type.cuh index 8935ff3e17b..f8713c98ff0 100644 --- a/cub/cub/util_type.cuh +++ b/cub/cub/util_type.cuh @@ -74,8 +74,7 @@ CUB_NAMESPACE_BEGIN # endif // !defined(__CUDACC_RTC_INT128__) # else // !defined(__CUDACC_RTC__) # if _CCCL_CUDACC_AT_LEAST(11, 5) -# if defined(_CCCL_COMPILER_GCC) || defined(_CCCL_COMPILER_CLANG) || defined(_CCCL_COMPILER_ICC) \ - || _CCCL_COMPILER(NVHPC) +# if defined(_CCCL_COMPILER_GCC) || defined(_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/__detail/config.cuh b/cudax/include/cuda/experimental/__detail/config.cuh index 5c434c30605..6f009d3a4e9 100644 --- a/cudax/include/cuda/experimental/__detail/config.cuh +++ b/cudax/include/cuda/experimental/__detail/config.cuh @@ -35,15 +35,15 @@ // two attributes: // - `_CUDAX_API` declares the function host/device and hides the symbol from the ABI // - `_CUDAX_TRIVIAL_API` does the same while also forcing inlining and hiding the function from debuggers -#if defined(_CCCL_COMPILER_ICC) // ICC has issues with visibility attributes on symbols with internal linkage +#if _CCCL_COMPILER(ICC) // ICC has issues with visibility attributes on symbols with internal linkage # define _CUDAX_API _CCCL_HOST_DEVICE # define _CUDAX_HOST_API _CCCL_HOST # define _CUDAX_DEVICE_API _CCCL_DEVICE -#else // ^^^ _CCCL_COMPILER_ICC ^^^ / vvv !_CCCL_COMPILER_ICC vvv +#else // ^^^ _CCCL_COMPILER(ICC) ^^^ / vvv !_CCCL_COMPILER(ICC) vvv # define _CUDAX_API _CCCL_HOST_DEVICE _CCCL_VISIBILITY_HIDDEN _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION # define _CUDAX_HOST_API _CCCL_HOST _CCCL_VISIBILITY_HIDDEN _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION # define _CUDAX_DEVICE_API _CCCL_DEVICE _CCCL_VISIBILITY_HIDDEN _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION -#endif // !_CCCL_COMPILER_ICC +#endif // !_CCCL_COMPILER(ICC) // _CUDAX_TRIVIAL_API force-inlines a function, marks its visibility as hidden, and causes debuggers to skip it. // This is useful for trivial internal functions that do dispatching or other plumbing work. It is particularly diff --git a/libcudacxx/include/cuda/std/__cccl/assert.h b/libcudacxx/include/cuda/std/__cccl/assert.h index ea9d4f8527a..70b2398cccf 100644 --- a/libcudacxx/include/cuda/std/__cccl/assert.h +++ b/libcudacxx/include/cuda/std/__cccl/assert.h @@ -80,14 +80,14 @@ _CCCL_HOST_DEVICE } # endif // NDEBUG // ICC cannot deal with `__builtin_expect` in the constexpr evaluator, so just drop it -# if defined(_CCCL_COMPILER_ICC) +# if _CCCL_COMPILER(ICC) # define _CCCL_ASSERT_IMPL_HOST(expression, message) \ static_cast(expression) ? (void) 0 : __assert_fail(message, __FILE__, __LINE__, __func__); -# else // ^^^ _CCCL_COMPILER_ICC ^^^ / vvv !_CCCL_COMPILER_ICC vvv +# else // ^^^ _CCCL_COMPILER(ICC) ^^^ / vvv !_CCCL_COMPILER(ICC) vvv # define _CCCL_ASSERT_IMPL_HOST(expression, message) \ _CCCL_BUILTIN_EXPECT(static_cast(expression), 1) \ ? (void) 0 : __assert_fail(message, __FILE__, __LINE__, __func__) -# endif // !_CCCL_COMPILER_ICC +# endif // !_CCCL_COMPILER(ICC) #endif // !MSVC STL //! Use custom implementations with nvcc on device and the host ones with clang-cuda and nvhpc diff --git a/libcudacxx/include/cuda/std/__cccl/compiler.h b/libcudacxx/include/cuda/std/__cccl/compiler.h index 561a26781bf..ed9b403a5ad 100644 --- a/libcudacxx/include/cuda/std/__cccl/compiler.h +++ b/libcudacxx/include/cuda/std/__cccl/compiler.h @@ -15,7 +15,7 @@ // Determine the host compiler and its version #if defined(__INTEL_COMPILER) -# define _CCCL_COMPILER_ICC +# define _CCCL_COMPILER_ICC 1 # ifndef CCCL_SUPPRESS_ICC_DEPRECATION_WARNING # warning \ "Support for the Intel C++ Compiler Classic is deprecated and will eventually be removed. Define CCCL_SUPPRESS_ICC_DEPRECATION_WARNING to suppress this warning" diff --git a/libcudacxx/include/cuda/std/__cccl/diagnostic.h b/libcudacxx/include/cuda/std/__cccl/diagnostic.h index bcf12a30fce..20abe1b3ec1 100644 --- a/libcudacxx/include/cuda/std/__cccl/diagnostic.h +++ b/libcudacxx/include/cuda/std/__cccl/diagnostic.h @@ -39,7 +39,7 @@ # define _CCCL_DIAG_SUPPRESS_NVHPC(str) # define _CCCL_DIAG_SUPPRESS_MSVC(str) # define _CCCL_DIAG_SUPPRESS_ICC(str) -#elif defined(_CCCL_COMPILER_ICC) +#elif _CCCL_COMPILER(ICC) # define _CCCL_DIAG_PUSH _CCCL_PRAGMA(GCC diagnostic push) # define _CCCL_DIAG_POP _CCCL_PRAGMA(GCC diagnostic pop) # define _CCCL_DIAG_SUPPRESS_CLANG(str) @@ -80,7 +80,7 @@ _CCCL_DIAG_SUPPRESS_CLANG("-Wdeprecated") \ _CCCL_DIAG_SUPPRESS_CLANG("-Wdeprecated-declarations") # define _CCCL_SUPPRESS_DEPRECATED_POP _CCCL_DIAG_POP -#elif defined(_CCCL_COMPILER_ICC) +#elif _CCCL_COMPILER(ICC) # define _CCCL_SUPPRESS_DEPRECATED_PUSH \ _CCCL_DIAG_PUSH \ _CCCL_DIAG_SUPPRESS_ICC(1478) @@ -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 @@ -113,7 +113,7 @@ # if defined(_CCCL_CUDA_COMPILER_CLANG) # define _CCCL_NV_DIAG_SUPPRESS(_WARNING) # define _CCCL_NV_DIAG_DEFAULT(_WARNING) -# elif defined(__NVCC_DIAG_PRAGMA_SUPPORT__) || defined(_CCCL_COMPILER_ICC) +# elif defined(__NVCC_DIAG_PRAGMA_SUPPORT__) || _CCCL_COMPILER(ICC) # if defined(_CCCL_COMPILER_MSVC) # define _CCCL_NV_DIAG_SUPPRESS(_WARNING) _CCCL_PRAGMA(nv_diag_suppress _WARNING) # define _CCCL_NV_DIAG_DEFAULT(_WARNING) _CCCL_PRAGMA(nv_diag_default _WARNING) diff --git a/libcudacxx/include/cuda/std/__cccl/rtti.h b/libcudacxx/include/cuda/std/__cccl/rtti.h index 50b6fbbf0e3..80f216ef0d6 100644 --- a/libcudacxx/include/cuda/std/__cccl/rtti.h +++ b/libcudacxx/include/cuda/std/__cccl/rtti.h @@ -32,7 +32,7 @@ # define _CCCL_NO_RTTI # elif defined(__CUDA_ARCH__) # define _CCCL_NO_RTTI // No RTTI in CUDA device code -# elif defined(_CCCL_COMPILER_ICC) +# elif _CCCL_COMPILER(ICC) # if __RTTI == 0 && __INTEL_RTTI__ == 0 && __GXX_RTTI == 0 && _CPPRTTI == 0 # define _CCCL_NO_RTTI # endif @@ -58,7 +58,7 @@ # define _CCCL_NO_TYPEID # elif defined(__CUDA_ARCH__) # define _CCCL_NO_TYPEID // No typeid in CUDA device code -# elif defined(_CCCL_COMPILER_ICC) +# elif _CCCL_COMPILER(ICC) // when emulating MSVC, typeid is available even when RTTI is disabled # if !defined(_MSC_VER) && __RTTI == 0 && __INTEL_RTTI__ == 0 && __GXX_RTTI == 0 && _CPPRTTI == 0 # define _CCCL_NO_TYPEID diff --git a/libcudacxx/include/cuda/std/__cccl/system_header.h b/libcudacxx/include/cuda/std/__cccl/system_header.h index d26ccddddd6..067e6e5b9e8 100644 --- a/libcudacxx/include/cuda/std/__cccl/system_header.h +++ b/libcudacxx/include/cuda/std/__cccl/system_header.h @@ -15,7 +15,7 @@ #include // IWYU pragma: export // Enforce that cccl headers are treated as system headers -#if defined(_CCCL_COMPILER_GCC) || _CCCL_COMPILER(NVHPC) || defined(_CCCL_COMPILER_ICC) +#if defined(_CCCL_COMPILER_GCC) || _CCCL_COMPILER(NVHPC) || _CCCL_COMPILER(ICC) # define _CCCL_FORCE_SYSTEM_HEADER_GCC #elif defined(_CCCL_COMPILER_CLANG) # define _CCCL_FORCE_SYSTEM_HEADER_CLANG @@ -27,7 +27,7 @@ #if !defined(_CCCL_NO_SYSTEM_HEADER) \ && !(defined(_CCCL_COMPILER_MSVC) && defined(_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING)) && !_CCCL_COMPILER(NVRTC) \ && !defined(_LIBCUDACXX_DISABLE_PRAGMA_GCC_SYSTEM_HEADER) -# if defined(_CCCL_COMPILER_GCC) || _CCCL_COMPILER(NVHPC) || defined(_CCCL_COMPILER_ICC) +# if defined(_CCCL_COMPILER_GCC) || _CCCL_COMPILER(NVHPC) || _CCCL_COMPILER(ICC) # define _CCCL_IMPLICIT_SYSTEM_HEADER_GCC # elif defined(_CCCL_COMPILER_CLANG) # define _CCCL_IMPLICIT_SYSTEM_HEADER_CLANG diff --git a/libcudacxx/include/cuda/std/__cccl/visibility.h b/libcudacxx/include/cuda/std/__cccl/visibility.h index b994b3d627d..ad35694a448 100644 --- a/libcudacxx/include/cuda/std/__cccl/visibility.h +++ b/libcudacxx/include/cuda/std/__cccl/visibility.h @@ -72,13 +72,13 @@ # define _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION #endif // !exclude_from_explicit_instantiation -#if defined(_CCCL_COMPILER_ICC) // ICC has issues with visibility attributes on symbols with internal linkage +#if _CCCL_COMPILER(ICC) // ICC has issues with visibility attributes on symbols with internal linkage # define _CCCL_HIDE_FROM_ABI inline #elif _CCCL_COMPILER(NVHPC) // NVHPC has issues with visibility attributes on symbols with internal linkage # define _CCCL_HIDE_FROM_ABI inline -#else // ^^^ _CCCL_COMPILER_ICC ^^^ / vvv !_CCCL_COMPILER_ICC vvv +#else // ^^^ _CCCL_COMPILER(ICC) ^^^ / vvv !_CCCL_COMPILER(ICC) vvv # define _CCCL_HIDE_FROM_ABI _CCCL_VISIBILITY_HIDDEN _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION inline -#endif // !_CCCL_COMPILER_ICC +#endif // !_CCCL_COMPILER(ICC) //! Defined here to supress any warnings from the definition #define _LIBCUDACXX_HIDE_FROM_ABI _CCCL_HIDE_FROM_ABI _CCCL_HOST_DEVICE diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/__config b/libcudacxx/include/cuda/std/detail/libcxx/include/__config index e482dbd7e2e..8c4d3e6775c 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/__config +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/__config @@ -742,7 +742,7 @@ typedef unsigned int char32_t; // TODO: Support C11 Atomics? // #if _CCCL_HAS_FEATURE(cxx_atomic) || __has_extension(c_atomic) || _CCCL_HAS_KEYWORD(_Atomic) // # define _LIBCUDACXX_HAS_C_ATOMIC_IMP -# if defined(_CCCL_COMPILER_ICC) +# if _CCCL_COMPILER(ICC) # define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP # elif defined(_CCCL_COMPILER_CLANG) # define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/cmath b/libcudacxx/include/cuda/std/detail/libcxx/include/cmath index 911a8195a0c..bf0f4da10f5 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/cmath +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/cmath @@ -756,11 +756,11 @@ _LIBCUDACXX_HIDE_FROM_ABI _A1 __constexpr_fmax(_A1 __x, _A1 __y) noexcept _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX float __constexpr_fmax(float __x, float __y) noexcept { # if defined(_CCCL_BUILTIN_IS_CONSTANT_EVALUATED) && !defined(_LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS) -# if defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) +# if _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) if (false) -# else // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) +# else // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) if (_CCCL_BUILTIN_IS_CONSTANT_EVALUATED()) -# endif // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) +# endif // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) { if (__constexpr_isnan(__x)) { @@ -779,11 +779,11 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX float __constexpr_fmax(f _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX double __constexpr_fmax(double __x, double __y) noexcept { # if defined(_CCCL_BUILTIN_IS_CONSTANT_EVALUATED) && !defined(_LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS) -# if defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) +# if _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) if (false) -# else // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) +# else // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) if (_CCCL_BUILTIN_IS_CONSTANT_EVALUATED()) -# endif // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) +# endif // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) { if (__constexpr_isnan(__x)) { @@ -803,11 +803,11 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX long double __constexpr_fmax(long double __x, long double __y) noexcept { # if defined(_CCCL_BUILTIN_IS_CONSTANT_EVALUATED) && !defined(_LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS) -# if defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) +# if _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) if (false) -# else // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) +# else // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) if (_CCCL_BUILTIN_IS_CONSTANT_EVALUATED()) -# endif // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) +# endif // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX) { if (__constexpr_isnan(__x)) { diff --git a/libcudacxx/test/libcudacxx/cuda/type_list.pass.cpp b/libcudacxx/test/libcudacxx/cuda/type_list.pass.cpp index 5fb735dc2f8..2e477d3622a 100644 --- a/libcudacxx/test/libcudacxx/cuda/type_list.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/type_list.pass.cpp @@ -16,7 +16,7 @@ #include #include -#if defined(_CCCL_COMPILER_ICC) || defined(_CCCL_CUDA_COMPILER_NVCC) || _CCCL_COMPILER(NVRTC) \ +#if _CCCL_COMPILER(ICC) || defined(_CCCL_CUDA_COMPILER_NVCC) || _CCCL_COMPILER(NVRTC) \ || defined(_CCCL_CUDA_COMPILER_CLANG) // These compilers have trouble making substitution failures during // alias template instantiation non-fatal. diff --git a/thrust/testing/async_copy.cu b/thrust/testing/async_copy.cu index 23c42568038..cf67652ac06 100644 --- a/thrust/testing/async_copy.cu +++ b/thrust/testing/async_copy.cu @@ -208,10 +208,10 @@ struct test_async_copy_counting_iterator_input_to_host_vector ASSERT_EQUAL(d0, d1); -# if defined(_CCCL_COMPILER_ICC) +# if _CCCL_COMPILER(ICC) // ICC fails this for some unknown reason - see #1468. KNOWN_FAILURE; -# endif +# endif // _CCCL_COMPILER(ICC) } }; }; diff --git a/thrust/testing/scan.cu b/thrust/testing/scan.cu index e657d637a57..171868ee602 100644 --- a/thrust/testing/scan.cu +++ b/thrust/testing/scan.cu @@ -30,7 +30,7 @@ void TestScanSimple() // The issue doesn't happen with opts disabled, or on other compilers. // Printing the intermediate sum each iteration "fixes" the issue, // so likely a bad optimization. -#if defined(_CCCL_COMPILER_ICC) +#if _CCCL_COMPILER(ICC) if (std::is_same::value) { return; diff --git a/thrust/thrust/complex.h b/thrust/thrust/complex.h index db2bb37d650..f3a2ef370fb 100644 --- a/thrust/thrust/complex.h +++ b/thrust/thrust/complex.h @@ -341,18 +341,18 @@ struct complex private: #if defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 7) struct __align__(sizeof(T) * 2) storage -#elif defined(_CCCL_COMPILER_ICC) +#elif _CCCL_COMPILER(ICC) struct storage -#else // !(defined(_CCCL_COMPILER_ICC) || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 7))) +#else // !(_CCCL_COMPILER(ICC) || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 7))) struct alignas(sizeof(T) * 2) storage -#endif // !(defined(_CCCL_COMPILER_ICC) || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 7))) +#endif // !(_CCCL_COMPILER(ICC) || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 7))) { T x; T y; } -#ifdef _CCCL_COMPILER_ICC +#if _CCCL_COMPILER(ICC) __attribute__((aligned(sizeof(T) * 2))) -#endif // _CCCL_COMPILER_ICC +#endif // _CCCL_COMPILER(ICC) ; storage data; }; diff --git a/thrust/thrust/detail/config/compiler.h b/thrust/thrust/detail/config/compiler.h index 7644b2d2e8f..b160db1f9dd 100644 --- a/thrust/thrust/detail/config/compiler.h +++ b/thrust/thrust/detail/config/compiler.h @@ -62,7 +62,7 @@ # define THRUST_MSVC_VERSION _CCCL_MSVC_VERSION //! deprecated [Since 2.7] # define THRUST_MSVC_VERSION_FULL _CCCL_MSVC_VERSION_FULL -#elif defined(_CCCL_COMPILER_ICC) +#elif _CCCL_COMPILER(ICC) //! deprecated [Since 2.7] # define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_INTEL #elif defined(_CCCL_COMPILER_CLANG)