1414#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
1515# pragma system_header
1616#endif // no system header
17- #include < thrust/detail/allocator/allocator_traits.h>
1817#include < thrust/detail/memory_algorithms.h>
1918#include < thrust/detail/raw_pointer_cast.h>
2019#include < thrust/detail/type_deduction.h>
2120
2221#include < cuda/std/__cccl/memory_wrapper.h>
22+ #include < cuda/std/__memory/allocator_traits.h>
2323#include < cuda/std/__type_traits/remove_cvref.h>
2424#include < cuda/std/__utility/move.h>
2525#include < cuda/std/__utility/swap.h>
@@ -35,7 +35,7 @@ struct allocator_delete final
3535{
3636 using allocator_type =
3737 typename std::remove_cv<typename std::remove_reference<Allocator>::type>::type::template rebind<T>::other;
38- using pointer = typename detail ::allocator_traits<allocator_type>::pointer;
38+ using pointer = typename ::cuda::std ::allocator_traits<allocator_type>::pointer;
3939
4040 template <typename UAllocator>
4141 allocator_delete (UAllocator&& other) noexcept
@@ -66,7 +66,7 @@ struct allocator_delete final
6666
6767 void operator ()(pointer p)
6868 {
69- using traits = detail ::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>;
69+ using traits = ::cuda::std ::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>;
7070 typename traits::allocator_type alloc_T (alloc_);
7171
7272 if (nullptr != detail::pointer_traits<pointer>::get (p))
@@ -106,7 +106,7 @@ struct array_allocator_delete final
106106{
107107 using allocator_type =
108108 typename std::remove_cv<typename std::remove_reference<Allocator>::type>::type::template rebind<T>::other;
109- using pointer = typename detail ::allocator_traits<allocator_type>::pointer;
109+ using pointer = typename ::cuda::std ::allocator_traits<allocator_type>::pointer;
110110
111111 template <typename UAllocator>
112112 array_allocator_delete (UAllocator&& other, std::size_t n) noexcept
@@ -142,7 +142,7 @@ struct array_allocator_delete final
142142
143143 void operator ()(pointer p)
144144 {
145- using traits = detail ::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>;
145+ using traits = ::cuda::std ::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>;
146146 typename traits::allocator_type alloc_T (get_allocator ());
147147 if (nullptr != detail::pointer_traits<pointer>::get (p))
148148 {
@@ -204,11 +204,12 @@ template <typename T, typename Allocator, typename... Args>
204204_CCCL_HOST
205205std::unique_ptr<T,
206206 allocator_delete<T,
207- typename detail ::allocator_traits<
207+ typename ::cuda::std ::allocator_traits<
208208 ::cuda::std::remove_cvref_t <Allocator>>::template rebind_traits<T>::allocator_type>>
209209allocate_unique (Allocator const & alloc, Args&&... args)
210210{
211- using traits = typename detail::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>::template rebind_traits<T>;
211+ using traits =
212+ typename ::cuda::std::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>::template rebind_traits<T>;
212213
213214 typename traits::allocator_type alloc_T (alloc);
214215
@@ -228,12 +229,13 @@ allocate_unique(Allocator const& alloc, Args&&... args)
228229template <typename T, typename Allocator>
229230_CCCL_HOST std::unique_ptr<
230231 T,
231- uninitialized_allocator_delete<
232- T,
233- typename detail::allocator_traits< ::cuda::std::remove_cvref_t <Allocator>>::template rebind_traits<T>::allocator_type>>
232+ uninitialized_allocator_delete<T,
233+ typename ::cuda::std::allocator_traits<
234+ ::cuda::std::remove_cvref_t <Allocator>>::template rebind_traits<T>::allocator_type>>
234235uninitialized_allocate_unique (Allocator const & alloc)
235236{
236- using traits = typename detail::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>::template rebind_traits<T>;
237+ using traits =
238+ typename ::cuda::std::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>::template rebind_traits<T>;
237239
238240 typename traits::allocator_type alloc_T (alloc);
239241
@@ -253,11 +255,12 @@ template <typename T, typename Allocator, typename Size, typename... Args>
253255_CCCL_HOST std::unique_ptr<
254256 T[],
255257 array_allocator_delete<T,
256- typename detail ::allocator_traits<typename std::remove_cv<typename std::remove_reference<
258+ typename ::cuda::std ::allocator_traits<typename std::remove_cv<typename std::remove_reference<
257259 Allocator>::type>::type>::template rebind_traits<T>::allocator_type>>
258260allocate_unique_n (Allocator const & alloc, Size n, Args&&... args)
259261{
260- using traits = typename detail::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>::template rebind_traits<T>;
262+ using traits =
263+ typename ::cuda::std::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>::template rebind_traits<T>;
261264
262265 typename traits::allocator_type alloc_T (alloc);
263266
@@ -275,14 +278,15 @@ allocate_unique_n(Allocator const& alloc, Size n, Args&&... args)
275278// ! Creates a \p std::unique_ptr holding storage for an array of objects of type \p T without constructing them, using
276279// ! \p alloc as the allocator.
277280template <typename T, typename Allocator, typename Size>
278- _CCCL_HOST std::unique_ptr<
279- T[],
280- uninitialized_array_allocator_delete<
281- T,
282- typename detail::allocator_traits<::cuda::std:: remove_cvref_t < Allocator>>::template rebind_traits<T>::allocator_type>>
281+ _CCCL_HOST
282+ std::unique_ptr< T[],
283+ uninitialized_array_allocator_delete<T,
284+ typename ::cuda::std::allocator_traits<::cuda::std:: remove_cvref_t <
285+ Allocator>>::template rebind_traits<T>::allocator_type>>
283286uninitialized_allocate_unique_n (Allocator const & alloc, Size n)
284287{
285- using traits = typename detail::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>::template rebind_traits<T>;
288+ using traits =
289+ typename ::cuda::std::allocator_traits<::cuda::std::remove_cvref_t <Allocator>>::template rebind_traits<T>;
286290
287291 typename traits::allocator_type alloc_T (alloc);
288292
0 commit comments