From 6e6cf8dbfbca479f38baeb43d4c96fd65155e411 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Wed, 15 Jan 2025 10:54:19 +0100 Subject: [PATCH] NVRTC fixes --- thrust/thrust/detail/alignment.h | 7 +++--- thrust/thrust/detail/type_deduction.h | 22 +++++++++---------- .../thrust/iterator/detail/any_system_tag.h | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/thrust/thrust/detail/alignment.h b/thrust/thrust/detail/alignment.h index 9a43eeec226..56e10edd215 100644 --- a/thrust/thrust/detail/alignment.h +++ b/thrust/thrust/detail/alignment.h @@ -30,10 +30,9 @@ #endif // no system header #include +#include #include -#include // For `std::size_t` and `std::max_align_t`. - THRUST_NAMESPACE_BEGIN namespace detail { @@ -49,7 +48,7 @@ using alignment_of = ::cuda::std::alignment_of; /// type whose alignment requirement is a divisor of `Align`. /// /// The behavior is undefined if `Align` is not a power of 2. -template +template <::cuda::std::size_t Align> struct aligned_type { struct alignas(Align) type @@ -74,7 +73,7 @@ _CCCL_HOST_DEVICE T aligned_reinterpret_cast(U u) return reinterpret_cast(reinterpret_cast(u)); } -_CCCL_HOST_DEVICE inline std::size_t aligned_storage_size(std::size_t n, std::size_t align) +_CCCL_HOST_DEVICE inline ::cuda::std::size_t aligned_storage_size(::cuda::std::size_t n, ::cuda::std::size_t align) { return ::cuda::ceil_div(n, align) * align; } diff --git a/thrust/thrust/detail/type_deduction.h b/thrust/thrust/detail/type_deduction.h index a1d41de9676..a28e724cb76 100644 --- a/thrust/thrust/detail/type_deduction.h +++ b/thrust/thrust/detail/type_deduction.h @@ -18,20 +18,20 @@ #endif // no system header #include -#include -#include +#include +#include /////////////////////////////////////////////////////////////////////////////// /// \def THRUST_FWD(x) /// \brief Performs universal forwarding of a universal reference. /// -#define THRUST_FWD(x) ::std::forward(x) +#define THRUST_FWD(x) ::cuda::std::forward(x) /// \def THRUST_MVCAP(x) /// \brief Capture `x` into a lambda by moving. /// -#define THRUST_MVCAP(x) x = ::std::move(x) +#define THRUST_MVCAP(x) x = ::cuda::std::move(x) /// \def THRUST_RETOF(invocable, ...) /// \brief Expands to the type returned by invoking an instance of the invocable @@ -39,8 +39,8 @@ /// be called with 1 or fewer parameters to the invocable. /// #define THRUST_RETOF(...) THRUST_PP_DISPATCH(THRUST_RETOF, __VA_ARGS__) -#define THRUST_RETOF1(C) decltype(::std::declval()()) -#define THRUST_RETOF2(C, V) decltype(::std::declval()(::std::declval())) +#define THRUST_RETOF1(C) decltype(::cuda::std::declval()()) +#define THRUST_RETOF2(C, V) decltype(::cuda::std::declval()(::cuda::std::declval())) /// \def THRUST_RETURNS(...) /// \brief Expands to a function definition that returns the expression @@ -88,11 +88,11 @@ } \ /**/ #else -# define THRUST_DECLTYPE_RETURNS_WITH_SFINAE_CONDITION(condition, ...) \ - noexcept(noexcept(__VA_ARGS__))->typename std::enable_if::type \ - { \ - return (__VA_ARGS__); \ - } \ +# define THRUST_DECLTYPE_RETURNS_WITH_SFINAE_CONDITION(condition, ...) \ + noexcept(noexcept(__VA_ARGS__))->::cuda::std::enable_if_t \ + { \ + return (__VA_ARGS__); \ + } \ /**/ #endif diff --git a/thrust/thrust/iterator/detail/any_system_tag.h b/thrust/thrust/iterator/detail/any_system_tag.h index 7b3172bfef5..9aa9827e40c 100644 --- a/thrust/thrust/iterator/detail/any_system_tag.h +++ b/thrust/thrust/iterator/detail/any_system_tag.h @@ -34,7 +34,7 @@ struct any_system_tag : thrust::execution_policy // allow any_system_tag to convert to any type at all // XXX make this safer using enable_if> upon c++11 template - operator T() const + _CCCL_HOST_DEVICE operator T() const { return T(); }