diff --git a/cub/cmake/header_test.in b/cub/cmake/header_test.in index 547c2030ab4..300fa6abb94 100644 --- a/cub/cmake/header_test.in +++ b/cub/cmake/header_test.in @@ -5,7 +5,7 @@ // Define CUB_MACRO_CHECK(macro, header), which emits a diagnostic indicating // a potential macro collision and halts. // -// Use raw platform checks instead of the CUB_HOST_COMPILER macros since we +// Use raw platform macros instead of the CCCL macros since we // don't want to #include any headers other than the one being tested. // // This is only implemented for MSVC/GCC/Clang. diff --git a/cub/cub/util_compiler.cuh b/cub/cub/util_compiler.cuh index ef0c178c56d..cae7565ec7a 100644 --- a/cub/cub/util_compiler.cuh +++ b/cub/cub/util_compiler.cuh @@ -44,45 +44,67 @@ #endif // no system header // enumerate host compilers we know about +//! deprecated [Since 2.7] #define CUB_HOST_COMPILER_UNKNOWN 0 -#define CUB_HOST_COMPILER_MSVC 1 -#define CUB_HOST_COMPILER_GCC 2 -#define CUB_HOST_COMPILER_CLANG 3 +//! deprecated [Since 2.7] +#define CUB_HOST_COMPILER_MSVC 1 +//! deprecated [Since 2.7] +#define CUB_HOST_COMPILER_GCC 2 +//! deprecated [Since 2.7] +#define CUB_HOST_COMPILER_CLANG 3 // enumerate device compilers we know about +//! deprecated [Since 2.7] #define CUB_DEVICE_COMPILER_UNKNOWN 0 -#define CUB_DEVICE_COMPILER_MSVC 1 -#define CUB_DEVICE_COMPILER_GCC 2 -#define CUB_DEVICE_COMPILER_NVCC 3 -#define CUB_DEVICE_COMPILER_CLANG 4 +//! deprecated [Since 2.7] +#define CUB_DEVICE_COMPILER_MSVC 1 +//! deprecated [Since 2.7] +#define CUB_DEVICE_COMPILER_GCC 2 +//! deprecated [Since 2.7] +#define CUB_DEVICE_COMPILER_NVCC 3 +//! deprecated [Since 2.7] +#define CUB_DEVICE_COMPILER_CLANG 4 // figure out which host compiler we're using #if defined(_CCCL_COMPILER_MSVC) -# define CUB_HOST_COMPILER CUB_HOST_COMPILER_MSVC -# define CUB_MSVC_VERSION _MSC_VER -# define CUB_MSVC_VERSION_FULL _MSC_FULL_VER +//! deprecated [Since 2.7] +# define CUB_HOST_COMPILER CUB_HOST_COMPILER_MSVC +//! deprecated [Since 2.7] +# define CUB_MSVC_VERSION _CCCL_MSVC_VERSION +//! deprecated [Since 2.7] +# define CUB_MSVC_VERSION_FULL _CCCL_MSVC_VERSION_FULL #elif defined(_CCCL_COMPILER_CLANG) +//! deprecated [Since 2.7] # define CUB_HOST_COMPILER CUB_HOST_COMPILER_CLANG -# define CUB_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) +//! deprecated [Since 2.7] +# define CUB_CLANG_VERSION _CCCL_CLANG_VERSION #elif defined(_CCCL_COMPILER_GCC) +//! deprecated [Since 2.7] # define CUB_HOST_COMPILER CUB_HOST_COMPILER_GCC -# define CUB_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +//! deprecated [Since 2.7] +# define CUB_GCC_VERSION _CCCL_GCC_VERSION #endif // figure out which device compiler we're using #if defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_CUDA_COMPILER_NVHPC) +//! deprecated [Since 2.7] # define CUB_DEVICE_COMPILER CUB_DEVICE_COMPILER_NVCC #elif defined(_CCCL_COMPILER_MSVC) +//! deprecated [Since 2.7] # define CUB_DEVICE_COMPILER CUB_DEVICE_COMPILER_MSVC #elif defined(_CCCL_COMPILER_GCC) +//! deprecated [Since 2.7] # define CUB_DEVICE_COMPILER CUB_DEVICE_COMPILER_GCC #elif defined(_CCCL_COMPILER_CLANG) // CUDA-capable clang should behave similar to NVCC. # if defined(_CCCL_CUDA_COMPILER_NVCC) +//! deprecated [Since 2.7] # define CUB_DEVICE_COMPILER CUB_DEVICE_COMPILER_NVCC # else +//! deprecated [Since 2.7] # define CUB_DEVICE_COMPILER CUB_DEVICE_COMPILER_CLANG # endif #else +//! deprecated [Since 2.7] # define CUB_DEVICE_COMPILER CUB_DEVICE_COMPILER_UNKNOWN #endif diff --git a/cub/cub/util_cpp_dialect.cuh b/cub/cub/util_cpp_dialect.cuh index d6052946931..5c275f0e763 100644 --- a/cub/cub/util_cpp_dialect.cuh +++ b/cub/cub/util_cpp_dialect.cuh @@ -101,14 +101,14 @@ # ifndef CUB_IGNORE_DEPRECATED_COMPILER // Compiler checks: -# if defined(_CCCL_COMPILER_GCC) && CUB_GCC_VERSION < 50000 +# if defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION < 50000 CUB_COMPILER_DEPRECATION(GCC 5.0); -# elif defined(_CCCL_COMPILER_CLANG) && CUB_CLANG_VERSION < 70000 +# elif defined(_CCCL_COMPILER_CLANG) && _CCCL_CLANG_VERSION < 70000 CUB_COMPILER_DEPRECATION(Clang 7.0); -# elif defined(_CCCL_COMPILER_MSVC) && CUB_MSVC_VERSION < 1910 +# elif defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION < 1910 // <2017. Hard upgrade message: CUB_COMPILER_DEPRECATION(MSVC 2019(19.20 / 16.0 / 14.20)); -# elif defined(_CCCL_COMPILER_MSVC) && CUB_MSVC_VERSION < 1920 +# elif defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION < 1920 // >=2017, <2019. Soft deprecation message: CUB_COMPILER_DEPRECATION_SOFT(MSVC 2019(19.20 / 16.0 / 14.20), MSVC 2017); # endif diff --git a/libcudacxx/include/cuda/std/__cccl/compiler.h b/libcudacxx/include/cuda/std/__cccl/compiler.h index c3b09f1872e..409534d5701 100644 --- a/libcudacxx/include/cuda/std/__cccl/compiler.h +++ b/libcudacxx/include/cuda/std/__cccl/compiler.h @@ -20,10 +20,14 @@ # define _CCCL_COMPILER_NVHPC #elif defined(__clang__) # define _CCCL_COMPILER_CLANG +# define _CCCL_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) #elif defined(__GNUC__) # define _CCCL_COMPILER_GCC +# define _CCCL_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #elif defined(_MSC_VER) # define _CCCL_COMPILER_MSVC +# define _CCCL_MSVC_VERSION _MSC_VER +# define _CCCL_MSVC_VERSION_FULL _MSC_FULL_VER #elif defined(__IBMCPP__) # define _CCCL_COMPILER_IBM #elif defined(__CUDACC_RTC__) diff --git a/libcudacxx/include/cuda/std/__variant/monostate.h b/libcudacxx/include/cuda/std/__variant/monostate.h index 2453e8ae012..c68d2f17afd 100644 --- a/libcudacxx/include/cuda/std/__variant/monostate.h +++ b/libcudacxx/include/cuda/std/__variant/monostate.h @@ -28,8 +28,6 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD -#if _CCCL_STD_VER >= 2011 - struct _LIBCUDACXX_TEMPLATE_VIS monostate {}; @@ -38,23 +36,23 @@ _LIBCUDACXX_INLINE_VISIBILITY constexpr bool operator==(monostate, monostate) no return true; } -# if _CCCL_STD_VER < 2020 +#if _CCCL_STD_VER < 2020 _LIBCUDACXX_INLINE_VISIBILITY constexpr bool operator!=(monostate, monostate) noexcept { return false; } -# endif // _CCCL_STD_VER < 2020 +#endif // _CCCL_STD_VER < 2020 -# if _CCCL_STD_VER >= 2020 && !defined(_LIBCUDACXX_HAS_NO_SPACESHIP_OPERATOR) +#if _CCCL_STD_VER >= 2020 && !defined(_LIBCUDACXX_HAS_NO_SPACESHIP_OPERATOR) _LIBCUDACXX_INLINE_VISIBILITY constexpr strong_ordering operator<=>(monostate, monostate) noexcept { return strong_ordering::equal; } -# else // _CCCL_STD_VER >= 2020 +#else // _CCCL_STD_VER >= 2020 _LIBCUDACXX_INLINE_VISIBILITY constexpr bool operator<(monostate, monostate) noexcept { @@ -76,9 +74,9 @@ _LIBCUDACXX_INLINE_VISIBILITY constexpr bool operator>=(monostate, monostate) no return true; } -# endif // _CCCL_STD_VER >= 2020 +#endif // _CCCL_STD_VER >= 2020 -# ifndef __cuda_std__ +#ifndef __cuda_std__ template <> struct _LIBCUDACXX_TEMPLATE_VIS hash { @@ -90,9 +88,7 @@ struct _LIBCUDACXX_TEMPLATE_VIS hash return 66740831; // return a fundamentally attractive random value. } }; -# endif // __cuda_std__ - -#endif // _CCCL_STD_VER >= 2011 +#endif // __cuda_std__ _LIBCUDACXX_END_NAMESPACE_STD diff --git a/thrust/cmake/header_test.in b/thrust/cmake/header_test.in index 236cb9bde4e..292fe16526c 100644 --- a/thrust/cmake/header_test.in +++ b/thrust/cmake/header_test.in @@ -17,7 +17,7 @@ THRUST_MACRO_CHECK_IMPL(Identifier MACRO should not be used from Thrust \ headers due to conflicts with HEADER macros.) -// Use raw platform checks instead of the THRUST_HOST_COMPILER macros since we +// Use raw platform macros instead of the CCCL macros since we // don't want to #include any headers other than the one being tested. // // This is only implemented for MSVC/GCC/Clang. diff --git a/thrust/examples/include/host_device.h b/thrust/examples/include/host_device.h index ad02b1324b6..7d7d4e68ea6 100644 --- a/thrust/examples/include/host_device.h +++ b/thrust/examples/include/host_device.h @@ -16,7 +16,7 @@ #pragma once -#if THRUST_DEVICE_COMPILER != THRUST_DEVICE_COMPILER_NVCC +#ifndef _CCCL_CUDA_COMPILER # ifndef __host__ # define __host__ diff --git a/thrust/testing/async_sort.cu b/thrust/testing/async_sort.cu index 1cb4200cdcd..feb5cb5624a 100644 --- a/thrust/testing/async_sort.cu +++ b/thrust/testing/async_sort.cu @@ -1,7 +1,7 @@ #include // Disabled on MSVC && NVCC < 11.1 for GH issue #1098. -#if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC) && defined(__CUDACC__) +#if defined(_CCCL_COMPILER_MSVC) && defined(__CUDACC__) # if (__CUDACC_VER_MAJOR__ < 11) || (__CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ < 1) # define THRUST_BUG_1098_ACTIVE # endif // NVCC version check diff --git a/thrust/thrust/complex.h b/thrust/thrust/complex.h index 77811a0eccf..de261ba6d5a 100644 --- a/thrust/thrust/complex.h +++ b/thrust/thrust/complex.h @@ -38,17 +38,11 @@ #include #include -#if THRUST_CPP_DIALECT >= 2011 -# define THRUST_STD_COMPLEX_REAL(z) \ - reinterpret_cast::value_type(&)[2]>(z)[0] -# define THRUST_STD_COMPLEX_IMAG(z) \ - reinterpret_cast::value_type(&)[2]>(z)[1] -# define THRUST_STD_COMPLEX_DEVICE _CCCL_DEVICE -#else -# define THRUST_STD_COMPLEX_REAL(z) (z).real() -# define THRUST_STD_COMPLEX_IMAG(z) (z).imag() -# define THRUST_STD_COMPLEX_DEVICE -#endif +#define THRUST_STD_COMPLEX_REAL(z) \ + reinterpret_cast::value_type(&)[2]>(z)[0] +#define THRUST_STD_COMPLEX_IMAG(z) \ + reinterpret_cast::value_type(&)[2]>(z)[1] +#define THRUST_STD_COMPLEX_DEVICE _CCCL_DEVICE THRUST_NAMESPACE_BEGIN @@ -67,100 +61,6 @@ THRUST_NAMESPACE_BEGIN * \{ */ -/*! \cond - */ - -namespace detail -{ - -template -struct complex_storage; - -#if THRUST_CPP_DIALECT >= 2011 && (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_GCC) && (THRUST_GCC_VERSION >= 40800) -// C++11 implementation, excluding GCC 4.7, which doesn't have `alignas`. -template -struct complex_storage -{ - struct alignas(Align) type - { - T x; - T y; - }; -}; -#elif (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC) \ - || ((THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_GCC) && (THRUST_GCC_VERSION < 40600)) -// C++03 implementation for MSVC and GCC <= 4.5. -// -// We have to implement `aligned_type` with specializations for MSVC -// and GCC 4.2 and older because they require literals as arguments to -// their alignment attribute. - -# if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC) -// MSVC implementation. -# define THRUST_DEFINE_COMPLEX_STORAGE_SPECIALIZATION(X) \ - template \ - struct complex_storage \ - { \ - __declspec(align(X)) struct type \ - { \ - T x; \ - T y; \ - }; \ - }; \ - /**/ -# else -// GCC <= 4.2 implementation. -# define THRUST_DEFINE_COMPLEX_STORAGE_SPECIALIZATION(X) \ - template \ - struct complex_storage \ - { \ - struct type \ - { \ - T x; \ - T y; \ - } __attribute__((aligned(X))); \ - }; \ - /**/ -# endif - -// The primary template is a fallback, which doesn't specify any alignment. -// It's only used when T is very large and we're using an older compilers -// which we have to fully specialize each alignment case. -template -struct complex_storage -{ - T x; - T y; -}; - -THRUST_DEFINE_COMPLEX_STORAGE_SPECIALIZATION(1); -THRUST_DEFINE_COMPLEX_STORAGE_SPECIALIZATION(2); -THRUST_DEFINE_COMPLEX_STORAGE_SPECIALIZATION(4); -THRUST_DEFINE_COMPLEX_STORAGE_SPECIALIZATION(8); -THRUST_DEFINE_COMPLEX_STORAGE_SPECIALIZATION(16); -THRUST_DEFINE_COMPLEX_STORAGE_SPECIALIZATION(32); -THRUST_DEFINE_COMPLEX_STORAGE_SPECIALIZATION(64); -THRUST_DEFINE_COMPLEX_STORAGE_SPECIALIZATION(128); - -# undef THRUST_DEFINE_COMPLEX_STORAGE_SPECIALIZATION -#else -// C++03 implementation for GCC > 4.5, Clang, PGI, ICPC, and xlC. -template -struct complex_storage -{ - struct type - { - T x; - T y; - } __attribute__((aligned(Align))); -}; -#endif - -} // end namespace detail - -/*! \endcond - */ - /*! \p complex is the Thrust equivalent to std::complex. It is * functionally identical to it, but can also be used in device code which * std::complex currently cannot. @@ -192,7 +92,6 @@ struct complex */ _CCCL_HOST_DEVICE complex(const T& re, const T& im); -#if THRUST_CPP_DIALECT >= 2011 /*! Default construct a complex number. */ complex() = default; @@ -203,18 +102,6 @@ struct complex * \param z The \p complex to copy from. */ complex(const complex& z) = default; -#else - /*! Default construct a complex number. - */ - _CCCL_HOST_DEVICE complex(); - - /*! This copy constructor copies from a \p complex with a type that is - * convertible to this \p complex's \c value_type. - * - * \param z The \p complex to copy from. - */ - _CCCL_HOST_DEVICE complex(const complex& z); -#endif /*! This converting copy constructor copies from a \p complex with a type * that is convertible to this \p complex's \c value_type. @@ -252,21 +139,12 @@ struct complex */ _CCCL_HOST_DEVICE complex& operator=(const T& re); -#if THRUST_CPP_DIALECT >= 2011 /*! Assign `z.real()` and `z.imag()` to the real and imaginary parts of this * \p complex respectively. * * \param z The \p complex to copy from. */ complex& operator=(const complex& z) = default; -#else - /*! Assign `z.real()` and `z.imag()` to the real and imaginary parts of this - * \p complex respectively. - * - * \param z The \p complex to copy from. - */ - _CCCL_HOST_DEVICE complex& operator=(const complex& z); -#endif /*! Assign `z.real()` and `z.imag()` to the real and imaginary parts of this * \p complex respectively. @@ -461,7 +339,22 @@ struct complex } private: - typename detail::complex_storage::type data; +#if defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_VER < 1107000 + struct __align__(sizeof(T) * 2) storage +#elif defined(_CCCL_COMPILER_ICC) + struct storage +#else // !(defined(_CCCL_COMPILER_ICC) || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_VER < 1107000)) + struct alignas(sizeof(T) * 2) storage +#endif // !(defined(_CCCL_COMPILER_ICC) || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_VER < 1107000)) + { + T x; + T y; + } +#ifdef _CCCL_COMPILER_ICC + __attribute__((aligned(sizeof(T) * 2))) +#endif // _CCCL_COMPILER_ICC + ; + storage data; }; /* --- General Functions --- */ diff --git a/thrust/thrust/detail/complex/catrig.h b/thrust/thrust/detail/complex/catrig.h index 78ece77dce6..c3c42b7f9a5 100644 --- a/thrust/thrust/detail/complex/catrig.h +++ b/thrust/thrust/detail/complex/catrig.h @@ -671,7 +671,6 @@ _CCCL_HOST_DEVICE inline double real_part_reciprocal(double x, double y) * Re(catanh(z)) = x/|z|^2 + O(x/z^4) * as z -> infinity, uniformly in x */ -#if THRUST_CPP_DIALECT >= 2011 || THRUST_HOST_COMPILER != THRUST_HOST_COMPILER_MSVC _CCCL_HOST_DEVICE inline complex catanh(complex z) { double x, y, ax, ay, rx, ry; @@ -769,8 +768,6 @@ _CCCL_HOST_DEVICE inline complex catan(complex z) return (complex(w.imag(), w.real())); } -#endif - } // namespace complex } // namespace detail @@ -851,13 +848,11 @@ _CCCL_HOST_DEVICE inline complex asin(const complex& z) return detail::complex::casin(z); } -#if THRUST_CPP_DIALECT >= 2011 || THRUST_HOST_COMPILER != THRUST_HOST_COMPILER_MSVC template <> _CCCL_HOST_DEVICE inline complex atan(const complex& z) { return detail::complex::catan(z); } -#endif template <> _CCCL_HOST_DEVICE inline complex acosh(const complex& z) @@ -871,12 +866,10 @@ _CCCL_HOST_DEVICE inline complex asinh(const complex& z) return detail::complex::casinh(z); } -#if THRUST_CPP_DIALECT >= 2011 || THRUST_HOST_COMPILER != THRUST_HOST_COMPILER_MSVC template <> _CCCL_HOST_DEVICE inline complex atanh(const complex& z) { return detail::complex::catanh(z); } -#endif THRUST_NAMESPACE_END diff --git a/thrust/thrust/detail/complex/catrigf.h b/thrust/thrust/detail/complex/catrigf.h index 60dd6fa5b45..b30cb08a437 100644 --- a/thrust/thrust/detail/complex/catrigf.h +++ b/thrust/thrust/detail/complex/catrigf.h @@ -466,7 +466,6 @@ _CCCL_HOST_DEVICE inline float real_part_reciprocal(float x, float y) return (x / (x * x + y * y) * scale); } -#if THRUST_CPP_DIALECT >= 2011 || THRUST_HOST_COMPILER != THRUST_HOST_COMPILER_MSVC _CCCL_HOST_DEVICE inline complex catanhf(complex z) { float x, y, ax, ay, rx, ry; @@ -545,7 +544,6 @@ _CCCL_HOST_DEVICE inline complex catanf(complex z) complex w = catanhf(complex(z.imag(), z.real())); return (complex(w.imag(), w.real())); } -#endif } // namespace complex @@ -563,13 +561,11 @@ _CCCL_HOST_DEVICE inline complex asin(const complex& z) return detail::complex::casinf(z); } -#if THRUST_CPP_DIALECT >= 2011 || THRUST_HOST_COMPILER != THRUST_HOST_COMPILER_MSVC template <> _CCCL_HOST_DEVICE inline complex atan(const complex& z) { return detail::complex::catanf(z); } -#endif template <> _CCCL_HOST_DEVICE inline complex acosh(const complex& z) @@ -583,12 +579,10 @@ _CCCL_HOST_DEVICE inline complex asinh(const complex& z) return detail::complex::casinhf(z); } -#if THRUST_CPP_DIALECT >= 2011 || THRUST_HOST_COMPILER != THRUST_HOST_COMPILER_MSVC template <> _CCCL_HOST_DEVICE inline complex atanh(const complex& z) { return detail::complex::catanhf(z); } -#endif THRUST_NAMESPACE_END diff --git a/thrust/thrust/detail/config/compiler.h b/thrust/thrust/detail/config/compiler.h index 6723f21c028..cac84a63cfb 100644 --- a/thrust/thrust/detail/config/compiler.h +++ b/thrust/thrust/detail/config/compiler.h @@ -31,56 +31,83 @@ #endif // no system header // enumerate host compilers we know about +//! deprecated [Since 2.7] #define THRUST_HOST_COMPILER_UNKNOWN 0 -#define THRUST_HOST_COMPILER_MSVC 1 -#define THRUST_HOST_COMPILER_GCC 2 -#define THRUST_HOST_COMPILER_CLANG 3 -#define THRUST_HOST_COMPILER_INTEL 4 +//! deprecated [Since 2.7] +#define THRUST_HOST_COMPILER_MSVC 1 +//! deprecated [Since 2.7] +#define THRUST_HOST_COMPILER_GCC 2 +//! deprecated [Since 2.7] +#define THRUST_HOST_COMPILER_CLANG 3 +//! deprecated [Since 2.7] +#define THRUST_HOST_COMPILER_INTEL 4 // enumerate device compilers we know about +//! deprecated [Since 2.7] #define THRUST_DEVICE_COMPILER_UNKNOWN 0 -#define THRUST_DEVICE_COMPILER_MSVC 1 -#define THRUST_DEVICE_COMPILER_GCC 2 -#define THRUST_DEVICE_COMPILER_CLANG 3 -#define THRUST_DEVICE_COMPILER_NVCC 4 +//! deprecated [Since 2.7] +#define THRUST_DEVICE_COMPILER_MSVC 1 +//! deprecated [Since 2.7] +#define THRUST_DEVICE_COMPILER_GCC 2 +//! deprecated [Since 2.7] +#define THRUST_DEVICE_COMPILER_CLANG 3 +//! deprecated [Since 2.7] +#define THRUST_DEVICE_COMPILER_NVCC 4 // figure out which host compiler we're using #if defined(_CCCL_COMPILER_MSVC) -# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_MSVC -# define THRUST_MSVC_VERSION _MSC_VER -# define THRUST_MSVC_VERSION_FULL _MSC_FULL_VER +//! deprecated [Since 2.7] +# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_MSVC +//! deprecated [Since 2.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) +//! deprecated [Since 2.7] # define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_INTEL #elif defined(_CCCL_COMPILER_CLANG) +//! deprecated [Since 2.7] # define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_CLANG -# define THRUST_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) +//! deprecated [Since 2.7] +# define THRUST_CLANG_VERSION _CCCL_CLANG_VERSION #elif defined(_CCCL_COMPILER_GCC) +//! deprecated [Since 2.7] # define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_GCC -# define THRUST_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +//! deprecated [Since 2.7] +# define THRUST_GCC_VERSION _CCCL_GCC_VERSION # if (THRUST_GCC_VERSION >= 50000) +//! deprecated [Since 2.7] # define THRUST_MODERN_GCC # else +//! deprecated [Since 2.7] # define THRUST_LEGACY_GCC # endif #else +//! deprecated [Since 2.7] # define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_UNKNOWN #endif // TRUST_HOST_COMPILER // figure out which device compiler we're using #if defined(__CUDACC__) || defined(_NVHPC_CUDA) +//! deprecated [Since 2.7] # define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC #elif defined(_CCCL_COMPILER_MSVC) +//! deprecated [Since 2.7] # define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_MSVC #elif defined(_CCCL_COMPILER_GCC) +//! deprecated [Since 2.7] # define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_GCC #elif defined(_CCCL_COMPILER_CLANG) // CUDA-capable clang should behave similar to NVCC. # if defined(__CUDA__) +//! deprecated [Since 2.7] # define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC # else +//! deprecated [Since 2.7] # define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_CLANG # endif #else +//! deprecated [Since 2.7] # define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_UNKNOWN #endif diff --git a/thrust/thrust/detail/config/compiler_fence.h b/thrust/thrust/detail/config/compiler_fence.h index 63ac1bd0ac1..e65db0bc847 100644 --- a/thrust/thrust/detail/config/compiler_fence.h +++ b/thrust/thrust/detail/config/compiler_fence.h @@ -68,7 +68,7 @@ // unknown case #elif defined(_CCCL_COMPILER_CLANG) # define __thrust_compiler_fence() __sync_synchronize() -#elif THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_UNKNOWN +#else // allow the code to compile without any guarantees # define __thrust_compiler_fence() \ diff --git a/thrust/thrust/detail/malloc_and_free.h b/thrust/thrust/detail/malloc_and_free.h index af8491c176f..2b0305cd9ba 100644 --- a/thrust/thrust/detail/malloc_and_free.h +++ b/thrust/thrust/detail/malloc_and_free.h @@ -63,7 +63,7 @@ malloc(const thrust::detail::execution_policy_base& exec, std::si } // XXX WAR nvbug 992955 -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # if CUDART_VERSION < 5000 // cudafe generates unqualified calls to free(int *volatile) @@ -75,7 +75,7 @@ inline _CCCL_HOST_DEVICE void free(int* volatile ptr) } # endif // CUDART_VERSION -#endif // THRUST_DEVICE_COMPILER +#endif // _CCCL_CUDA_COMPILER _CCCL_EXEC_CHECK_DISABLE template diff --git a/thrust/thrust/random/detail/normal_distribution.inl b/thrust/thrust/random/detail/normal_distribution.inl index db17798d906..9713a1ccd20 100644 --- a/thrust/thrust/random/detail/normal_distribution.inl +++ b/thrust/thrust/random/detail/normal_distribution.inl @@ -30,14 +30,9 @@ #include #include -#include +#include -// for floating point infinity -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC -# include -#else -# include -#endif +#include THRUST_NAMESPACE_BEGIN @@ -94,25 +89,14 @@ template _CCCL_HOST_DEVICE typename normal_distribution::result_type normal_distribution::min THRUST_PREVENT_MACRO_SUBSTITUTION() const { - return -this->max THRUST_PREVENT_MACRO_SUBSTITUTION(); + return ::cuda::std::numeric_limits::lowest(); } // end normal_distribution::min() template _CCCL_HOST_DEVICE typename normal_distribution::result_type normal_distribution::max THRUST_PREVENT_MACRO_SUBSTITUTION() const { - // XXX this solution is pretty terrible - // we can't use numeric_traits::max because nvcc will - // complain that it is a __host__ function - union - { - std::uint32_t inf_as_int; - float result; - } hack; - - hack.inf_as_int = 0x7f800000u; - - return hack.result; + return ::cuda::std::numeric_limits::max(); } // end normal_distribution::max() template diff --git a/thrust/thrust/random/detail/normal_distribution_base.h b/thrust/thrust/random/detail/normal_distribution_base.h index 58b36bf991e..a961cb6da90 100644 --- a/thrust/thrust/random/detail/normal_distribution_base.h +++ b/thrust/thrust/random/detail/normal_distribution_base.h @@ -148,7 +148,7 @@ class normal_distribution_portable template struct normal_distribution_base { -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC && !defined(_NVHPC_CUDA) +#if defined(_CCCL_CUDA_COMPILER) && !defined(_NVHPC_CUDA) using type = normal_distribution_nvcc; #else using type = normal_distribution_portable; diff --git a/thrust/thrust/system/cuda/detail/adjacent_difference.h b/thrust/thrust/system/cuda/detail/adjacent_difference.h index ed157e85b92..8c897665296 100644 --- a/thrust/thrust/system/cuda/detail/adjacent_difference.h +++ b/thrust/thrust/system/cuda/detail/adjacent_difference.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/assign_value.h b/thrust/thrust/system/cuda/detail/assign_value.h index 2d1a06367c0..1ef45d441c0 100644 --- a/thrust/thrust/system/cuda/detail/assign_value.h +++ b/thrust/thrust/system/cuda/detail/assign_value.h @@ -26,7 +26,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/async/copy.h b/thrust/thrust/system/cuda/detail/async/copy.h index bf1958792b1..dbec4f6ca1f 100644 --- a/thrust/thrust/system/cuda/detail/async/copy.h +++ b/thrust/thrust/system/cuda/detail/async/copy.h @@ -42,7 +42,7 @@ #if _CCCL_STD_VER >= 2014 -# if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# ifdef _CCCL_CUDA_COMPILER # include @@ -357,6 +357,6 @@ auto async_copy(thrust::cuda::execution_policy& from_exec, THRUST_NAMESPACE_END -# endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# endif // _CCCL_CUDA_COMPILER #endif diff --git a/thrust/thrust/system/cuda/detail/async/customization.h b/thrust/thrust/system/cuda/detail/async/customization.h index 1c766f133e1..580bd051c63 100644 --- a/thrust/thrust/system/cuda/detail/async/customization.h +++ b/thrust/thrust/system/cuda/detail/async/customization.h @@ -42,7 +42,7 @@ #if _CCCL_STD_VER >= 2014 -# if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# ifdef _CCCL_CUDA_COMPILER # include @@ -106,6 +106,6 @@ auto get_async_universal_host_pinned_allocator(thrust::detail::execution_policy_ THRUST_NAMESPACE_END -# endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# endif // _CCCL_CUDA_COMPILER #endif diff --git a/thrust/thrust/system/cuda/detail/async/exclusive_scan.h b/thrust/thrust/system/cuda/detail/async/exclusive_scan.h index eecd39be29c..9f27cba0dad 100644 --- a/thrust/thrust/system/cuda/detail/async/exclusive_scan.h +++ b/thrust/thrust/system/cuda/detail/async/exclusive_scan.h @@ -40,7 +40,7 @@ #if _CCCL_STD_VER >= 2014 -# if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# ifdef _CCCL_CUDA_COMPILER # include @@ -161,6 +161,6 @@ auto async_exclusive_scan( THRUST_NAMESPACE_END -# endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# endif // _CCCL_CUDA_COMPILER #endif // C++14 diff --git a/thrust/thrust/system/cuda/detail/async/for_each.h b/thrust/thrust/system/cuda/detail/async/for_each.h index b0fb05a90c4..11ddcb1c4b1 100644 --- a/thrust/thrust/system/cuda/detail/async/for_each.h +++ b/thrust/thrust/system/cuda/detail/async/for_each.h @@ -43,7 +43,7 @@ #if _CCCL_STD_VER >= 2014 -# if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# ifdef _CCCL_CUDA_COMPILER # include @@ -129,6 +129,6 @@ auto async_for_each(execution_policy& policy, ForwardIt first, Se THRUST_NAMESPACE_END -# endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# endif // _CCCL_CUDA_COMPILER #endif diff --git a/thrust/thrust/system/cuda/detail/async/inclusive_scan.h b/thrust/thrust/system/cuda/detail/async/inclusive_scan.h index 6388c59fab5..dbcc358cba4 100644 --- a/thrust/thrust/system/cuda/detail/async/inclusive_scan.h +++ b/thrust/thrust/system/cuda/detail/async/inclusive_scan.h @@ -40,7 +40,7 @@ #if _CCCL_STD_VER >= 2014 -# if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# ifdef _CCCL_CUDA_COMPILER # include @@ -144,6 +144,6 @@ auto async_inclusive_scan( THRUST_NAMESPACE_END -# endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# endif // _CCCL_CUDA_COMPILER #endif // C++14 diff --git a/thrust/thrust/system/cuda/detail/async/reduce.h b/thrust/thrust/system/cuda/detail/async/reduce.h index 066e1b65781..8494002ecf5 100644 --- a/thrust/thrust/system/cuda/detail/async/reduce.h +++ b/thrust/thrust/system/cuda/detail/async/reduce.h @@ -44,7 +44,7 @@ #if _CCCL_STD_VER >= 2014 -# if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# ifdef _CCCL_CUDA_COMPILER # include @@ -228,6 +228,6 @@ auto async_reduce_into( THRUST_NAMESPACE_END -# endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# endif // _CCCL_CUDA_COMPILER #endif diff --git a/thrust/thrust/system/cuda/detail/async/sort.h b/thrust/thrust/system/cuda/detail/async/sort.h index 96fdb179b9d..9f5032269d6 100644 --- a/thrust/thrust/system/cuda/detail/async/sort.h +++ b/thrust/thrust/system/cuda/detail/async/sort.h @@ -42,7 +42,7 @@ #if _CCCL_STD_VER >= 2014 -# if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# ifdef _CCCL_CUDA_COMPILER # include @@ -321,6 +321,6 @@ auto async_stable_sort(execution_policy& policy, ForwardIt first, THRUST_NAMESPACE_END -# endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# endif // _CCCL_CUDA_COMPILER #endif diff --git a/thrust/thrust/system/cuda/detail/async/transform.h b/thrust/thrust/system/cuda/detail/async/transform.h index d754081a2da..99050daa995 100644 --- a/thrust/thrust/system/cuda/detail/async/transform.h +++ b/thrust/thrust/system/cuda/detail/async/transform.h @@ -42,7 +42,7 @@ #if _CCCL_STD_VER >= 2014 -# if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# ifdef _CCCL_CUDA_COMPILER # include @@ -134,6 +134,6 @@ auto async_transform( THRUST_NAMESPACE_END -# endif // THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +# endif // _CCCL_CUDA_COMPILER #endif diff --git a/thrust/thrust/system/cuda/detail/copy.h b/thrust/thrust/system/cuda/detail/copy.h index 57b2e2ba155..bd9e3ade362 100644 --- a/thrust/thrust/system/cuda/detail/copy.h +++ b/thrust/thrust/system/cuda/detail/copy.h @@ -84,7 +84,7 @@ THRUST_NAMESPACE_BEGIN namespace cuda_cub { -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER // D->D copy requires NVCC compiler _CCCL_EXEC_CHECK_DISABLE diff --git a/thrust/thrust/system/cuda/detail/copy_if.h b/thrust/thrust/system/cuda/detail/copy_if.h index 076186eb4e6..19dd014f59a 100644 --- a/thrust/thrust/system/cuda/detail/copy_if.h +++ b/thrust/thrust/system/cuda/detail/copy_if.h @@ -35,8 +35,7 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header - -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/core/agent_launcher.h b/thrust/thrust/system/cuda/detail/core/agent_launcher.h index 6d8fe048bd8..a3ecde6b345 100644 --- a/thrust/thrust/system/cuda/detail/core/agent_launcher.h +++ b/thrust/thrust/system/cuda/detail/core/agent_launcher.h @@ -38,7 +38,7 @@ #include -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/count.h b/thrust/thrust/system/cuda/detail/count.h index 965da9b608a..c93adb81c5e 100644 --- a/thrust/thrust/system/cuda/detail/count.h +++ b/thrust/thrust/system/cuda/detail/count.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/equal.h b/thrust/thrust/system/cuda/detail/equal.h index bead6deac5d..b16b7d695b6 100644 --- a/thrust/thrust/system/cuda/detail/equal.h +++ b/thrust/thrust/system/cuda/detail/equal.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/extrema.h b/thrust/thrust/system/cuda/detail/extrema.h index 1829aa6580f..c987b4800c0 100644 --- a/thrust/thrust/system/cuda/detail/extrema.h +++ b/thrust/thrust/system/cuda/detail/extrema.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/fill.h b/thrust/thrust/system/cuda/detail/fill.h index 558164f16cb..478626e4515 100644 --- a/thrust/thrust/system/cuda/detail/fill.h +++ b/thrust/thrust/system/cuda/detail/fill.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include # include diff --git a/thrust/thrust/system/cuda/detail/find.h b/thrust/thrust/system/cuda/detail/find.h index c6bfc524e0b..e492142663d 100644 --- a/thrust/thrust/system/cuda/detail/find.h +++ b/thrust/thrust/system/cuda/detail/find.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/for_each.h b/thrust/thrust/system/cuda/detail/for_each.h index e7dcd59961a..e14c7e27990 100644 --- a/thrust/thrust/system/cuda/detail/for_each.h +++ b/thrust/thrust/system/cuda/detail/for_each.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/gather.h b/thrust/thrust/system/cuda/detail/gather.h index 5712aad61e5..358246749ee 100644 --- a/thrust/thrust/system/cuda/detail/gather.h +++ b/thrust/thrust/system/cuda/detail/gather.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/generate.h b/thrust/thrust/system/cuda/detail/generate.h index 22a43fa7085..cb11d5f91dc 100644 --- a/thrust/thrust/system/cuda/detail/generate.h +++ b/thrust/thrust/system/cuda/detail/generate.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/get_value.h b/thrust/thrust/system/cuda/detail/get_value.h index 557159fa7e1..5178126b226 100644 --- a/thrust/thrust/system/cuda/detail/get_value.h +++ b/thrust/thrust/system/cuda/detail/get_value.h @@ -26,7 +26,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/inner_product.h b/thrust/thrust/system/cuda/detail/inner_product.h index 4b5c1a18aee..186aa21876f 100644 --- a/thrust/thrust/system/cuda/detail/inner_product.h +++ b/thrust/thrust/system/cuda/detail/inner_product.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include # include diff --git a/thrust/thrust/system/cuda/detail/internal/copy_cross_system.h b/thrust/thrust/system/cuda/detail/internal/copy_cross_system.h index 0a9aa2cd7c6..9239a3ea834 100644 --- a/thrust/thrust/system/cuda/detail/internal/copy_cross_system.h +++ b/thrust/thrust/system/cuda/detail/internal/copy_cross_system.h @@ -137,7 +137,7 @@ OutputIt _CCCL_HOST cross_system_copy_n( return ret; } -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER // non-trivial copy D->H, only supported with NVCC compiler // because copy ctor must have __device__ annotations, which is nvcc-only // feature diff --git a/thrust/thrust/system/cuda/detail/internal/copy_device_to_device.h b/thrust/thrust/system/cuda/detail/internal/copy_device_to_device.h index 6ca77833bbd..3f4f148f5d4 100644 --- a/thrust/thrust/system/cuda/detail/internal/copy_device_to_device.h +++ b/thrust/thrust/system/cuda/detail/internal/copy_device_to_device.h @@ -37,7 +37,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/iter_swap.h b/thrust/thrust/system/cuda/detail/iter_swap.h index a63702a3d03..2aee2a31f87 100644 --- a/thrust/thrust/system/cuda/detail/iter_swap.h +++ b/thrust/thrust/system/cuda/detail/iter_swap.h @@ -26,7 +26,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/merge.h b/thrust/thrust/system/cuda/detail/merge.h index c08fc94fffe..a9084c92491 100644 --- a/thrust/thrust/system/cuda/detail/merge.h +++ b/thrust/thrust/system/cuda/detail/merge.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/mismatch.h b/thrust/thrust/system/cuda/detail/mismatch.h index 5be4af07af7..c7f6afe62b7 100644 --- a/thrust/thrust/system/cuda/detail/mismatch.h +++ b/thrust/thrust/system/cuda/detail/mismatch.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/parallel_for.h b/thrust/thrust/system/cuda/detail/parallel_for.h index 96f0735cc12..213fb4096d7 100644 --- a/thrust/thrust/system/cuda/detail/parallel_for.h +++ b/thrust/thrust/system/cuda/detail/parallel_for.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/partition.h b/thrust/thrust/system/cuda/detail/partition.h index 20b0fcad84a..32aa29366f1 100644 --- a/thrust/thrust/system/cuda/detail/partition.h +++ b/thrust/thrust/system/cuda/detail/partition.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/per_device_resource.h b/thrust/thrust/system/cuda/detail/per_device_resource.h index 0bb09091280..95ee7bcc54f 100644 --- a/thrust/thrust/system/cuda/detail/per_device_resource.h +++ b/thrust/thrust/system/cuda/detail/per_device_resource.h @@ -37,7 +37,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/reduce.h b/thrust/thrust/system/cuda/detail/reduce.h index 766b8de4511..e66c90883ce 100644 --- a/thrust/thrust/system/cuda/detail/reduce.h +++ b/thrust/thrust/system/cuda/detail/reduce.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/reduce_by_key.h b/thrust/thrust/system/cuda/detail/reduce_by_key.h index d5ec566e8d3..526ae8b7dc9 100644 --- a/thrust/thrust/system/cuda/detail/reduce_by_key.h +++ b/thrust/thrust/system/cuda/detail/reduce_by_key.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/remove.h b/thrust/thrust/system/cuda/detail/remove.h index 567fd373ae4..0c1a67592c3 100644 --- a/thrust/thrust/system/cuda/detail/remove.h +++ b/thrust/thrust/system/cuda/detail/remove.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include THRUST_NAMESPACE_BEGIN diff --git a/thrust/thrust/system/cuda/detail/replace.h b/thrust/thrust/system/cuda/detail/replace.h index 70385f7003c..717d92ef8c8 100644 --- a/thrust/thrust/system/cuda/detail/replace.h +++ b/thrust/thrust/system/cuda/detail/replace.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/reverse.h b/thrust/thrust/system/cuda/detail/reverse.h index cbad90e5ae3..f9b3fabd72e 100644 --- a/thrust/thrust/system/cuda/detail/reverse.h +++ b/thrust/thrust/system/cuda/detail/reverse.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include THRUST_NAMESPACE_BEGIN diff --git a/thrust/thrust/system/cuda/detail/scan.h b/thrust/thrust/system/cuda/detail/scan.h index e9405776db7..1af507d1884 100644 --- a/thrust/thrust/system/cuda/detail/scan.h +++ b/thrust/thrust/system/cuda/detail/scan.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/scan_by_key.h b/thrust/thrust/system/cuda/detail/scan_by_key.h index a81b3e26c97..6c64d223a98 100644 --- a/thrust/thrust/system/cuda/detail/scan_by_key.h +++ b/thrust/thrust/system/cuda/detail/scan_by_key.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/scatter.h b/thrust/thrust/system/cuda/detail/scatter.h index 03cf04b6624..07d9439c472 100644 --- a/thrust/thrust/system/cuda/detail/scatter.h +++ b/thrust/thrust/system/cuda/detail/scatter.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/set_operations.h b/thrust/thrust/system/cuda/detail/set_operations.h index 49fc3f9b507..63cd8b6fcb8 100644 --- a/thrust/thrust/system/cuda/detail/set_operations.h +++ b/thrust/thrust/system/cuda/detail/set_operations.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/sort.h b/thrust/thrust/system/cuda/detail/sort.h index 75f2d158216..02168dd4e9d 100644 --- a/thrust/thrust/system/cuda/detail/sort.h +++ b/thrust/thrust/system/cuda/detail/sort.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/swap_ranges.h b/thrust/thrust/system/cuda/detail/swap_ranges.h index 480825c963b..e1d642574c0 100644 --- a/thrust/thrust/system/cuda/detail/swap_ranges.h +++ b/thrust/thrust/system/cuda/detail/swap_ranges.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include # include diff --git a/thrust/thrust/system/cuda/detail/tabulate.h b/thrust/thrust/system/cuda/detail/tabulate.h index e589e7239f4..94817f696ab 100644 --- a/thrust/thrust/system/cuda/detail/tabulate.h +++ b/thrust/thrust/system/cuda/detail/tabulate.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/transform.h b/thrust/thrust/system/cuda/detail/transform.h index 0514a7aa9ea..9e1d0b2a318 100644 --- a/thrust/thrust/system/cuda/detail/transform.h +++ b/thrust/thrust/system/cuda/detail/transform.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/transform_reduce.h b/thrust/thrust/system/cuda/detail/transform_reduce.h index fd2b3eb1e1b..248423cac2a 100644 --- a/thrust/thrust/system/cuda/detail/transform_reduce.h +++ b/thrust/thrust/system/cuda/detail/transform_reduce.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include diff --git a/thrust/thrust/system/cuda/detail/transform_scan.h b/thrust/thrust/system/cuda/detail/transform_scan.h index bd0e4315dd8..e777c82fe1d 100644 --- a/thrust/thrust/system/cuda/detail/transform_scan.h +++ b/thrust/thrust/system/cuda/detail/transform_scan.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include # include diff --git a/thrust/thrust/system/cuda/detail/uninitialized_copy.h b/thrust/thrust/system/cuda/detail/uninitialized_copy.h index b6a3416f541..48dc8914779 100644 --- a/thrust/thrust/system/cuda/detail/uninitialized_copy.h +++ b/thrust/thrust/system/cuda/detail/uninitialized_copy.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include # include diff --git a/thrust/thrust/system/cuda/detail/uninitialized_fill.h b/thrust/thrust/system/cuda/detail/uninitialized_fill.h index 7048dbe7acf..a3efdda843b 100644 --- a/thrust/thrust/system/cuda/detail/uninitialized_fill.h +++ b/thrust/thrust/system/cuda/detail/uninitialized_fill.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include # include # include diff --git a/thrust/thrust/system/cuda/detail/unique.h b/thrust/thrust/system/cuda/detail/unique.h index 376a956ba47..1cf58247d36 100644 --- a/thrust/thrust/system/cuda/detail/unique.h +++ b/thrust/thrust/system/cuda/detail/unique.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include diff --git a/thrust/thrust/system/cuda/detail/unique_by_key.h b/thrust/thrust/system/cuda/detail/unique_by_key.h index 13de762cd44..60df7bd8fa4 100644 --- a/thrust/thrust/system/cuda/detail/unique_by_key.h +++ b/thrust/thrust/system/cuda/detail/unique_by_key.h @@ -36,7 +36,7 @@ # pragma system_header #endif // no system header -#if THRUST_DEVICE_COMPILER == THRUST_DEVICE_COMPILER_NVCC +#ifdef _CCCL_CUDA_COMPILER # include