diff --git a/thrust/testing/unittest/testframework.h b/thrust/testing/unittest/testframework.h index cd5799e0ca..9739d602e9 100644 --- a/thrust/testing/unittest/testframework.h +++ b/thrust/testing/unittest/testframework.h @@ -9,8 +9,11 @@ #include #include +#include + #include #include +#include #include #include #include @@ -199,22 +202,28 @@ class custom_numeric } }; -THRUST_NAMESPACE_BEGIN +namespace std +{ +template <> +struct numeric_limits : numeric_limits +{}; +} // namespace std +_LIBCUDACXX_BEGIN_NAMESPACE_STD template <> struct numeric_limits : numeric_limits {}; +_LIBCUDACXX_END_NAMESPACE_STD +THRUST_NAMESPACE_BEGIN namespace detail { - // For random number generation template <> class integer_traits : public integer_traits_base {}; } // namespace detail - THRUST_NAMESPACE_END using NumericTypes = unittest::type_list< diff --git a/thrust/testing/unittest/util.h b/thrust/testing/unittest/util.h index 39c4ea962e..7618d02643 100644 --- a/thrust/testing/unittest/util.h +++ b/thrust/testing/unittest/util.h @@ -26,7 +26,7 @@ typename THRUST_NS_QUALIFIER::detail::disable_if<::cuda::std::is_floating_point< truncate_to_max_representable(std::size_t n) { return static_cast( - THRUST_NS_QUALIFIER::min(n, static_cast(THRUST_NS_QUALIFIER::numeric_limits::max()))); + THRUST_NS_QUALIFIER::min(n, static_cast(::cuda::std::numeric_limits::max()))); } // TODO: This probably won't work for `half`. @@ -34,7 +34,7 @@ template typename ::cuda::std::enable_if_t<::cuda::std::is_floating_point::value, T> truncate_to_max_representable(std::size_t n) { - return THRUST_NS_QUALIFIER::min(static_cast(n), THRUST_NS_QUALIFIER::numeric_limits::max()); + return THRUST_NS_QUALIFIER::min(static_cast(n), ::cuda::std::numeric_limits::max()); } } // namespace unittest diff --git a/thrust/thrust/limits.h b/thrust/thrust/limits.h index b6ea9c0bdf..54cad7fd1c 100644 --- a/thrust/thrust/limits.h +++ b/thrust/thrust/limits.h @@ -24,7 +24,7 @@ THRUST_NAMESPACE_BEGIN template -struct numeric_limits : std::numeric_limits +struct CCCL_DEPRECATED_BECAUSE("Use cuda::std::numeric_limits") numeric_limits : std::numeric_limits {}; THRUST_NAMESPACE_END