From 291c8f19f200352ea9340081660846c52f61a79e Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 14:23:17 -0400 Subject: [PATCH 01/48] feat(rocthrust): track CCCL 1c3c7ddee12 + 8ca3dc31e90 in system/hip find/mismatch Upstream: https://github.com/NVIDIA/cccl/commit/1c3c7ddee12 (NVIDIA/cccl#6019) Upstream: https://github.com/NVIDIA/cccl/commit/8ca3dc31e9075e038d2ade5c2b90f79155e8ccca (NVIDIA/cccl#6018) HIP previously took no change for these (performance-only). Bring system/hip closer to upstream: - find.h: find_if_n unwraps contiguous iterators and builds the zip/counting iterator with auto + variadic thrust::make_zip_iterator. transform_input_iterator_t now calls op(*input) directly instead of materializing the value_type (same semantics as ::cuda::transform_iterator; avoids NVIDIA/cccl#3591); prefix operator++ returns self_t&. The dedicated iterator is kept because thrust::transform_iterator still converts to the value_type and ::cuda::transform_iterator needs libhipcxx. - mismatch.h: drop transform_pair_of_input_iterators_t and enable the zip_iterator + zip_function implementation (thrust:: versions, so it also works without libhipcxx). Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../rocthrust/thrust/system/hip/detail/find.h | 32 ++-- .../thrust/system/hip/detail/mismatch.h | 141 +----------------- 2 files changed, 18 insertions(+), 155 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/find.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/find.h index 376aa5cac3c3..2364f6802ebb 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/find.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/find.h @@ -44,6 +44,7 @@ # include # include # include +# include # if !_THRUST_HAS_DEVICE_SYSTEM_STD # include @@ -134,22 +135,23 @@ struct transform_input_iterator_t return retval; } - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t operator++() + THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t& operator++() { ++input; return *this; } + // Pass the dereferenced value straight to op (like ::cuda::transform_iterator) instead of materializing the + // value_type first, so value types need not be constructible on the device. See: + // https://github.com/NVIDIA/cccl/issues/3591 THRUST_HOST_DEVICE THRUST_FORCEINLINE reference operator*() const { - thrust::detail::it_value_t x = *input; - return op(x); + return op(*input); } THRUST_HOST_DEVICE THRUST_FORCEINLINE reference operator*() { - thrust::detail::it_value_t x = *input; - return op(x); + return op(*input); } THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t operator+(difference_type n) const @@ -218,21 +220,17 @@ find_if_n(execution_policy& policy, InputIt first, Size num_items, Pred const Size interval_threshold = 1 << 20; const Size interval_size = (_THRUST_STD::min)(interval_threshold, num_items); - // FIXME(bgruber): we should also be able to use transform_iterator here, but it makes nvc++ hang. See: - // https://github.com/NVIDIA/cccl/issues/3594. The problem does not occur with nvcc, so we could not add a test :/ - using XfrmIterator = __find_if::transform_input_iterator_t; - // using XfrmIterator = transform_iterator; - using IteratorTuple = thrust::tuple>; - using ZipIterator = thrust::zip_iterator; + // Upstream uses ::cuda::make_transform_iterator here. thrust::transform_iterator converts to the value_type before + // calling the functor (https://github.com/NVIDIA/cccl/issues/3591), so keep a dedicated iterator that does not. + auto unwrapped_first = thrust::try_unwrap_contiguous_iterator(first); + using XfrmIterator = __find_if::transform_input_iterator_t; - IteratorTuple iter_tuple = thrust::make_tuple(XfrmIterator(first, predicate), counting_iterator(0)); + const auto begin = thrust::make_zip_iterator(XfrmIterator(unwrapped_first, predicate), counting_iterator(0)); + const auto end = begin + num_items; - ZipIterator begin = thrust::make_zip_iterator(iter_tuple); - ZipIterator end = begin + num_items; - - for (ZipIterator interval_begin = begin; interval_begin < end; interval_begin += interval_size) + for (auto interval_begin = begin; interval_begin < end; interval_begin += interval_size) { - ZipIterator interval_end = interval_begin + interval_size; + auto interval_end = interval_begin + interval_size; if (end < interval_end) { interval_end = end; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h index 09def089f62b..5311541c1902 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h @@ -64,151 +64,16 @@ THRUST_NAMESPACE_END THRUST_NAMESPACE_BEGIN namespace hip_rocprim { -namespace detail -{ -template -struct transform_pair_of_input_iterators_t -{ - using self_t = transform_pair_of_input_iterators_t; - using difference_type = thrust::detail::it_difference_t; - using value_type = ValueType; - using pointer = void; - using reference = value_type; - using iterator_category = std::random_access_iterator_tag; - - InputIt1 input1; - InputIt2 input2; - mutable BinaryOp op; - - transform_pair_of_input_iterators_t() = default; - - THRUST_HOST_DEVICE THRUST_FORCEINLINE - transform_pair_of_input_iterators_t(InputIt1 input1_, InputIt2 input2_, BinaryOp op_) - : input1(input1_) - , input2(input2_) - , op(op_) - {} - - transform_pair_of_input_iterators_t(const self_t&) = default; - - // BinaryOp might not be copy assignable, such as when it is a lambda. - // Define an explicit copy assignment operator that doesn't try to assign it. - THRUST_HOST_DEVICE self_t& operator=(const self_t& o) - { - input1 = o.input1; - input2 = o.input2; - return *this; - } - - /// Postfix increment - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t operator++(int) - { - self_t retval = *this; - ++input1; - ++input2; - return retval; - } - - /// Prefix increment - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t& operator++() - { - ++input1; - ++input2; - return *this; - } - - /// Indirection - THRUST_HOST_DEVICE THRUST_FORCEINLINE reference operator*() const - { - return op(*input1, *input2); - } - /// Indirection - THRUST_HOST_DEVICE THRUST_FORCEINLINE reference operator*() - { - return op(*input1, *input2); - } - - /// Addition - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t operator+(difference_type n) const - { - return self_t(input1 + n, input2 + n, op); - } - - /// Addition assignment - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t& operator+=(difference_type n) - { - input1 += n; - input2 += n; - return *this; - } - - /// Subtraction - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t operator-(difference_type n) const - { - return self_t(input1 - n, input2 - n, op); - } - - /// Subtraction assignment - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t& operator-=(difference_type n) - { - input1 -= n; - input2 -= n; - return *this; - } - - /// Distance - THRUST_HOST_DEVICE THRUST_FORCEINLINE difference_type operator-(self_t other) const - { - return input1 - other.input1; - } - - /// Array subscript - THRUST_HOST_DEVICE THRUST_FORCEINLINE reference operator[](difference_type n) const - { - return op(input1[n], input2[n]); - } - - /// Equal to - THRUST_HOST_DEVICE THRUST_FORCEINLINE bool operator==(const self_t& rhs) const - { - return (input1 == rhs.input1) && (input2 == rhs.input2); - } - - /// Not equal to - THRUST_HOST_DEVICE THRUST_FORCEINLINE bool operator!=(const self_t& rhs) const - { - return (input1 != rhs.input1) || (input2 != rhs.input2); - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE bool operator<(const self_t& rhs) const - { - return input1 < rhs.input1; - } -}; // struct transform_pair_of_input_iterators_t -} // namespace detail - template pair THRUST_HOST_DEVICE mismatch(execution_policy& policy, InputIt1 first1, InputIt1 last1, InputIt2 first2, BinaryPred binary_pred) { - const auto transform_first = - detail::transform_pair_of_input_iterators_t(first1, first2, binary_pred); - const auto result = hip_rocprim::find_if_not( - policy, transform_first, transform_first + _THRUST_STD::distance(first1, last1), _THRUST_STD::identity{}); - return thrust::make_pair(first1 + _THRUST_STD::distance(transform_first, result), - first2 + _THRUST_STD::distance(transform_first, result)); - - // FIXME(bgruber): the following code should be equivalent and not require a dedicated iterator. However, it - // additionally requires the value_type to constructible/destructible on the device, which should be fixed at some - // point. See also: https://github.com/NVIDIA/cccl/issues/3591 -# if 0 const auto n = _THRUST_STD::distance(first1, last1); - const auto first = make_zip_iterator(first1, first2); - const auto last = make_zip_iterator(last1, first2 + n); - const auto mismatch_pos = hip_rocprim::find_if_not(policy, first, last, make_zip_function(binary_pred)); + const auto first = thrust::make_zip_iterator(first1, first2); + const auto last = thrust::make_zip_iterator(last1, first2 + n); + const auto mismatch_pos = hip_rocprim::find_if_not(policy, first, last, thrust::make_zip_function(binary_pred)); const auto dist = _THRUST_STD::distance(first, mismatch_pos); return thrust::make_pair(first1 + dist, first2 + dist); -# endif } template From 6197cedfac64e0ea623b2cfb4d01c070da6c2e41 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 14:44:05 -0400 Subject: [PATCH 02/48] feat(rocthrust): complete CCCL 5303f65de2d - Dropped duplicated math function from Thrust (NVIDIA/cccl#6188) Upstream: https://github.com/NVIDIA/cccl/commit/5303f65de2d6d5a088e1a78defd0cd0c627e6c42 Completes the earlier partial port. libhipcxx is now mandatory (libcxx.h requires >= 3.4), so the compatibility reason for keeping thrust::detail integer helpers no longer applies: - delete thrust/detail/integer_math.h. - execute_with_allocator.h: divide_ri -> _THRUST_LIBCXX::ceil_div. - mr/{pool,disjoint_pool}.h: log2_ri -> _THRUST_LIBCXX::ceil_ilog2, is_power_of_2 -> _THRUST_LIBCXX::is_power_of_two. - mr/pool_options.h: validate() uses is_power_of_two with the upstream explicit != 0 checks. - system/cuda/detail/dispatch.h: take upstream (defines its own thrust::detail::is_negative). - system/hip/detail/dispatch.h: same is_negative, spelled with _THRUST_STD/THRUST_HOST_DEVICE; hip scan.h/sort.h drop the integer_math.h include. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../thrust/detail/execute_with_allocator.h | 7 +- .../rocthrust/thrust/detail/integer_math.h | 113 ------------------ .../rocthrust/thrust/mr/disjoint_pool.h | 18 +-- .../hipccl/hipccl3/rocthrust/thrust/mr/pool.h | 18 +-- .../rocthrust/thrust/mr/pool_options.h | 8 +- .../thrust/system/cuda/detail/dispatch.h | 23 +++- .../thrust/system/hip/detail/dispatch.h | 19 ++- .../rocthrust/thrust/system/hip/detail/scan.h | 1 - .../rocthrust/thrust/system/hip/detail/sort.h | 1 - 9 files changed, 68 insertions(+), 140 deletions(-) delete mode 100644 projects/hipccl/hipccl3/rocthrust/thrust/detail/integer_math.h diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h index 3d41533ae94d..4160c1a02881 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h @@ -28,11 +28,12 @@ #include #include -#include #include #include #include +#include _THRUST_LIBCXX_INCLUDE(__cmath/ceil_div.h) + #if !_THRUST_HAS_DEVICE_SYSTEM_STD # include #endif @@ -53,7 +54,7 @@ get_temporary_buffer(thrust::detail::execute_with_allocator(_THRUST_LIBCXX::ceil_div(sizeof(T) * n, sizeof(value_type))); void_pointer ptr = alloc_traits::allocate(system.get_allocator(), num_elements); @@ -72,7 +73,7 @@ THRUST_HOST void return_temporary_buffer( using value_type = typename alloc_traits::value_type; using T = typename thrust::detail::pointer_traits::element_type; - size_type num_elements = divide_ri(sizeof(T) * n, sizeof(value_type)); + size_type num_elements = _THRUST_LIBCXX::ceil_div(sizeof(T) * n, sizeof(value_type)); pointer to_ptr = thrust::reinterpret_pointer_cast(p); alloc_traits::deallocate(system.get_allocator(), to_ptr, num_elements); diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/integer_math.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/integer_math.h deleted file mode 100644 index 8e088f018e47..000000000000 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/integer_math.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2008-2013 NVIDIA Corporation - * Modifications Copyright© 2023-2026 Advanced Micro Devices, Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) -# pragma GCC system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) -# pragma clang system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) -# pragma system_header -#endif // no system header -#include - -#include _THRUST_STD_INCLUDE(bit) -#include _THRUST_STD_INCLUDE(__type_traits/make_unsigned.h) -#include _THRUST_STD_INCLUDE(limits) -#include _THRUST_STD_INCLUDE(type_traits) - -THRUST_NAMESPACE_BEGIN -namespace detail -{ - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE bool is_power_of_2(Integer x) -{ - return 0 == (x & (x - 1)); -} - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE typename std::enable_if::value, bool>::type is_negative(T x) -{ - return x < 0; -} - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE typename std::enable_if::value, bool>::type is_negative(T) -{ - return false; -} - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE bool is_odd(Integer x) -{ - return 1 & x; -} - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE Integer log2(Integer x) -{ - Integer num_bits = 8 * sizeof(Integer); - Integer num_bits_minus_one = num_bits - 1; - - return num_bits_minus_one - _THRUST_STD::countl_zero(::cuda::std::__to_unsigned_like(x)); -} - -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE Integer log2_ri(Integer x) -{ - Integer result = log2(x); - - // This is where we round up to the nearest log. - if (!is_power_of_2(x)) - { - ++result; - } - - return result; -} - -// x/y rounding towards +infinity for integers -// Used to determine # of blocks/warps etc. -template -THRUST_HOST_DEVICE THRUST_FORCEINLINE - // FIXME: Should use common_type. - auto - divide_ri(Integer0 const x, Integer1 const y) THRUST_DECLTYPE_RETURNS((x + (y - 1)) / y) - - // x/y rounding towards zero for integers. - // Used to determine # of blocks/warps etc. - template - THRUST_HOST_DEVICE THRUST_FORCEINLINE auto divide_rz(Integer0 const x, Integer1 const y) - THRUST_DECLTYPE_RETURNS(x / y) - - // Round x towards infinity to the next multiple of y. - template - THRUST_HOST_DEVICE THRUST_FORCEINLINE auto round_i(Integer0 const x, Integer1 const y) - THRUST_DECLTYPE_RETURNS(y* divide_ri(x, y)) - - // Round x towards 0 to the next multiple of y. - template - THRUST_HOST_DEVICE THRUST_FORCEINLINE auto round_z(Integer0 const x, Integer1 const y) - THRUST_DECLTYPE_RETURNS(y* divide_rz(x, y)) - -} // namespace detail - -THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/mr/disjoint_pool.h b/projects/hipccl/hipccl3/rocthrust/thrust/mr/disjoint_pool.h index e73537f803bd..f787cce50137 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/mr/disjoint_pool.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/mr/disjoint_pool.h @@ -42,6 +42,8 @@ #include #include +#include _THRUST_LIBCXX_INCLUDE(__cmath/ilog.h) +#include _THRUST_LIBCXX_INCLUDE(__cmath/pow2.h) #include _THRUST_STD_INCLUDE(__algorithm/max.h) #include _THRUST_STD_INCLUDE(__algorithm/min.h) #include _THRUST_STD_INCLUDE(cassert) @@ -122,7 +124,7 @@ class disjoint_unsynchronized_pool_resource final : m_upstream(upstream) , m_bookkeeper(bookkeeper) , m_options(options) - , m_smallest_block_log2(detail::log2_ri(m_options.smallest_block_size)) + , m_smallest_block_log2(_THRUST_LIBCXX::ceil_ilog2(m_options.smallest_block_size)) , m_pools(m_bookkeeper) , m_allocated(m_bookkeeper) , m_cached_oversized(m_bookkeeper) @@ -132,7 +134,7 @@ class disjoint_unsynchronized_pool_resource final pointer_vector free(m_bookkeeper); pool p(free); - m_pools.resize(detail::log2_ri(m_options.largest_block_size) - m_smallest_block_log2 + 1, p); + m_pools.resize(_THRUST_LIBCXX::ceil_ilog2(m_options.largest_block_size) - m_smallest_block_log2 + 1, p); } // TODO: C++11: use delegating constructors @@ -145,7 +147,7 @@ class disjoint_unsynchronized_pool_resource final : m_upstream(get_global_resource()) , m_bookkeeper(get_global_resource()) , m_options(options) - , m_smallest_block_log2(detail::log2_ri(m_options.smallest_block_size)) + , m_smallest_block_log2(_THRUST_LIBCXX::ceil_ilog2(m_options.smallest_block_size)) , m_pools(m_bookkeeper) , m_allocated(m_bookkeeper) , m_cached_oversized(m_bookkeeper) @@ -155,7 +157,7 @@ class disjoint_unsynchronized_pool_resource final pointer_vector free(m_bookkeeper); pool p(free); - m_pools.resize(detail::log2_ri(m_options.largest_block_size) - m_smallest_block_log2 + 1, p); + m_pools.resize(_THRUST_LIBCXX::ceil_ilog2(m_options.largest_block_size) - m_smallest_block_log2 + 1, p); } /*! Destructor. Releases all held memory to upstream. @@ -369,7 +371,7 @@ class disjoint_unsynchronized_pool_resource final [[nodiscard]] void_ptr do_allocate_impl(std::size_t bytes, std::size_t alignment) { bytes = (std::max)(bytes, m_options.smallest_block_size); - assert(detail::is_power_of_2(alignment)); + assert(_THRUST_LIBCXX::is_power_of_two(alignment)); // an oversized and/or overaligned allocation requested; needs to be allocated separately if (bytes > m_options.largest_block_size || alignment > m_options.alignment) @@ -429,7 +431,7 @@ class disjoint_unsynchronized_pool_resource final // the request is NOT for oversized and/or overaligned memory // allocate a block from an appropriate bucket - std::size_t bytes_log2 = thrust::detail::log2_ri(bytes); + std::size_t bytes_log2 = _THRUST_LIBCXX::ceil_ilog2(bytes); std::size_t pool_idx = bytes_log2 - m_smallest_block_log2; pool& bucket = m_pools[pool_idx]; @@ -481,7 +483,7 @@ class disjoint_unsynchronized_pool_resource final virtual void do_deallocate(void_ptr p, std::size_t n, std::size_t alignment = THRUST_MR_DEFAULT_ALIGNMENT) override { n = (std::max)(n, m_options.smallest_block_size); - assert(detail::is_power_of_2(alignment)); + assert(_THRUST_LIBCXX::is_power_of_two(alignment)); // verify that the pointer is at least as aligned as claimed assert(reinterpret_cast<_THRUST_STD::intmax_t>(detail::pointer_traits::get(p)) % alignment == 0); @@ -510,7 +512,7 @@ class disjoint_unsynchronized_pool_resource final } // push the block to the front of the appropriate bucket's free list - std::size_t n_log2 = thrust::detail::log2_ri(n); + std::size_t n_log2 = _THRUST_LIBCXX::ceil_ilog2(n); std::size_t pool_idx = n_log2 - m_smallest_block_log2; pool& bucket = m_pools[pool_idx]; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/mr/pool.h b/projects/hipccl/hipccl3/rocthrust/thrust/mr/pool.h index 119b1aa38c41..a3dfe8cb3e33 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/mr/pool.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/mr/pool.h @@ -38,6 +38,8 @@ #include #include +#include _THRUST_LIBCXX_INCLUDE(__cmath/ilog.h) +#include _THRUST_LIBCXX_INCLUDE(__cmath/pow2.h) #include _THRUST_STD_INCLUDE(cassert) #include _THRUST_STD_INCLUDE(cstdint) @@ -111,7 +113,7 @@ class unsynchronized_pool_resource final unsynchronized_pool_resource(Upstream* upstream, pool_options options = get_default_options()) : m_upstream(upstream) , m_options(options) - , m_smallest_block_log2(detail::log2_ri(m_options.smallest_block_size)) + , m_smallest_block_log2(_THRUST_LIBCXX::ceil_ilog2(m_options.smallest_block_size)) , m_pools(upstream) , m_allocated() , m_oversized() @@ -120,7 +122,7 @@ class unsynchronized_pool_resource final assert(m_options.validate()); pool p = {block_descriptor_ptr(), 0}; - m_pools.resize(detail::log2_ri(m_options.largest_block_size) - m_smallest_block_log2 + 1, p); + m_pools.resize(_THRUST_LIBCXX::ceil_ilog2(m_options.largest_block_size) - m_smallest_block_log2 + 1, p); } // TODO: C++11: use delegating constructors @@ -132,7 +134,7 @@ class unsynchronized_pool_resource final unsynchronized_pool_resource(pool_options options = get_default_options()) : m_upstream(get_global_resource()) , m_options(options) - , m_smallest_block_log2(detail::log2_ri(m_options.smallest_block_size)) + , m_smallest_block_log2(_THRUST_LIBCXX::ceil_ilog2(m_options.smallest_block_size)) , m_pools(get_global_resource()) , m_allocated() , m_oversized() @@ -141,7 +143,7 @@ class unsynchronized_pool_resource final assert(m_options.validate()); pool p = {block_descriptor_ptr(), 0}; - m_pools.resize(detail::log2_ri(m_options.largest_block_size) - m_smallest_block_log2 + 1, p); + m_pools.resize(_THRUST_LIBCXX::ceil_ilog2(m_options.largest_block_size) - m_smallest_block_log2 + 1, p); } /*! Destructor. Releases all held memory to upstream. @@ -259,7 +261,7 @@ class unsynchronized_pool_resource final do_allocate(std::size_t bytes, std::size_t alignment = THRUST_MR_DEFAULT_ALIGNMENT) override { bytes = (std::max)(bytes, m_options.smallest_block_size); - assert(detail::is_power_of_2(alignment)); + assert(_THRUST_LIBCXX::is_power_of_two(alignment)); // an oversized and/or overaligned allocation requested; needs to be allocated separately if (bytes > m_options.largest_block_size || alignment > m_options.alignment) @@ -370,7 +372,7 @@ class unsynchronized_pool_resource final // the request is NOT for oversized and/or overaligned memory // allocate a block from an appropriate bucket - std::size_t bytes_log2 = thrust::detail::log2_ri(bytes); + std::size_t bytes_log2 = _THRUST_LIBCXX::ceil_ilog2(bytes); std::size_t bucket_idx = bytes_log2 - m_smallest_block_log2; pool& bucket = thrust::raw_reference_cast(m_pools[bucket_idx]); @@ -438,7 +440,7 @@ class unsynchronized_pool_resource final virtual void do_deallocate(void_ptr p, std::size_t n, std::size_t alignment = THRUST_MR_DEFAULT_ALIGNMENT) override { n = (std::max)(n, m_options.smallest_block_size); - assert(detail::is_power_of_2(alignment)); + assert(_THRUST_LIBCXX::is_power_of_two(alignment)); // verify that the pointer is at least as aligned as claimed assert(reinterpret_cast<_THRUST_STD::intmax_t>(void_ptr_traits::get(p)) % alignment == 0); @@ -503,7 +505,7 @@ class unsynchronized_pool_resource final } // push the block to the front of the appropriate bucket's free list - std::size_t n_log2 = thrust::detail::log2_ri(n); + std::size_t n_log2 = _THRUST_LIBCXX::ceil_ilog2(n); std::size_t bucket_idx = n_log2 - m_smallest_block_log2; pool& bucket = thrust::raw_reference_cast(m_pools[bucket_idx]); diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/mr/pool_options.h b/projects/hipccl/hipccl3/rocthrust/thrust/mr/pool_options.h index 4d553bf3fdc0..3c0d7fdae5ee 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/mr/pool_options.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/mr/pool_options.h @@ -32,8 +32,8 @@ #endif // no system header #include -#include +#include _THRUST_LIBCXX_INCLUDE(__cmath/pow2.h) #include _THRUST_STD_INCLUDE(cstddef) THRUST_NAMESPACE_BEGIN @@ -103,15 +103,15 @@ struct pool_options */ bool validate() const { - if (!detail::is_power_of_2(smallest_block_size)) + if (smallest_block_size != 0 && !_THRUST_LIBCXX::is_power_of_two(smallest_block_size)) { return false; } - if (!detail::is_power_of_2(largest_block_size)) + if (largest_block_size != 0 && !_THRUST_LIBCXX::is_power_of_two(largest_block_size)) { return false; } - if (!detail::is_power_of_2(alignment)) + if (alignment != 0 && !_THRUST_LIBCXX::is_power_of_two(alignment)) { return false; } diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/cuda/detail/dispatch.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/cuda/detail/dispatch.h index a47f244bf77e..f96f612a7ee4 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/cuda/detail/dispatch.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/cuda/detail/dispatch.h @@ -26,15 +26,36 @@ # pragma system_header #endif // no system header -#include #include +#include #include +#include +#include #include #include #include +THRUST_NAMESPACE_BEGIN +namespace detail +{ +_CCCL_TEMPLATE(typename T) +_CCCL_REQUIRES(::cuda::std::is_arithmetic_v) +[[nodiscard]] _CCCL_API constexpr bool is_negative([[maybe_unused]] T x) noexcept +{ + if constexpr (::cuda::std::is_unsigned_v) + { + return false; + } + else + { + return x < 0; + } +} +} // namespace detail +THRUST_NAMESPACE_END + #if defined(THRUST_FORCE_32_BIT_OFFSET_TYPE) && defined(THRUST_FORCE_64_BIT_OFFSET_TYPE) # error "Only THRUST_FORCE_32_BIT_OFFSET_TYPE or THRUST_FORCE_64_BIT_OFFSET_TYPE may be defined!" #endif // THRUST_FORCE_32_BIT_OFFSET_TYPE && THRUST_FORCE_64_BIT_OFFSET_TYPE diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/dispatch.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/dispatch.h index 15f2689be657..45f51267ecde 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/dispatch.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/dispatch.h @@ -27,7 +27,6 @@ # pragma system_header #endif // no system header -#include #include #if _THRUST_HAS_DEVICE_SYSTEM_STD @@ -39,6 +38,24 @@ #include +THRUST_NAMESPACE_BEGIN +namespace detail +{ +template , int> = 0> +[[nodiscard]] THRUST_HOST_DEVICE constexpr bool is_negative([[maybe_unused]] T x) noexcept +{ + if constexpr (_THRUST_STD::is_unsigned_v) + { + return false; + } + else + { + return x < 0; + } +} +} // namespace detail +THRUST_NAMESPACE_END + #if defined(THRUST_FORCE_32_BIT_OFFSET_TYPE) && defined(THRUST_FORCE_64_BIT_OFFSET_TYPE) # error "Only THRUST_FORCE_32_BIT_OFFSET_TYPE or THRUST_FORCE_64_BIT_OFFSET_TYPE may be defined!" #endif // THRUST_FORCE_32_BIT_OFFSET_TYPE && THRUST_FORCE_64_BIT_OFFSET_TYPE diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/scan.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/scan.h index ebeec05b01cc..6c8c91706aa5 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/scan.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/scan.h @@ -41,7 +41,6 @@ # include -# include # include # include # include diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/sort.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/sort.h index abb23f503ce8..1b2728cdfa09 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/sort.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/sort.h @@ -41,7 +41,6 @@ # include # include -# include # include # include # include From 8c983457b94fe397550bedd19df4cda898d44cb7 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:27:52 -0400 Subject: [PATCH 03/48] refactor(rocthrust): CCCL 6d3ffc900fb parity - unguard libcxx iterator includes Related upstream commit: 6d3ffc900fb Port `thrust::transform_input_output_iterator` to `cuda` (NVIDIA/cccl#5113) Related local port commit: 251fd4978d6 libhipcxx is now mandatory, so internal_functional.h includes ::cuda discard_iterator, tabulate_output_iterator and transform_input_output_iterator unconditionally, as upstream does. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../hipccl3/rocthrust/thrust/detail/internal_functional.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h index 1cb23dee05eb..894f3e56ef31 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h @@ -41,10 +41,10 @@ #include #include +#include _THRUST_LIBCXX_INCLUDE(__iterator/discard_iterator.h) +#include _THRUST_LIBCXX_INCLUDE(__iterator/tabulate_output_iterator.h) +#include _THRUST_LIBCXX_INCLUDE(__iterator/transform_input_output_iterator.h) #if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(__iterator/discard_iterator.h) -# include _THRUST_LIBCXX_INCLUDE(__iterator/tabulate_output_iterator.h) -# include _THRUST_LIBCXX_INCLUDE(__iterator/transform_input_output_iterator.h) # include _THRUST_STD_INCLUDE(__new/device_new.h) #endif From ac4d3997351ac454197ef3a83aa661cd156c1743 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:28:10 -0400 Subject: [PATCH 04/48] refactor(rocthrust): CCCL 30c02fd29dd parity - use _THRUST_STD::remove_cvref_t in pointer Related upstream commit: 30c02fd29dd Refactor thrust::pointer (NVIDIA/cccl#5478) Related local port commit: a3de4927b1e libhipcxx is now mandatory, so thrust::pointer uses _THRUST_STD::remove_cvref_t (upstream ::cuda::std::remove_cvref_t) instead of the ::internal fallback alias. Not compiled, tests not run (per human) Co-Authored-By: Claude --- projects/hipccl/hipccl3/rocthrust/thrust/detail/pointer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/pointer.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/pointer.h index fed5fa8df6e6..2e4701529a09 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/pointer.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/pointer.h @@ -72,7 +72,7 @@ struct pointer_base { // void pointers should have no element type // note that we remove_cv from the Element type to get the value_type - using value_type = typename eval_if<_THRUST_STD::is_void_v<::internal::remove_cvref_t>, + using value_type = typename eval_if<_THRUST_STD::is_void_v<_THRUST_STD::remove_cvref_t>, _THRUST_STD::type_identity, _THRUST_STD::remove_cv>::type; @@ -85,7 +85,7 @@ struct pointer_base // void pointers should have no reference type // if no Reference type is given, just use reference using reference_type = - typename eval_if<_THRUST_STD::is_void_v<::internal::remove_cvref_t>, + typename eval_if<_THRUST_STD::is_void_v<_THRUST_STD::remove_cvref_t>, _THRUST_STD::type_identity, eval_if<_THRUST_STD::is_same_v, _THRUST_STD::type_identity>, From 1c5ec9a63918f529123c9512f058160740f719cb Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:28:42 -0400 Subject: [PATCH 05/48] test(rocthrust): CCCL ca57b79824c parity - always run libcxx iterator type_traits checks Related upstream commit: ca57b79824c Inherit `thrust::transform_iterator` traversal from base iterator traversal (NVIDIA/cccl#5883) Related local port commit: 308ae2c9b5c libhipcxx is now mandatory, so drop the _THRUST_HAS_DEVICE_SYSTEM_STD guards in test/test_type_traits.cpp and testing/type_traits.cu: the libcxx_make_{counting,transform,zip}_iterator propagation combinations and the thrust::pair/tuple relocatability checks always compile, as upstream. The !_THRUST_HAS_DEVICE_SYSTEM_STD fallback include is removed. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../rocthrust/test/test_type_traits.cpp | 22 +------------------ .../hipccl3/rocthrust/testing/type_traits.cu | 22 +------------------ 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/test/test_type_traits.cpp b/projects/hipccl/hipccl3/rocthrust/test/test_type_traits.cpp index bf588f577f0e..28973201d101 100644 --- a/projects/hipccl/hipccl3/rocthrust/test/test_type_traits.cpp +++ b/projects/hipccl/hipccl3/rocthrust/test/test_type_traits.cpp @@ -44,13 +44,7 @@ #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(iterator) -#endif - -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_LIBCXX_INCLUDE(iterator) TESTS_DEFINE(TypeTraitsTests, FullTestsParams); @@ -229,12 +223,10 @@ TEST(TypeTraitsTests, TestTriviallyRelocatable) static_assert(thrust::is_trivially_relocatable<_THRUST_STD::tuple, char>>::value, ""); #endif // THRUST_COMPILER(GCC, >=, 7) -#if _THRUST_HAS_DEVICE_SYSTEM_STD static_assert(thrust::is_trivially_relocatable< _THRUST_STD::tuple>>, thrust::tuple<_THRUST_STD::pair>, int>>>::value, ""); -#endif static_assert(!thrust::is_trivially_relocatable>::value, ""); static_assert(!thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); @@ -243,13 +235,9 @@ TEST(TypeTraitsTests, TestTriviallyRelocatable) // test propagation of relocatability through pair and tuple static_assert(thrust::is_trivially_relocatable::value, ""); -#if _THRUST_HAS_DEVICE_SYSTEM_STD static_assert(thrust::is_trivially_relocatable>::value, ""); -#endif static_assert(thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); -#if _THRUST_HAS_DEVICE_SYSTEM_STD static_assert(thrust::is_trivially_relocatable>::value, ""); -#endif static_assert(thrust::is_trivially_relocatable<_THRUST_STD::tuple>::value, ""); } @@ -317,7 +305,6 @@ struct thrust_make_zip_iterator } }; -#if _THRUST_HAS_DEVICE_SYSTEM_STD struct libcxx_make_counting_iterator { template @@ -344,7 +331,6 @@ struct libcxx_make_zip_iterator return _THRUST_LIBCXX::make_zip_iterator(_THRUST_STD::forward(args)...); } }; -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD template inline constexpr bool has_random_access_traversal = @@ -412,7 +398,6 @@ void check_vector_and_any_system_propagation() TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationAnySystem) { check_any_system_propagation(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_any_system_propagation(); check_any_system_propagation(); check_any_system_propagation(); @@ -420,7 +405,6 @@ TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationAnySystem) check_any_system_propagation(); check_any_system_propagation(); check_any_system_propagation(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD } TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectors) @@ -428,7 +412,6 @@ TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectors) check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_vector_propagation, thrust_make_transform_iterator, libcxx_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, libcxx_make_zip_iterator>(); @@ -438,7 +421,6 @@ TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectors) check_vector_propagation, thrust_make_transform_iterator, libcxx_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, libcxx_make_zip_iterator>(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD } TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectorsAndAnySystem) @@ -446,7 +428,6 @@ TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectorsAndAnySyst check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_vector_and_any_system_propagation, thrust_make_counting_iterator, libcxx_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, libcxx_make_zip_iterator>(); @@ -456,5 +437,4 @@ TEST(TypeTraitsTests, TestIteratorSystemAndTraversalPropagationVectorsAndAnySyst check_vector_and_any_system_propagation, thrust_make_counting_iterator, libcxx_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, libcxx_make_zip_iterator>(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD } diff --git a/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu b/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu index 21492b3b49d1..97f64b35c07f 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu @@ -43,13 +43,7 @@ #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(iterator) -#endif - -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_LIBCXX_INCLUDE(iterator) void TestIsContiguousIterator() { @@ -222,12 +216,10 @@ void TestTriviallyRelocatable() static_assert(thrust::is_trivially_relocatable<_THRUST_STD::tuple, char>>::value, ""); #endif // THRUST_COMPILER(GCC, >=, 7) -#if _THRUST_HAS_DEVICE_SYSTEM_STD static_assert(thrust::is_trivially_relocatable< _THRUST_STD::tuple>>, thrust::tuple<_THRUST_STD::pair>, int>>>::value, ""); -#endif static_assert(!thrust::is_trivially_relocatable>::value, ""); static_assert(!thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); @@ -236,13 +228,9 @@ void TestTriviallyRelocatable() // test propagation of relocatability through pair and tuple static_assert(thrust::is_trivially_relocatable::value, ""); -#if _THRUST_HAS_DEVICE_SYSTEM_STD static_assert(thrust::is_trivially_relocatable>::value, ""); -#endif static_assert(thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); -#if _THRUST_HAS_DEVICE_SYSTEM_STD static_assert(thrust::is_trivially_relocatable>::value, ""); -#endif static_assert(thrust::is_trivially_relocatable<_THRUST_STD::tuple>::value, ""); }; DECLARE_UNITTEST(TestTriviallyRelocatable); @@ -313,7 +301,6 @@ struct thrust_make_zip_iterator } }; -#if _THRUST_HAS_DEVICE_SYSTEM_STD struct libcxx_make_counting_iterator { template @@ -340,7 +327,6 @@ struct libcxx_make_zip_iterator return _THRUST_LIBCXX::make_zip_iterator(_THRUST_STD::forward(args)...); } }; -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD template inline constexpr bool has_random_access_traversal = @@ -408,7 +394,6 @@ void check_vector_and_any_system_propagation() void TestIteratorSystemAndTraversalPropagationAnySystem() { check_any_system_propagation(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_any_system_propagation(); check_any_system_propagation(); check_any_system_propagation(); @@ -416,7 +401,6 @@ void TestIteratorSystemAndTraversalPropagationAnySystem() check_any_system_propagation(); check_any_system_propagation(); check_any_system_propagation(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD }; DECLARE_UNITTEST(TestIteratorSystemAndTraversalPropagationAnySystem); @@ -425,7 +409,6 @@ void TestIteratorSystemAndTraversalPropagationVectors() check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, thrust_make_transform_iterator, thrust_make_zip_iterator>(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_vector_propagation, thrust_make_transform_iterator, libcxx_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, libcxx_make_zip_iterator>(); @@ -435,7 +418,6 @@ void TestIteratorSystemAndTraversalPropagationVectors() check_vector_propagation, thrust_make_transform_iterator, libcxx_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, thrust_make_zip_iterator>(); check_vector_propagation, libcxx_make_transform_iterator, libcxx_make_zip_iterator>(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD }; DECLARE_UNITTEST(TestIteratorSystemAndTraversalPropagationVectors); @@ -444,7 +426,6 @@ void TestIteratorSystemAndTraversalPropagationVectorsAndAnySystem() check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, thrust_make_counting_iterator, thrust_make_zip_iterator>(); -#if _THRUST_HAS_DEVICE_SYSTEM_STD check_vector_and_any_system_propagation, thrust_make_counting_iterator, libcxx_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, libcxx_make_zip_iterator>(); @@ -454,6 +435,5 @@ void TestIteratorSystemAndTraversalPropagationVectorsAndAnySystem() check_vector_and_any_system_propagation, thrust_make_counting_iterator, libcxx_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, thrust_make_zip_iterator>(); check_vector_and_any_system_propagation, libcxx_make_counting_iterator, libcxx_make_zip_iterator>(); -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD }; DECLARE_UNITTEST(TestIteratorSystemAndTraversalPropagationVectorsAndAnySystem); From cdf61a23a40de527f76ccaaacbb803c3427793bf Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:29:34 -0400 Subject: [PATCH 06/48] refactor(rocthrust): CCCL abcb70514b7 parity - use _THRUST_STD::_If in iterator_facade(_category) Related upstream commit: abcb70514b7 Refactor thrust::iterator_facade_category (NVIDIA/cccl#5877) Related local port commit: 42453aa3373 libhipcxx is now mandatory, so iterator_facade_category.h and iterator_facade.h use _THRUST_STD::_If (upstream ::cuda::std::_If) instead of the ::internal::If fallback from libcxx_wrapper/std/__type_traits/conditional.h, and iterator_facade.h drops its !_THRUST_HAS_DEVICE_SYSTEM_STD / fallback includes. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../detail/iterator_facade_category.h | 47 ++++++++++--------- .../thrust/iterator/iterator_facade.h | 12 ++--- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_facade_category.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_facade_category.h index b9664cdbbd06..3b122e711d08 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_facade_category.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_facade_category.h @@ -25,7 +25,6 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include #include #include @@ -36,6 +35,7 @@ #include #include +#include _THRUST_STD_INCLUDE(__type_traits/conditional.h) #include _THRUST_STD_INCLUDE(iterator) #include _THRUST_STD_INCLUDE(type_traits) @@ -99,42 +99,42 @@ inline constexpr bool is_iterator_category = is_host_iterator_category || is_ // standard system iterators template -using iterator_facade_default_category_std = ::internal::If< +using iterator_facade_default_category_std = _THRUST_STD::_If< _THRUST_STD::is_convertible_v, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, _THRUST_STD::random_access_iterator_tag, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, _THRUST_STD::bidirectional_iterator_tag, _THRUST_STD::forward_iterator_tag>>, - ::internal::If< // we differ from Boost here + _THRUST_STD::_If< // we differ from Boost here _THRUST_STD::is_convertible_v, _THRUST_STD::input_iterator_tag, Traversal>>; // host system iterators (basically same as standard system iterators) template -using iterator_facade_default_category_host = ::internal::If< +using iterator_facade_default_category_host = _THRUST_STD::_If< _THRUST_STD::is_convertible_v, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, random_access_host_iterator_tag, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, bidirectional_host_iterator_tag, forward_host_iterator_tag>>, - ::internal::If< // we differ from Boost here + _THRUST_STD::_If< // we differ from Boost here _THRUST_STD::is_convertible_v, input_host_iterator_tag, Traversal>>; // device system iterators template -using iterator_facade_default_category_device = ::internal::If< +using iterator_facade_default_category_device = _THRUST_STD::_If< _THRUST_STD::is_convertible_v, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, random_access_device_iterator_tag, - ::internal::If<_THRUST_STD::is_convertible_v, + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, bidirectional_device_iterator_tag, forward_device_iterator_tag>>, - ::internal::If< + _THRUST_STD::_If< // XXX note we differ from Boost here _THRUST_STD::is_convertible_v, input_device_iterator_tag, @@ -146,15 +146,15 @@ using iterator_facade_default_category_any = iterator_category_with_system_and_traversal, any_system_tag, Traversal>; template -using iterator_facade_default_category = ::internal::If< +using iterator_facade_default_category = _THRUST_STD::_If< _THRUST_STD::is_convertible_v, iterator_facade_default_category_any, // check for host system - ::internal::If< + _THRUST_STD::_If< _THRUST_STD::is_convertible_v, iterator_facade_default_category_host, // check for device system - ::internal::If< + _THRUST_STD::_If< _THRUST_STD::is_convertible_v, iterator_facade_default_category_device, // if we don't recognize the system, get a standard iterator category and combine it with System & Traversal @@ -166,17 +166,18 @@ struct iterator_facade_category_impl using category = iterator_facade_default_category; // we must be able to deduce both Traversal & System from category, otherwise, munge them all together - using type = ::internal::If<_THRUST_STD::is_same_v::type> - && _THRUST_STD::is_same_v::type>, - category, - iterator_category_with_system_and_traversal>; + using type = + _THRUST_STD::_If<_THRUST_STD::is_same_v::type> + && _THRUST_STD::is_same_v::type>, + category, + iterator_category_with_system_and_traversal>; }; template using iterator_facade_category_t = - typename ::internal::If, - _THRUST_STD::type_identity, - iterator_facade_category_impl>::type; + typename _THRUST_STD::_If, + _THRUST_STD::type_identity, + iterator_facade_category_impl>::type; } // namespace detail THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_facade.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_facade.h index 4e7f19b75827..da8d36d3883f 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_facade.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/iterator_facade.h @@ -40,15 +40,9 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -#endif - THRUST_NAMESPACE_BEGIN namespace detail @@ -57,9 +51,9 @@ namespace detail // it's legal to access IteratorFacade2::difference_type template using distance_from_result = - ::internal::If<_THRUST_STD::is_convertible_v, - typename IteratorFacade1::difference_type, - typename IteratorFacade2::difference_type>; + _THRUST_STD::_If<_THRUST_STD::is_convertible_v, + typename IteratorFacade1::difference_type, + typename IteratorFacade2::difference_type>; } // namespace detail /*! \addtogroup iterators From 7ff15721ac59c274510917058921a2b813866bb6 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:29:57 -0400 Subject: [PATCH 07/48] refactor(rocthrust): CCCL da893945e45 parity - drop examples' non-libhipcxx include fallbacks Related upstream commit: da893945e45 Modernize Thrust examples (NVIDIA/cccl#5670) Related local port commit: ec8255968b5 libhipcxx is now mandatory, so remove the `#if !_THRUST_HAS_DEVICE_SYSTEM_STD` fallback includes from examples/{repeated,strided,tiled}_range.cu and the fallback from examples/minimal_custom_backend.cu (pre-existing, same pattern); the include lists now match upstream apart from the local include/host_device.h. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../hipccl3/rocthrust/examples/minimal_custom_backend.cu | 3 --- projects/hipccl/hipccl3/rocthrust/examples/repeated_range.cu | 4 ---- projects/hipccl/hipccl3/rocthrust/examples/strided_range.cu | 4 ---- projects/hipccl/hipccl3/rocthrust/examples/tiled_range.cu | 4 ---- 4 files changed, 15 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/examples/minimal_custom_backend.cu b/projects/hipccl/hipccl3/rocthrust/examples/minimal_custom_backend.cu index 2c294d13ebdf..4e119aceae66 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/minimal_custom_backend.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/minimal_custom_backend.cu @@ -25,9 +25,6 @@ #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif // This example demonstrates how to build a minimal custom // Thrust backend by intercepting for_each's dispatch. diff --git a/projects/hipccl/hipccl3/rocthrust/examples/repeated_range.cu b/projects/hipccl/hipccl3/rocthrust/examples/repeated_range.cu index cc72f8d3ed39..7586fb4f4acb 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/repeated_range.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/repeated_range.cu @@ -30,10 +30,6 @@ #include "include/host_device.h" -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - // this example illustrates how to make repeated access to a range of values // examples: // repeated_range([0, 1, 2, 3], 1) -> [0, 1, 2, 3] diff --git a/projects/hipccl/hipccl3/rocthrust/examples/strided_range.cu b/projects/hipccl/hipccl3/rocthrust/examples/strided_range.cu index 484b0575d0d0..5c52a74fc20c 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/strided_range.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/strided_range.cu @@ -30,10 +30,6 @@ #include "include/host_device.h" -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - // this example illustrates how to make strided access to a range of values // examples: // strided_range([0, 1, 2, 3, 4, 5, 6], 1) -> [0, 1, 2, 3, 4, 5, 6] diff --git a/projects/hipccl/hipccl3/rocthrust/examples/tiled_range.cu b/projects/hipccl/hipccl3/rocthrust/examples/tiled_range.cu index 6cd35c8b474a..ba5b707c7e30 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/tiled_range.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/tiled_range.cu @@ -30,10 +30,6 @@ #include "include/host_device.h" -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - // this example illustrates how to tile a range multiple times // examples: // tiled_range([0, 1, 2, 3], 1) -> [0, 1, 2, 3] From 915d0c3ac1a7f3af4cca54b4e20c3a2d36b4c005 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:30:20 -0400 Subject: [PATCH 08/48] refactor(rocthrust): CCCL bb718514624 parity - granular max/min includes in xor_combine_engine_max Related upstream commit: bb718514624 Drop Thrust mpl math (NVIDIA/cccl#5897) Related local port commit: 1a7094e7ee7 Include _THRUST_STD_INCLUDE(__algorithm/max.h) and __algorithm/min.h instead of the and umbrella headers, as upstream (both granular headers exist in libhipcxx, which is now mandatory). The host include is kept for the unqualified size_t. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../rocthrust/thrust/random/detail/xor_combine_engine_max.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/random/detail/xor_combine_engine_max.h b/projects/hipccl/hipccl3/rocthrust/thrust/random/detail/xor_combine_engine_max.h index f324f569e73a..17c3671d060b 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/random/detail/xor_combine_engine_max.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/random/detail/xor_combine_engine_max.h @@ -28,9 +28,9 @@ #include -#include _THRUST_STD_INCLUDE(algorithm) +#include _THRUST_STD_INCLUDE(__algorithm/max.h) +#include _THRUST_STD_INCLUDE(__algorithm/min.h) #include _THRUST_STD_INCLUDE(limits) -#include _THRUST_STD_INCLUDE(type_traits) #include From abd50e5c3e3bcc628b3ca8515101cc737b119d9a Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:30:38 -0400 Subject: [PATCH 09/48] refactor(rocthrust): CCCL 1ceac3731d5 parity - libcxx address_stability in internal_functional Related upstream commit: 1ceac3731d5 Improve `thrust::cuda_cub::replace` functor handling (NVIDIA/cccl#5949) Related local port commit: 3adee1d8a8f libhipcxx is now mandatory, so internal_functional.h includes _THRUST_LIBCXX_INCLUDE(__functional/address_stability.h) directly (upstream ) instead of the libcxx_wrapper header, and the proclaims_copyable_arguments specializations for predicate_to_integral, tuple_binary_predicate and new_value_if_f are only declared in the libcxx namespace (the `namespace internal` fallback is removed). Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../rocthrust/thrust/detail/internal_functional.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h index 894f3e56ef31..eac2e4730495 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h @@ -31,7 +31,6 @@ # pragma system_header #endif // no system header -#include #include #include // for ::new #include @@ -41,6 +40,7 @@ #include #include +#include _THRUST_LIBCXX_INCLUDE(__functional/address_stability.h) #include _THRUST_LIBCXX_INCLUDE(__iterator/discard_iterator.h) #include _THRUST_LIBCXX_INCLUDE(__iterator/tabulate_output_iterator.h) #include _THRUST_LIBCXX_INCLUDE(__iterator/transform_input_output_iterator.h) @@ -315,12 +315,7 @@ struct compare_first } // end namespace detail THRUST_NAMESPACE_END -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_LIBCXX_NAMESPACE_BEGIN -#else -namespace internal -{ -#endif template struct proclaims_copyable_arguments> : proclaims_copyable_arguments @@ -335,8 +330,4 @@ template struct proclaims_copyable_arguments> : proclaims_copyable_arguments {}; -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_LIBCXX_NAMESPACE_END -#else -} // namespace internal -#endif From f4f0b902e96c7f7f9f8d59682eb509e7df887379 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:31:09 -0400 Subject: [PATCH 10/48] refactor(rocthrust): CCCL 700f2a867a7 + fbb9479172c parity - drop allocator fallbacks Related upstream commit: 700f2a867a7 Refactor Thrust `destroy_range` and `device_[new|delete|free]` (NVIDIA/cccl#6134) Related upstream commit: fbb9479172c Refactor Thrust allocator internals (NVIDIA/cccl#6136) Related local port commits: 63becda559e, 17ee2337617 libhipcxx is now mandatory, so remove the `#if !_THRUST_HAS_DEVICE_SYSTEM_STD` fallbacks from detail/allocator/{destroy_range,value_initialize_range,fill_construct_range, copy_construct_range}.h, detail/temporary_array.h and detail/execute_with_allocator.h, and add the upstream granular _THRUST_STD_INCLUDE headers (__iterator/advance.h, __iterator/distance.h, __type_traits/is_convertible.h, __type_traits/is_trivially_copy_constructible.h, __type_traits/type_identity.h, __utility/pair.h). thrust/detail/memory_wrapper.h stays: is not in libhipcxx. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../thrust/detail/allocator/copy_construct_range.h | 7 ++++--- .../rocthrust/thrust/detail/allocator/destroy_range.h | 4 ---- .../thrust/detail/allocator/fill_construct_range.h | 4 ---- .../thrust/detail/allocator/value_initialize_range.h | 4 ---- .../rocthrust/thrust/detail/execute_with_allocator.h | 5 +---- .../hipccl3/rocthrust/thrust/detail/temporary_array.h | 5 ++--- 6 files changed, 7 insertions(+), 22 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/copy_construct_range.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/copy_construct_range.h index 1113e18912e2..bcd9dbfd1f0f 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/copy_construct_range.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/copy_construct_range.h @@ -38,9 +38,10 @@ #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__iterator/advance.h) +#include _THRUST_STD_INCLUDE(__iterator/distance.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_trivially_copy_constructible.h) THRUST_NAMESPACE_BEGIN namespace detail diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/destroy_range.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/destroy_range.h index 5e9d9714fec6..b18b57423bde 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/destroy_range.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/destroy_range.h @@ -32,10 +32,6 @@ #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - THRUST_NAMESPACE_BEGIN namespace detail { diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/fill_construct_range.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/fill_construct_range.h index 9f8714cfc84c..b86b2ae17193 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/fill_construct_range.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/fill_construct_range.h @@ -33,10 +33,6 @@ #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - THRUST_NAMESPACE_BEGIN namespace detail { diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/value_initialize_range.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/value_initialize_range.h index 3ce6a09b104a..ad475be802e3 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/value_initialize_range.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/value_initialize_range.h @@ -32,10 +32,6 @@ #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - THRUST_NAMESPACE_BEGIN namespace detail { diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h index 4160c1a02881..e2b2e823fb29 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h @@ -33,10 +33,7 @@ #include #include _THRUST_LIBCXX_INCLUDE(__cmath/ceil_div.h) - -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.h index a66f234f318c..e35324d6b2de 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_array.h @@ -49,9 +49,8 @@ THRUST_NAMESPACE_END #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) THRUST_NAMESPACE_BEGIN namespace detail From 2b88e3bda026fd50852d9fc666ba71982969cd06 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:31:49 -0400 Subject: [PATCH 11/48] refactor(rocthrust): CCCL 1238f287f4f parity - granular includes and ceil_div in omp/tbb scan Related upstream commit: 1238f287f4f add parallel scan support for TBB and OMP (NVIDIA/cccl#6178) Related upstream commit: e73cc82956a Move CPP, OMP and TBB exec policies to detail (NVIDIA/cccl#6361) Related upstream commit: c22298179e0 Refactor Thrust OMP system headers (NVIDIA/cccl#6372) Related local port commits: 6cb9dc423de, 43961eaecc2, e6c2a3e0f4f libhipcxx is now mandatory, so: - system/omp/detail/scan.h: replace the /// umbrella includes and thrust/{advance,distance}.h with the upstream granular headers (__cmath/ceil_div.h, __functional/invoke.h, __iterator/{advance,distance}.h, __numeric/{exclusive_scan,inclusive_scan,reduce}.h, __type_traits/{conditional,is_same}.h; plus __algorithm/{max,min}.h for the max/min calls), and compute block_size with _THRUST_LIBCXX::ceil_div(n, num_threads) as upstream. - system/tbb/detail/scan.h: thrust/{advance,distance}.h -> _THRUST_STD __iterator/{advance,distance}.h. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../rocthrust/thrust/system/omp/detail/scan.h | 21 ++++++++++++------- .../rocthrust/thrust/system/tbb/detail/scan.h | 4 ++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/scan.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/scan.h index 8650550bb9b0..b6df35222431 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/scan.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/scan.h @@ -15,18 +15,23 @@ #endif // no system header // OMP parallel scan implementation -#include #include #include -#include #include #include #include -#include _THRUST_STD_INCLUDE(algorithm) -#include _THRUST_STD_INCLUDE(iterator) -#include _THRUST_STD_INCLUDE(numeric) -#include _THRUST_STD_INCLUDE(type_traits) +#include _THRUST_LIBCXX_INCLUDE(__cmath/ceil_div.h) +#include _THRUST_STD_INCLUDE(__algorithm/max.h) +#include _THRUST_STD_INCLUDE(__algorithm/min.h) +#include _THRUST_STD_INCLUDE(__functional/invoke.h) +#include _THRUST_STD_INCLUDE(__iterator/advance.h) +#include _THRUST_STD_INCLUDE(__iterator/distance.h) +#include _THRUST_STD_INCLUDE(__numeric/exclusive_scan.h) +#include _THRUST_STD_INCLUDE(__numeric/inclusive_scan.h) +#include _THRUST_STD_INCLUDE(__numeric/reduce.h) +#include _THRUST_STD_INCLUDE(__type_traits/conditional.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) #include @@ -101,7 +106,7 @@ OutputIterator scan_impl( THRUST_PRAGMA_OMP(parallel num_threads(num_threads)) { const int tid = omp_get_thread_num(); - const Size block_size = (n + num_threads - 1) / num_threads; + const Size block_size = _THRUST_LIBCXX::ceil_div(n, num_threads); const Size start = tid * block_size; const Size end = _THRUST_STD::min(start + block_size, n); @@ -130,7 +135,7 @@ OutputIterator scan_impl( THRUST_PRAGMA_OMP(parallel num_threads(num_threads)) { const int tid = omp_get_thread_num(); - const Size block_size = (n + num_threads - 1) / num_threads; + const Size block_size = _THRUST_LIBCXX::ceil_div(n, num_threads); const Size start = tid * block_size; const Size end = _THRUST_STD::min(start + block_size, n); diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/scan.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/scan.h index e64bb7027484..89d759b50d60 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/scan.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/scan.h @@ -16,14 +16,14 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include #include -#include #include #include #include _THRUST_STD_INCLUDE(__functional/invoke.h) +#include _THRUST_STD_INCLUDE(__iterator/advance.h) +#include _THRUST_STD_INCLUDE(__iterator/distance.h) #include #include From 5bdd5a9dbef56fc3d03b85dbefe96a626d421784 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:31:56 -0400 Subject: [PATCH 12/48] fix(rocthrust): CCCL 26c79caf60e parity - restore _CCCL_ASSERT in omp scan Related upstream commit: 26c79caf60e fix omp scan bug (#6560) (NVIDIA/cccl#6704) Related local port commit: ffd4daf4f90 The port replaced `_CCCL_ASSERT(num_threads > 1, ...)` with a comment because the macro was assumed unavailable. libhipcxx (now mandatory) provides _CCCL_ASSERT (cuda/std/__cccl/assert.h, reached via thrust/detail/config.h), so restore the upstream assertion. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../hipccl/hipccl3/rocthrust/thrust/system/omp/detail/scan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/scan.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/scan.h index b6df35222431..e5bf833e65bf 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/scan.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/scan.h @@ -98,7 +98,7 @@ OutputIterator scan_impl( } } - // Parallel scan requires multiple threads (num_threads > 1 is guaranteed above). + _CCCL_ASSERT(num_threads > 1, "Parallel scan requires multiple threads"); temporary_array block_sums(exec, num_threads); From 50c1d6d0b67484539a21b357fc9a26596a862aec Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:32:19 -0400 Subject: [PATCH 13/48] refactor(rocthrust): CCCL 638c03d54f7 parity - use _THRUST_STD::popcount in hip set_operations Related upstream commit: 638c03d54f7 Replace __popc with cude::std::popcounter (NVIDIA/cccl#6213) Related local port commit: baac4061517 The port changed only system/cuda. libhipcxx is now mandatory, so system/hip/detail/set_operations.h follows upstream: thread_output_count uses _THRUST_STD::popcount(static_cast(active_mask)) instead of the __popc intrinsic, includes _THRUST_STD_INCLUDE(__bit/popcount.h), and the max/min includes are no longer guarded (the !_THRUST_HAS_DEVICE_SYSTEM_STD algorithm_wrapper.h fallback is removed). Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../thrust/system/hip/detail/set_operations.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/set_operations.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/set_operations.h index 41a6935b22e2..baaea64ee2d0 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/set_operations.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/set_operations.h @@ -50,14 +50,10 @@ # include # include # include -# if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# endif -# if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(__algorithm/max.h) -# include _THRUST_STD_INCLUDE(__algorithm/min.h) -# endif +# include _THRUST_STD_INCLUDE(__algorithm/max.h) +# include _THRUST_STD_INCLUDE(__algorithm/min.h) +# include _THRUST_STD_INCLUDE(__bit/popcount.h) # include @@ -460,7 +456,7 @@ struct SetOpAgent Size tile_output_count = 0; Size thread_output_prefix = 0; Size tile_output_prefix = 0; - Size thread_output_count = static_cast(__popc(active_mask)); + Size thread_output_count = static_cast(_THRUST_STD::popcount(static_cast(active_mask))); if (tile_idx == 0) // first tile { From 60de061637b999b98543891a66a21967a75ce850 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:32:50 -0400 Subject: [PATCH 14/48] refactor(rocthrust): CCCL c859e948453 parity - drop non-libhipcxx paths in detail/type_traits.h Related upstream commit: c859e948453 Improve `invoke` machinery (NVIDIA/cccl#6227) Related local port commit: 33e87b68197 (pre-rebase SHA; folded into the rebased history) The port switched only the libhipcxx branch to _THRUST_STD::invoke_result and left the "TODO(libhipcxx): remove this path" rocprim/std fallbacks. libhipcxx is now mandatory, so thrust::detail::invoke_result is just _THRUST_STD::invoke_result as upstream, and the dead rocprim/std fallbacks for the ::internal aliases (is_arithmetic, is_integral, make_unsigned, decay_t, remove_cvref, ...), ::internal::detail::common_type and the include are removed. The ::internal aliases themselves stay for now (they still have users). Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../rocthrust/thrust/detail/type_traits.h | 92 ------------------- 1 file changed, 92 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h index aa076167d44a..08072b58904a 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h @@ -36,17 +36,9 @@ #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD && _THRUST_USE_ROCPRIM -// # include -# include -#endif // !_THRUST_HAS_DEVICE_SYSTEM_STD - // TODO(libhipcxx): remove this namespace once libhipcxx gets ready namespace internal { - -#if _THRUST_HAS_DEVICE_SYSTEM_STD - using _THRUST_STD::is_arithmetic; using _THRUST_STD::is_integral; using _THRUST_STD::is_integral_v; @@ -61,35 +53,6 @@ template using remove_cvref = _THRUST_STD::remove_cvref; template using remove_cvref_t = _THRUST_STD::remove_cvref_t; - -#else // !_THRUST_HAS_DEVICE_SYSTEM_STD - -// TODO: Use rocprim version of is_arithmetic, is_integral, make_unsigned and make_unsigned_t for consistency. -// However, replacing with rocprim::is_arithmetic currently causes issues. -// Keeping standard versions for now until compatibility is resolved. -using ::std::is_arithmetic; -using ::std::is_integral; -using ::std::is_integral_v; -using ::std::make_unsigned; - -template -using make_unsigned_t = typename ::std::make_unsigned::type; - -template -// If we're not on Windows and we have libstdc++ >= 10, we can use the __decay_t -// builtin to reduce compilation time. -# if defined(_WIN32) || (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 10) -using decay_t = ::std::decay_t; -# else -using decay_t = ::std::__decay_t; -# endif -template -using remove_cvref = ::std::remove_cv<::std::remove_reference_t>; -template -using remove_cvref_t = ::std::remove_cv_t<::std::remove_reference_t>; - -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD - } // namespace internal THRUST_NAMESPACE_BEGIN @@ -182,15 +145,7 @@ struct larger_type {}; template -#if _THRUST_HAS_DEVICE_SYSTEM_STD using invoke_result = _THRUST_STD::invoke_result; -#else // TODO(libhipcxx): remove this path of code once libhipcxx gets ready -# if _THRUST_USE_ROCPRIM -using invoke_result = ::rocprim::invoke_result; -# else -using invoke_result = ::std::invoke_result; -# endif -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD template using invoke_result_t = typename invoke_result::type; @@ -229,53 +184,6 @@ THRUST_NAMESPACE_END // with _THRUST_STD::common_type_t in rocThrust once libhipcxx gets ready namespace internal { - -#if _THRUST_HAS_DEVICE_SYSTEM_STD - template using common_type_t = _THRUST_STD::common_type_t; - -#else // !_THRUST_HAS_DEVICE_SYSTEM_STD - -namespace detail -{ - -template -struct common_type; - -template -struct common_type::type, - typename _THRUST_STD::is_floating_point::type>::value>::type> -{ - using type = typename THRUST_NS_QUALIFIER::detail::larger_type::type; -}; - -template -struct common_type< - T1, - T2, - typename _THRUST_STD::enable_if< - _And::type, typename _THRUST_STD::is_floating_point::type>::value>::type> -{ - using type = T2; -}; - -template -struct common_type::type, - typename is_integral::type>::value>::type> -{ - using type = T1; -}; - -} // namespace detail - -template -using common_type_t = typename detail::common_type::type; - -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD - } // namespace internal From 94645af4bd5419476e4b00fd4d63fbb6b990176b Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:33:30 -0400 Subject: [PATCH 15/48] refactor(rocthrust): CCCL 13886f72f16 parity - use _CCCL_HOST_STD_LIB in is_contiguous_iterator Related upstream commit: 13886f72f16 Add host standard library detection (NVIDIA/cccl#6244) Related local port commit: 1a0de38dff5 The port was N/A because _CCCL_HOST_STD_LIB was unavailable without libhipcxx. libhipcxx is now mandatory and provides it (cuda/std/__cccl/host_std_lib.h, via the libcxx config headers), so is_contiguous_iterator.h detects libc++, libstdc++ and the MSVC STL with _CCCL_HOST_STD_LIB(LIBCXX/LIBSTDCXX/STL) instead of defined(_LIBCPP_VERSION)/defined(__GLIBCXX__)/defined(_MSC_VER), as upstream. Note: the old "Use defined(_MSC_VER) due to Windows CI failures" workaround is dropped; please check Windows CI. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../thrust/type_traits/is_contiguous_iterator.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/type_traits/is_contiguous_iterator.h b/projects/hipccl/hipccl3/rocthrust/thrust/type_traits/is_contiguous_iterator.h index 683abdc6edf4..96defbdb1c11 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/type_traits/is_contiguous_iterator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/type_traits/is_contiguous_iterator.h @@ -83,7 +83,7 @@ namespace detail template inline constexpr bool is_libcxx_wrap_iter_v = false; -#if defined(_LIBCPP_VERSION) +#if _CCCL_HOST_STD_LIB(LIBCXX) template inline constexpr bool is_libcxx_wrap_iter_v< # if _LIBCPP_VERSION < 14000 @@ -92,24 +92,23 @@ inline constexpr bool is_libcxx_wrap_iter_v< std::__wrap_iter # endif > = true; -#endif +#endif // _CCCL_HOST_STD_LIB(LIBCXX) template inline constexpr bool is_libstdcxx_normal_iterator_v = false; -#if defined(__GLIBCXX__) +#if _CCCL_HOST_STD_LIB(LIBSTDCXX) template inline constexpr bool is_libstdcxx_normal_iterator_v<::__gnu_cxx::__normal_iterator> = true; -#endif +#endif // _CCCL_HOST_STD_LIB(LIBSTDCXX) -// Use defined(_MSC_VER) due to Windows CI failures -#if defined(_MSC_VER) +#if _CCCL_HOST_STD_LIB(STL) template inline constexpr bool is_msvc_contiguous_iterator_v = _THRUST_STD::is_pointer_v<::std::_Unwrapped_t>; -#else +#else // ^^^ _CCCL_HOST_STD_LIB(STL) ^^^ / vvv !_CCCL_HOST_STD_LIB(STL) vvv template inline constexpr bool is_msvc_contiguous_iterator_v = false; -#endif +#endif // ^^^ !_CCCL_HOST_STD_LIB(STL) ^^^ template inline constexpr bool is_contiguous_iterator_impl_v = From c2dcaad1bab26035d9449dc46ecd9c889f1ec213 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:33:58 -0400 Subject: [PATCH 16/48] refactor(rocthrust): CCCL f1b4a17019b parity - always include __new/device_new.h Related upstream commit: f1b4a17019b Always include `` when we need operator new for clang-cuda (NVIDIA/cccl#6310) Related local port commit: 5c1c329ec84 libhipcxx is now mandatory, so: - detail/internal_functional.h and system/detail/generic/uninitialized_copy.inl include _THRUST_STD_INCLUDE(__new/device_new.h) unconditionally (the generic .inl also drops its !_THRUST_HAS_DEVICE_SYSTEM_STD fallback). - system/hip/detail/uninitialized_{copy,fill}.h now include __new/device_new.h like their system/cuda counterparts, since they also use placement ::new in device code (clang-based HIP has the same need as clang-cuda). Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../hipccl3/rocthrust/thrust/detail/internal_functional.h | 4 +--- .../thrust/system/detail/generic/uninitialized_copy.inl | 6 +----- .../rocthrust/thrust/system/hip/detail/uninitialized_copy.h | 2 ++ .../rocthrust/thrust/system/hip/detail/uninitialized_fill.h | 2 ++ 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h index eac2e4730495..f0f6682266c8 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/internal_functional.h @@ -44,9 +44,7 @@ #include _THRUST_LIBCXX_INCLUDE(__iterator/discard_iterator.h) #include _THRUST_LIBCXX_INCLUDE(__iterator/tabulate_output_iterator.h) #include _THRUST_LIBCXX_INCLUDE(__iterator/transform_input_output_iterator.h) -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(__new/device_new.h) -#endif +#include _THRUST_STD_INCLUDE(__new/device_new.h) #include _THRUST_STD_INCLUDE(type_traits) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/uninitialized_copy.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/uninitialized_copy.inl index f389068fbf51..e5903b73c474 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/uninitialized_copy.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/uninitialized_copy.inl @@ -32,11 +32,7 @@ #include #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(__new/device_new.h) -#else -# include -#endif +#include _THRUST_STD_INCLUDE(__new/device_new.h) THRUST_NAMESPACE_BEGIN namespace system::detail::generic diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/uninitialized_copy.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/uninitialized_copy.h index ac30f78eafa9..d63f2da79dbc 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/uninitialized_copy.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/uninitialized_copy.h @@ -43,6 +43,8 @@ # include # include +# include _THRUST_STD_INCLUDE(__new/device_new.h) + # include THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/uninitialized_fill.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/uninitialized_fill.h index c7e8dcad34e6..a08ecddcb034 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/uninitialized_fill.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/uninitialized_fill.h @@ -43,6 +43,8 @@ # include # include +# include _THRUST_STD_INCLUDE(__new/device_new.h) + # include THRUST_NAMESPACE_BEGIN From cbade59e1b348b9aa9dbbac81b7cf8a605b922cb Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:34:35 -0400 Subject: [PATCH 17/48] refactor(rocthrust): CCCL 52eb28883c4 parity - simplify zip_function with _THRUST_STD::apply Related upstream commit: 52eb28883c4 Simplify thrust::zip_function (NVIDIA/cccl#6321) Related local port commit: 0d3216d8a35 Also related: 7b52284299d Rename our namespace macros (NVIDIA/cccl#5538) (the namespace fallback removed below) The port kept the local zip_detail::apply helper and the non-libhipcxx `namespace internal` path for compatibility. libhipcxx is now mandatory, so zip_function.h now matches upstream: - zip_function::operator() returns _THRUST_STD::apply(func, _THRUST_STD::forward(args)); thrust::detail::zip_detail::{apply,apply_impl} are removed. - include _THRUST_LIBCXX_INCLUDE(functional) and _THRUST_STD_INCLUDE(tuple) instead of thrust/tuple.h, thrust/type_traits/integer_sequence.h and the libcxx_wrapper fallback. - the proclaims_copyable_arguments> specialization is only declared in the libcxx namespace (_THRUST_LIBCXX_NAMESPACE_BEGIN/END). The leftover "C++11 decltype(auto) workaround" comments are removed as upstream did. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../hipccl3/rocthrust/thrust/zip_function.h | 47 ++----------------- 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/zip_function.h b/projects/hipccl/hipccl3/rocthrust/thrust/zip_function.h index a6fad4a0eaf7..06a89bbb6b59 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/zip_function.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/zip_function.h @@ -37,14 +37,9 @@ #endif // no system header #include -#include -#include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(functional) -#else -# include -#endif +#include _THRUST_LIBCXX_INCLUDE(functional) +#include _THRUST_STD_INCLUDE(tuple) THRUST_NAMESPACE_BEGIN @@ -57,29 +52,6 @@ THRUST_NAMESPACE_BEGIN * \{ */ -namespace detail -{ -namespace zip_detail -{ - -// Add workaround for decltype(auto) on C++11-only compilers: -THRUST_EXEC_CHECK_DISABLE -template -THRUST_HOST_DEVICE decltype(auto) apply_impl(Function&& func, Tuple&& args, index_sequence) -{ - return func(thrust::get(THRUST_FWD(args))...); -} - -template -THRUST_HOST_DEVICE decltype(auto) apply(Function&& func, Tuple&& args) -{ - constexpr auto tuple_size = thrust::tuple_size<_THRUST_STD::decay_t>::value; - return apply_impl(THRUST_FWD(func), THRUST_FWD(args), make_index_sequence{}); -} - -} // namespace zip_detail -} // namespace detail - /*! \p zip_function is a function object that allows the easy use of N-ary * function objects with \p zip_iterators without redefining them to take a * \p tuple instead of N arguments. @@ -148,18 +120,14 @@ class zip_function //! Default constructs the contained function object. zip_function() = default; - /*! Constructs a \p zip_function with the provided function object \p func. */ THRUST_HOST_DEVICE zip_function(Function func) : func(_THRUST_STD::move(func)) {} - /*! Applies the N-ary function object to elements of the tuple \p args. */ - // Add workaround for decltype(auto) on C++11-only compilers: - template THRUST_HOST_DEVICE decltype(auto) operator()(Tuple&& args) const { - return detail::zip_detail::apply(func, THRUST_FWD(args)); + return _THRUST_STD::apply(func, _THRUST_STD::forward(args)); } //! Returns a reference to the underlying function. @@ -194,17 +162,8 @@ THRUST_HOST_DEVICE zip_function<_THRUST_STD::decay_t> make_zip_functio THRUST_NAMESPACE_END -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_LIBCXX_NAMESPACE_BEGIN -#else -namespace internal -{ -#endif template struct proclaims_copyable_arguments> : proclaims_copyable_arguments {}; -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_LIBCXX_NAMESPACE_END -#else -} // namespace internal -#endif From 0cdce5c48fb227893256fd7c22835b57410fbe5f Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:35:48 -0400 Subject: [PATCH 18/48] refactor(rocthrust): CCCL 81b9aa5f1cc parity - remove the non-libhipcxx thrust::tuple/pair implementation Related upstream commit: 81b9aa5f1cc Move the implementation of `tuple` into its own file (NVIDIA/cccl#6336) Related local port commit: fe7ee5f965e Upstream thrust::tuple/thrust::pair are only aliases of ::cuda::std::tuple/pair. rocThrust still carried the old standalone implementation behind `#if !_THRUST_HAS_DEVICE_SYSTEM_STD` ("TODO(libhipcxx): remove this path"). libhipcxx is now mandatory, so: - thrust/tuple.h and thrust/pair.h keep only the _THRUST_STD alias branch, as upstream. - delete thrust/detail/tuple.inl and thrust/detail/pair.inl (only included by the removed branch). - drop the fallback // includes and the fallback explanation comment. The local THRUST_DOXYGEN_INVOKED spelling and the _THRUST_STD_INCLUDE(utility) include in pair.h are kept. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../hipccl3/rocthrust/thrust/detail/pair.inl | 232 ---- .../hipccl3/rocthrust/thrust/detail/tuple.inl | 1042 ----------------- .../hipccl/hipccl3/rocthrust/thrust/pair.h | 271 +---- .../hipccl/hipccl3/rocthrust/thrust/tuple.h | 798 +------------ 4 files changed, 18 insertions(+), 2325 deletions(-) delete mode 100644 projects/hipccl/hipccl3/rocthrust/thrust/detail/pair.inl delete mode 100644 projects/hipccl/hipccl3/rocthrust/thrust/detail/tuple.inl diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/pair.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/pair.inl deleted file mode 100644 index 9faa2e2429aa..000000000000 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/pair.inl +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright 2008-2021 NVIDIA Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -// TODO(libhipcxx): remove this file once libhipcxx gets ready - -#include - -#include -#include - -THRUST_NAMESPACE_BEGIN - -template - THRUST_HOST_DEVICE - pair - ::pair(void) - :first(),second() -{ - ; -} // end pair::pair() - - -template - THRUST_HOST_DEVICE - pair - ::pair(const T1 &x, const T2 &y) - :first(x),second(y) -{ - ; -} // end pair::pair() - - -template - template - THRUST_HOST_DEVICE - pair - ::pair(const pair &p) - :first(p.first),second(p.second) -{ - ; -} // end pair::pair() - - -template - template - THRUST_HOST_DEVICE - pair - ::pair(const std::pair &p) - :first(p.first),second(p.second) -{ - ; -} // end pair::pair() - - -template - inline THRUST_HOST_DEVICE - void pair - ::swap(thrust::pair &p) -{ - using thrust::swap; - - swap(first, p.first); - swap(second, p.second); -} // end pair::swap() - - -template - inline THRUST_HOST_DEVICE - bool operator==(const pair &x, const pair &y) -{ - return x.first == y.first && x.second == y.second; -} // end operator==() - - -template - inline THRUST_HOST_DEVICE - bool operator<(const pair &x, const pair &y) -{ - return x.first < y.first || (!(y.first < x.first) && x.second < y.second); -} // end operator<() - - -template - inline THRUST_HOST_DEVICE - bool operator!=(const pair &x, const pair &y) -{ - return !(x == y); -} // end operator==() - - -template - inline THRUST_HOST_DEVICE - bool operator>(const pair &x, const pair &y) -{ - return y < x; -} // end operator<() - - -template - inline THRUST_HOST_DEVICE - bool operator<=(const pair &x, const pair &y) -{ - return !(y < x); -} // end operator<=() - - -template - inline THRUST_HOST_DEVICE - bool operator>=(const pair &x, const pair &y) -{ - return !(x < y); -} // end operator>=() - - -template - inline THRUST_HOST_DEVICE - void swap(pair &x, pair &y) -{ - return x.swap(y); -} // end swap() - - -template - inline THRUST_HOST_DEVICE - pair make_pair(T1 x, T2 y) -{ - return pair(x,y); -} // end make_pair() - - -// specializations of tuple_element for pair -template - struct tuple_element<0, pair> -{ - using type = T1; -}; // end tuple_element - -template - struct tuple_element<1, pair> -{ - using type = T2; -}; // end tuple_element - - -// specialization of tuple_size for pair -template - struct tuple_size> -{ - static const unsigned int value = 2; -}; // end tuple_size - - - -namespace detail -{ - - -template struct pair_get {}; - -template - struct pair_get<0, Pair> -{ - inline THRUST_HOST_DEVICE - const typename tuple_element<0, Pair>::type & - operator()(const Pair &p) const - { - return p.first; - } // end operator()() - - inline THRUST_HOST_DEVICE - typename tuple_element<0, Pair>::type & - operator()(Pair &p) const - { - return p.first; - } // end operator()() -}; // end pair_get - - -template - struct pair_get<1, Pair> -{ - inline THRUST_HOST_DEVICE - const typename tuple_element<1, Pair>::type & - operator()(const Pair &p) const - { - return p.second; - } // end operator()() - - inline THRUST_HOST_DEVICE - typename tuple_element<1, Pair>::type & - operator()(Pair &p) const - { - return p.second; - } // end operator()() -}; // end pair_get - -} // end detail - - - -template - inline THRUST_HOST_DEVICE - typename tuple_element >::type & - get(pair &p) -{ - return detail::pair_get >()(p); -} // end get() - -template - inline THRUST_HOST_DEVICE - const typename tuple_element >::type & - get(const pair &p) -{ - return detail::pair_get >()(p); -} // end get() - -THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/tuple.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/tuple.inl deleted file mode 100644 index 5a6e7eb83e2a..000000000000 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/tuple.inl +++ /dev/null @@ -1,1042 +0,0 @@ -/* - * Copyright 2008-2021 NVIDIA Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -// TODO(libhipcxx): remove this file once libhipcxx gets ready - -#include - -#include - -THRUST_NAMESPACE_BEGIN - -THRUST_EXEC_CHECK_DISABLE -template -THRUST_HOST_DEVICE inline void swap(Assignable1& a, Assignable2& b) -{ - Assignable1 temp = a; - a = b; - b = temp; -} // end swap() - -// define null_type for backwards compatibility -struct THRUST_DEPRECATED_BECAUSE("Please remove null_type from parameters to tuple<...>") null_type -{}; - -THRUST_SUPPRESS_DEPRECATED_PUSH - -// forward declaration for tuple -template < - class T0 = null_type, class T1 = null_type, class T2 = null_type, - class T3 = null_type, class T4 = null_type, class T5 = null_type, - class T6 = null_type, class T7 = null_type, class T8 = null_type, - class T9 = null_type> -class tuple; - -THRUST_SUPPRESS_DEPRECATED_POP - -template struct tuple_element; - -template - struct tuple_element_impl -{ - private: - using Next = typename T::tail_type; - - public: - /*! The result of this metafunction is returned in \c type. - */ - using type = typename tuple_element_impl::type; -}; // end tuple_element - -template - struct tuple_element_impl<0,T> -{ - using type = typename T::head_type; -}; - -template - struct tuple_element -{ - using type = typename std::add_const::type>::type; -}; - -template -struct tuple_element -{ - using type = typename std::add_volatile::type>::type; -}; - -template - struct tuple_element -{ - using type = typename std::add_cv::type>::type; -}; - -template -struct tuple_element{ - using type = typename tuple_element_impl::type; -}; - -// forward declaration of tuple_size -template struct tuple_size; - -template - struct tuple_size : public tuple_size {}; - -template - struct tuple_size : public tuple_size {}; - -template - struct tuple_size : public tuple_size {}; - -THRUST_SUPPRESS_DEPRECATED_PUSH - -/*! This metafunction returns the number of elements - * of a \p tuple type of interest. - * - * \tparam T A \c tuple type of interest. - * - * \see pair - * \see tuple - */ -template - struct tuple_size -{ - /*! The result of this metafunction is returned in \c value. - */ - static const int value = 1 + tuple_size::value; -}; // end tuple_size - -THRUST_SUPPRESS_DEPRECATED_POP - -// specializations for tuple_size -template<> - struct tuple_size< tuple<> > -{ - static const int value = 0; -}; // end tuple_size< tuple<> > - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> - struct tuple_size -{ - static const int value = 0; -}; // end tuple_size - -THRUST_SUPPRESS_DEPRECATED_POP - -// forward declaration of detail::cons -namespace detail -{ - -template struct cons; - -} // end detail - - -// -- some traits classes for get functions -template struct access_traits -{ - using const_type = const T&; - using non_const_type = T&; - - using parameter_type = const typename ::std::remove_cv::type&; - -// used as the tuple constructors parameter types -// Rationale: non-reference tuple element types can be cv-qualified. -// It should be possible to initialize such types with temporaries, -// and when binding temporaries to references, the reference must -// be non-volatile and const. 8.5.3. (5) -}; // end access_traits - -template struct access_traits -{ - using const_type = T&; - using non_const_type = T&; - - using parameter_type = T&; -}; // end access_traits - -// forward declarations of get() -template -THRUST_HOST_DEVICE -inline typename access_traits< - typename tuple_element >::type - >::non_const_type -// XXX we probably don't need to do this for any compiler we care about -jph -//get(cons& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)); -get(detail::cons& c); - -template -THRUST_HOST_DEVICE -inline typename access_traits< - typename tuple_element >::type - >::const_type -// XXX we probably don't need to do this for any compiler we care about -jph -//get(const cons& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)); -get(const detail::cons& c); - -namespace detail -{ - -// -- generate error template, referencing to non-existing members of this -// template is used to produce compilation errors intentionally -template -class generate_error; - -// - cons getters -------------------------------------------------------- -// called: get_class::get(aTuple) - -template< int N > -struct get_class -{ - template - THRUST_HOST_DEVICE - inline static RET get(const cons& t) - { - // XXX we may not need to deal with this for any compiler we care about -jph - //return get_class::BOOST_NESTED_TEMPLATE get(t.tail); - return get_class::template get(t.tail); - - // gcc 4.3 couldn't compile this: - //return get_class::get(t.tail); - } - - template - THRUST_HOST_DEVICE - inline static RET get(cons& t) - { - // XXX we may not need to deal with this for any compiler we care about -jph - //return get_class::BOOST_NESTED_TEMPLATE get(t.tail); - return get_class::template get(t.tail); - - // gcc 4.3 couldn't compile this: - //return get_class::get(t.tail); - } -}; // end get_class - -template<> -struct get_class<0> -{ - template - THRUST_HOST_DEVICE - inline static RET get(const cons& t) - { - return t.head; - } - - template - THRUST_HOST_DEVICE - inline static RET get(cons& t) - { - return t.head; - } -}; // get get_class<0> - - -template struct IF -{ - using RET = Then; -}; - -template struct IF -{ - using RET = Else; -}; - -// These helper templates wrap void types and plain function types. -// The rationale is to allow one to write tuple types with those types -// as elements, even though it is not possible to instantiate such object. -// E.g: using some_type = tuple; // ok -// but: some_type x; // fails - -template class non_storeable_type -{ - THRUST_HOST_DEVICE - non_storeable_type(); -}; - -template struct wrap_non_storeable_type -{ - // XXX is_function looks complicated; punt for now -jph - //typedef typename IF< - // THRUST_NS_QUALIFIER::detail::is_function::value, non_storeable_type, T - //>::RET type; - - using type = T; -}; - -template <> struct wrap_non_storeable_type -{ - using type = non_storeable_type; -}; - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template - struct cons -{ - using head_type = HT; - using tail_type = TT; - - using stored_head_type = typename - wrap_non_storeable_type::type; - - stored_head_type head; - tail_type tail; - - inline THRUST_HOST_DEVICE - typename access_traits::non_const_type - get_head() { return head; } - - inline THRUST_HOST_DEVICE - typename access_traits::non_const_type - get_tail() { return tail; } - - inline THRUST_HOST_DEVICE - typename access_traits::const_type - get_head() const { return head; } - - inline THRUST_HOST_DEVICE - typename access_traits::const_type - get_tail() const { return tail; } - - inline THRUST_HOST_DEVICE - cons(void) : head(), tail() {} - // cons() : head(detail::default_arg::f()), tail() {} - - // the argument for head is not strictly needed, but it prevents - // array type elements. This is good, since array type elements - // cannot be supported properly in any case (no assignment, - // copy works only if the tails are exactly the same type, ...) - - inline THRUST_HOST_DEVICE - cons(typename access_traits::parameter_type h, - const tail_type& t) - : head (h), tail(t) {} - - template - inline THRUST_HOST_DEVICE - cons( T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, - T6& t6, T7& t7, T8& t8, T9& t9, T10& t10 ) - : head (t1), - tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, static_cast(null_type())) - {} - - template - inline THRUST_HOST_DEVICE - cons( const null_type& /*t1*/, T2& t2, T3& t3, T4& t4, T5& t5, - T6& t6, T7& t7, T8& t8, T9& t9, T10& t10 ) - : head (), - tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, static_cast(null_type())) - {} - - - template - inline THRUST_HOST_DEVICE - cons( const cons& u ) : head(u.head), tail(u.tail) {} - - template - inline THRUST_HOST_DEVICE - cons( const cons& u ) : head(u.head), tail() {} - - cons(const cons &) = default; - - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE - cons& operator=( const cons& u ) { - head = u.head; - tail = thrust::null_type(); - return *this; - } - - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE - cons& operator=( const cons& u ) { - head=u.head; tail=u.tail; return *this; - } - - // must define assignment operator explicitly, implicit version is - // illformed if HT is a reference (12.8. (12)) - THRUST_EXEC_CHECK_DISABLE - inline THRUST_HOST_DEVICE - cons& operator=(const cons& u) { - head = u.head; tail = u.tail; return *this; - } - - // XXX enable when we support std::pair -jph - //template - //THRUST_HOST_DEVICE - //cons& operator=( const std::pair& u ) { - // //BOOST_STATIC_ASSERT(length::value == 2); // check length = 2 - // head = u.first; tail.head = u.second; return *this; - //} - - // get member functions (non-const and const) - template - THRUST_HOST_DEVICE - typename access_traits< - typename tuple_element >::type - >::non_const_type - get() { - return thrust::get(*this); // delegate to non-member get - } - - template - THRUST_HOST_DEVICE - typename access_traits< - typename tuple_element >::type - >::const_type - get() const { - return thrust::get(*this); // delegate to non-member get - } - - inline THRUST_HOST_DEVICE - void swap(cons &c) - { - using thrust::swap; - - swap(head, c.head); - tail.swap(c.tail); - } -}; - -template - struct cons -{ - using head_type = HT; - using tail_type = null_type; - using self_type = cons; - - using stored_head_type = typename - wrap_non_storeable_type::type; - stored_head_type head; - - typename access_traits::non_const_type - inline THRUST_HOST_DEVICE - get_head() { return head; } - - inline THRUST_HOST_DEVICE - null_type get_tail() { return null_type(); } - - inline THRUST_HOST_DEVICE - typename access_traits::const_type - get_head() const { return head; } - - inline THRUST_HOST_DEVICE - null_type get_tail() const { return null_type(); } - - inline THRUST_HOST_DEVICE - cons() : head() {} - - inline THRUST_HOST_DEVICE - cons(typename access_traits::parameter_type h, - const null_type& = null_type()) - : head (h) {} - - template - inline THRUST_HOST_DEVICE - cons(T1& t1, const null_type&, const null_type&, const null_type&, - const null_type&, const null_type&, const null_type&, - const null_type&, const null_type&, const null_type&) - : head (t1) {} - - inline THRUST_HOST_DEVICE - cons(const null_type&, - const null_type&, const null_type&, const null_type&, - const null_type&, const null_type&, const null_type&, - const null_type&, const null_type&, const null_type&) - : head () {} - - template - inline THRUST_HOST_DEVICE - cons( const cons& u ) : head(u.head) {} - - cons(const cons &) = default; - - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE - cons& operator=(const cons& u ) - { - head = u.head; - return *this; - } - - // must define assignment operator explicitly, implicit version - // is illformed if HT is a reference - inline THRUST_HOST_DEVICE - cons& operator=(const cons& u) { head = u.head; return *this; } - - template - inline THRUST_HOST_DEVICE - typename access_traits< - typename tuple_element::type - >::non_const_type - // XXX we probably don't need this for the compilers we care about -jph - //get(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) - get(void) - { - return thrust::get(*this); - } - - template - inline THRUST_HOST_DEVICE - typename access_traits< - typename tuple_element::type - >::const_type - // XXX we probably don't need this for the compilers we care about -jph - //get(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) const - get(void) const - { - return thrust::get(*this); - } - - inline THRUST_HOST_DEVICE - void swap(cons &c) - { - using thrust::swap; - - swap(head, c.head); - } -}; // end cons - -template - struct map_tuple_to_cons -{ - using type = cons::type>; -}; // end map_tuple_to_cons - -// The empty tuple is a null_type -template <> - struct map_tuple_to_cons -{ - using type = null_type; -}; // end map_tuple_to_cons<...> - -THRUST_SUPPRESS_DEPRECATED_POP - -// --------------------------------------------------------------------------- -// The call_traits for make_tuple - -// Must be instantiated with plain or const plain types (not with references) - -// from template foo(const T& t) : make_tuple_traits::type -// from template foo(T& t) : make_tuple_traits::type - -// Conversions: -// T -> T, -// references -> compile_time_error -// array -> const ref array - - -template -struct make_tuple_traits { - using type = T; - - // commented away, see below (JJ) - // typedef typename IF< - // boost::is_function::value, - // T&, - // T>::RET type; - -}; - -// The is_function test was there originally for plain function types, -// which can't be stored as such (we must either store them as references or -// pointers). Such a type could be formed if make_tuple was called with a -// reference to a function. -// But this would mean that a const qualified function type was formed in -// the make_tuple function and hence make_tuple can't take a function -// reference as a parameter, and thus T can't be a function type. -// So is_function test was removed. -// (14.8.3. says that type deduction fails if a cv-qualified function type -// is created. (It only applies for the case of explicitly specifying template -// args, though?)) (JJ) - -template -struct make_tuple_traits { - using error = typename detail::generate_error::do_not_use_with_reference_type; -}; - -// Arrays can't be stored as plain types; convert them to references. -// All arrays are converted to const. This is because make_tuple takes its -// parameters as const T& and thus the knowledge of the potential -// non-constness of actual argument is lost. -template struct make_tuple_traits { - using type = const T (&)[n]; -}; - -template -struct make_tuple_traits { - using type = const T (&)[n]; -}; - -template struct make_tuple_traits { - using type = const volatile T (&)[n]; -}; - -template -struct make_tuple_traits { - using type = const volatile T (&)[n]; -}; - -// XXX enable these if we ever care about reference_wrapper -jph -//template -//struct make_tuple_traits >{ -// using type = T&; -//}; -// -//template -//struct make_tuple_traits >{ -// using type = T&; -//}; - -THRUST_SUPPRESS_DEPRECATED_PUSH - -// a helper traits to make the make_tuple functions shorter (Vesa Karvonen's -// suggestion) -template < - class T0 = null_type, class T1 = null_type, class T2 = null_type, - class T3 = null_type, class T4 = null_type, class T5 = null_type, - class T6 = null_type, class T7 = null_type, class T8 = null_type, - class T9 = null_type -> -struct make_tuple_mapper { - using type = tuple::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type, - typename make_tuple_traits::type>; -}; - -THRUST_SUPPRESS_DEPRECATED_POP - -} // end detail - - -template -THRUST_HOST_DEVICE -inline typename access_traits< - typename tuple_element >::type - >::non_const_type -get(detail::cons& c) -{ - //return detail::get_class::BOOST_NESTED_TEMPLATE - - // gcc 4.3 couldn't compile this: - //return detail::get_class:: - - return detail::get_class::template - get< - typename access_traits< - typename tuple_element >::type - >::non_const_type, - HT,TT - >(c); -} - - -// get function for const cons-lists, returns a const reference to -// the element. If the element is a reference, returns the reference -// as such (that is, can return a non-const reference) -template -THRUST_HOST_DEVICE -inline typename access_traits< - typename tuple_element >::type - >::const_type -get(const detail::cons& c) -{ - //return detail::get_class::BOOST_NESTED_TEMPLATE - - // gcc 4.3 couldn't compile this: - //return detail::get_class:: - - return detail::get_class::template - get< - typename access_traits< - typename tuple_element >::type - >::const_type, - HT,TT - >(c); -} - - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4,t5); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4,t5,t6); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4,t5,t6,t7); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4,t5,t6,t7,t8); -} // end make_tuple() - -template -THRUST_HOST_DEVICE inline - typename detail::make_tuple_mapper::type - make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9) -{ - using t = typename detail::make_tuple_mapper::type; - return t(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9); -} // end make_tuple() - - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0) -{ - return tuple(t0); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1) -{ - return tuple(t0,t1); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2) -{ - return tuple(t0,t1,t2); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3) -{ - return tuple(t0,t1,t2,t3); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4) -{ - return tuple(t0,t1,t2,t3,t4); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5) -{ - return tuple(t0,t1,t2,t3,t4,t5); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6) -{ - return tuple(t0,t1,t2,t3,t4,t5,t6); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6, T7 &t7) -{ - return tuple(t0,t1,t2,t3,t4,t5,t6,t7); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8) -{ - return tuple(t0,t1,t2,t3,t4,t5,t6,t7,t8); -} - -template -THRUST_HOST_DEVICE inline -tuple tie(T0 &t0, T1 &t1, T2 &t2, T3 &t3, T4 &t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8, T9 &t9) -{ - return tuple(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9); -} - -template< - typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, - typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9 -> -THRUST_HOST_DEVICE inline -void swap(thrust::tuple &x, - thrust::tuple &y) -{ - return x.swap(y); -} - - - -namespace detail -{ - -template -THRUST_HOST_DEVICE -inline bool eq(const T1& lhs, const T2& rhs) { - return lhs.get_head() == rhs.get_head() && - eq(lhs.get_tail(), rhs.get_tail()); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool eq(const null_type&, const null_type&) { return true; } - -THRUST_SUPPRESS_DEPRECATED_POP - -template -THRUST_HOST_DEVICE -inline bool neq(const T1& lhs, const T2& rhs) { - return lhs.get_head() != rhs.get_head() || - neq(lhs.get_tail(), rhs.get_tail()); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool neq(const null_type&, const null_type&) { return false; } - -THRUST_SUPPRESS_DEPRECATED_POP - -template -THRUST_HOST_DEVICE -inline bool lt(const T1& lhs, const T2& rhs) { - return (lhs.get_head() < rhs.get_head()) || - (!(rhs.get_head() < lhs.get_head()) && - lt(lhs.get_tail(), rhs.get_tail())); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool lt(const null_type&, const null_type&) { return false; } - -THRUST_SUPPRESS_DEPRECATED_POP - -template -THRUST_HOST_DEVICE -inline bool gt(const T1& lhs, const T2& rhs) { - return (lhs.get_head() > rhs.get_head()) || - (!(rhs.get_head() > lhs.get_head()) && - gt(lhs.get_tail(), rhs.get_tail())); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool gt(const null_type&, const null_type&) { return false; } - -THRUST_SUPPRESS_DEPRECATED_POP - -template -THRUST_HOST_DEVICE -inline bool lte(const T1& lhs, const T2& rhs) { - return lhs.get_head() <= rhs.get_head() && - ( !(rhs.get_head() <= lhs.get_head()) || - lte(lhs.get_tail(), rhs.get_tail())); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool lte(const null_type&, const null_type&) { return true; } - -THRUST_SUPPRESS_DEPRECATED_POP - -template -THRUST_HOST_DEVICE -inline bool gte(const T1& lhs, const T2& rhs) { - return lhs.get_head() >= rhs.get_head() && - ( !(rhs.get_head() >= lhs.get_head()) || - gte(lhs.get_tail(), rhs.get_tail())); -} - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template<> -THRUST_HOST_DEVICE -inline bool gte(const null_type&, const null_type&) { return true; } - -THRUST_SUPPRESS_DEPRECATED_POP - -} // end detail - - - -// equal ---- - -template -THRUST_HOST_DEVICE -inline bool operator==(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::eq(lhs, rhs); -} // end operator==() - -// not equal ----- - -template -THRUST_HOST_DEVICE -inline bool operator!=(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::neq(lhs, rhs); -} // end operator!=() - -// < -template -THRUST_HOST_DEVICE -inline bool operator<(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::lt(lhs, rhs); -} // end operator<() - -// > -template -THRUST_HOST_DEVICE -inline bool operator>(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::gt(lhs, rhs); -} // end operator>() - -// <= -template -THRUST_HOST_DEVICE -inline bool operator<=(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::lte(lhs, rhs); -} // end operator<=() - -// >= -template -THRUST_HOST_DEVICE -inline bool operator>=(const detail::cons& lhs, const detail::cons& rhs) -{ - // XXX support this eventually -jph - //// check that tuple lengths are equal - //BOOST_STATIC_ASSERT(tuple_size::value == tuple_size::value); - - return detail::gte(lhs, rhs); -} // end operator>=() - -THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/pair.h b/projects/hipccl/hipccl3/rocthrust/thrust/pair.h index 712d2857c2c2..400fddf58263 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/pair.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/pair.h @@ -33,8 +33,6 @@ #include _THRUST_STD_INCLUDE(utility) -#if _THRUST_HAS_DEVICE_SYSTEM_STD - THRUST_NAMESPACE_BEGIN /*! \addtogroup utility @@ -52,12 +50,12 @@ THRUST_NAMESPACE_BEGIN * \tparam N This parameter selects the member of interest. * \tparam T A \c pair type of interest. */ -# ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen +#ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen template using tuple_element = _THRUST_STD::tuple_element; -# else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv +#else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv using _THRUST_STD::tuple_element; -# endif // THRUST_DOXYGEN_INVOKED +#endif // THRUST_DOXYGEN_INVOKED /*! This convenience metafunction is included for compatibility with * \p tuple. It returns \c 2, the number of elements of a \p pair, @@ -65,12 +63,12 @@ using _THRUST_STD::tuple_element; * * \tparam Pair A \c pair type of interest. */ -# ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen +#ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen template using tuple_size = _THRUST_STD::tuple_size; -# else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv +#else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv using _THRUST_STD::tuple_size; -# endif // THRUST_DOXYGEN_INVOKED +#endif // THRUST_DOXYGEN_INVOKED /*! \p pair is a generic data structure encapsulating a heterogeneous * pair of values. @@ -83,12 +81,12 @@ using _THRUST_STD::tuple_size; * requirements on the type of \p T2. T2's type is * provided by pair::second_type. */ -# ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen +#ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen template using pair = _THRUST_STD::pair; -# else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv +#else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv using _THRUST_STD::pair; -# endif // THRUST_DOXYGEN_INVOKED +#endif // THRUST_DOXYGEN_INVOKED using _THRUST_STD::get; using _THRUST_STD::make_pair; @@ -100,254 +98,3 @@ using _THRUST_STD::make_pair; */ THRUST_NAMESPACE_END - -#else // TODO(libhipcxx): remove this path of code once libhipcxx gets ready - -THRUST_NAMESPACE_BEGIN - -/*! \addtogroup utility - * \{ - */ - -/*! \addtogroup pair - * \{ - */ - -/*! \p pair is a generic data structure encapsulating a heterogeneous - * pair of values. - * - * \tparam T1 The type of \p pair's first object type. There are no - * requirements on the type of \p T1. T1's type is - * provided by pair::first_type. - * - * \tparam T2 The type of \p pair's second object type. There are no - * requirements on the type of \p T2. T2's type is - * provided by pair::second_type. - */ -template -struct pair -{ - /*! \p first_type is the type of \p pair's first object type. - */ - using first_type = T1; - - /*! \p second_type is the type of \p pair's second object type. - */ - using second_type = T2; - - /*! The \p pair's first object. - */ - first_type first; - - /*! The \p pair's second object. - */ - second_type second; - - /*! \p pair's default constructor constructs \p first - * and \p second using \c first_type & \c second_type's - * default constructors, respectively. - */ - THRUST_HOST_DEVICE pair(void); - - /*! This constructor accepts two objects to copy into this \p pair. - * - * \param x The object to copy into \p first. - * \param y The object to copy into \p second. - */ - inline THRUST_HOST_DEVICE pair(const T1& x, const T2& y); - - /*! This copy constructor copies from a \p pair whose types are - * convertible to this \p pair's \c first_type and \c second_type, - * respectively. - * - * \param p The \p pair to copy from. - * - * \tparam U1 is convertible to \c first_type. - * \tparam U2 is convertible to \c second_type. - */ - template - inline THRUST_HOST_DEVICE pair(const pair& p); - - /*! This copy constructor copies from a std::pair whose types are - * convertible to this \p pair's \c first_type and \c second_type, - * respectively. - * - * \param p The std::pair to copy from. - * - * \tparam U1 is convertible to \c first_type. - * \tparam U2 is convertible to \c second_type. - */ - template - inline THRUST_HOST_DEVICE pair(const std::pair& p); - - /*! \p swap swaps the elements of two pairs. - * - * \param p The other pair with which to swap. - */ - inline THRUST_HOST_DEVICE void swap(pair& p); -}; // end pair - -/*! This operator tests two \p pairs for equality. - * - * \param x The first \p pair to compare. - * \param y The second \p pair to compare. - * \return \c true if and only if x.first == y.first && x.second == y.second. - * - * \tparam T1 is a model of Equality - * Comparable. \tparam T2 is a model of Equality Comparable. - */ -template -inline THRUST_HOST_DEVICE bool operator==(const pair& x, const pair& y); - -/*! This operator tests two pairs for ascending ordering. - * - * \param x The first \p pair to compare. - * \param y The second \p pair to compare. - * \return \c true if and only if x.first < y.first || (!(y.first < x.first) && x.second < y.second). - * - * \tparam T1 is a model of LessThan - * Comparable. \tparam T2 is a model of LessThan Comparable. - */ -template -inline THRUST_HOST_DEVICE bool operator<(const pair& x, const pair& y); - -/*! This operator tests two pairs for inequality. - * - * \param x The first \p pair to compare. - * \param y The second \p pair to compare. - * \return \c true if and only if !(x == y). - * - * \tparam T1 is a model of Equality - * Comparable. \tparam T2 is a model of Equality Comparable. - */ -template -inline THRUST_HOST_DEVICE bool operator!=(const pair& x, const pair& y); - -/*! This operator tests two pairs for descending ordering. - * - * \param x The first \p pair to compare. - * \param y The second \p pair to compare. - * \return \c true if and only if y < x. - * - * \tparam T1 is a model of LessThan - * Comparable. \tparam T2 is a model of LessThan Comparable. - */ -template -inline THRUST_HOST_DEVICE bool operator>(const pair& x, const pair& y); - -/*! This operator tests two pairs for ascending ordering or equivalence. - * - * \param x The first \p pair to compare. - * \param y The second \p pair to compare. - * \return \c true if and only if !(y < x). - * - * \tparam T1 is a model of LessThan - * Comparable. \tparam T2 is a model of LessThan Comparable. - */ -template -inline THRUST_HOST_DEVICE bool operator<=(const pair& x, const pair& y); - -/*! This operator tests two pairs for descending ordering or equivalence. - * - * \param x The first \p pair to compare. - * \param y The second \p pair to compare. - * \return \c true if and only if !(x < y). - * - * \tparam T1 is a model of LessThan - * Comparable. \tparam T2 is a model of LessThan Comparable. - */ -template -inline THRUST_HOST_DEVICE bool operator>=(const pair& x, const pair& y); - -/*! \p swap swaps the contents of two pairs. - * - * \param x The first \p pair to swap. - * \param y The second \p pair to swap. - */ -template -inline THRUST_HOST_DEVICE void swap(pair& x, pair& y); - -/*! This convenience function creates a \p pair from two objects. - * - * \param x The first object to copy from. - * \param y The second object to copy from. - * \return A newly-constructed \p pair copied from \p a and \p b. - * - * \tparam T1 There are no requirements on the type of \p T1. - * \tparam T2 There are no requirements on the type of \p T2. - */ -template -inline THRUST_HOST_DEVICE pair make_pair(T1 x, T2 y); - -/*! \cond - */ - -/*! This convenience metafunction is included for compatibility with - * \p tuple. It returns either the type of a \p pair's - * \c first_type or \c second_type in its nested type, \c type. - * - * \tparam N This parameter selects the member of interest. - * \tparam T A \c pair type of interest. - */ -template <::std::size_t N, class T> -struct tuple_element; - -/*! This convenience metafunction is included for compatibility with - * \p tuple. It returns \c 2, the number of elements of a \p pair, - * in its nested data member, \c value. - * - * \tparam Pair A \c pair type of interest. - */ -template -struct tuple_size; - -/*! \endcond - */ - -/*! This convenience function returns a reference to either the first or - * second member of a \p pair. - * - * \param p The \p pair of interest. - * \return \c p.first or \c p.second, depending on the template - * parameter. - * - * \tparam N This parameter selects the member of interest. - */ -// XXX comment out these prototypes as a WAR to a problem on MSVC 2005 -// template -// inline __host__ __device__ -// typename tuple_element >::type & -// get(pair &p); - -/*! This convenience function returns a const reference to either the - * first or second member of a \p pair. - * - * \param p The \p pair of interest. - * \return \c p.first or \c p.second, depending on the template - * parameter. - * - * \tparam i This parameter selects the member of interest. - */ -// XXX comment out these prototypes as a WAR to a problem on MSVC 2005 -// template -// inline __host__ __device__ -// const typename tuple_element >::type & -// get(const pair &p); - -/*! \} // pair - */ - -/*! \} // utility - */ - -THRUST_NAMESPACE_END - -# include - -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/tuple.h b/projects/hipccl/hipccl3/rocthrust/thrust/tuple.h index 597f8c80868e..7e74427db885 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/tuple.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/tuple.h @@ -42,17 +42,6 @@ #include _THRUST_STD_INCLUDE(tuple) -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -# include -#endif - -// If 'libcudacxx' or 'libhipcxx' is available (_THRUST_HAS_DEVICE_SYSTEM_STD), we will -// use the implementations provided there. Otherwise we will fall back to an older -// implementation of thrust::tuple. -#if _THRUST_HAS_DEVICE_SYSTEM_STD - THRUST_NAMESPACE_BEGIN /*! \addtogroup utility @@ -72,12 +61,12 @@ THRUST_NAMESPACE_BEGIN * \see pair * \see tuple */ -# ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen +#ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen template using tuple_element = _THRUST_STD::tuple_element; -# else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv +#else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv using _THRUST_STD::tuple_element; -# endif // THRUST_DOXYGEN_INVOKED +#endif // THRUST_DOXYGEN_INVOKED /*! This metafunction returns the number of elements * of a \p tuple type of interest. @@ -87,12 +76,12 @@ using _THRUST_STD::tuple_element; * \see pair * \see tuple */ -# ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen +#ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen template using tuple_size = _THRUST_STD::tuple_size; -# else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv +#else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv using _THRUST_STD::tuple_size; -# endif // THRUST_DOXYGEN_INVOKED +#endif // THRUST_DOXYGEN_INVOKED /*! \brief \p tuple is a heterogeneous, fixed-size collection of values. * An instantiation of \p tuple with two arguments is similar to an @@ -131,12 +120,12 @@ using _THRUST_STD::tuple_size; * \see tuple_size * \see tie */ -# ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen +#ifdef THRUST_DOXYGEN_INVOKED // Provide a fake alias for doxygen template using tuple = _THRUST_STD::tuple; -# else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv +#else // ^^^ THRUST_DOXYGEN_INVOKED ^^^ / vvv !THRUST_DOXYGEN_INVOKED vvv using _THRUST_STD::tuple; -# endif // THRUST_DOXYGEN_INVOKED +#endif // THRUST_DOXYGEN_INVOKED using _THRUST_STD::get; using _THRUST_STD::make_tuple; @@ -149,772 +138,3 @@ using _THRUST_STD::tie; */ THRUST_NAMESPACE_END - -#else // TODO(libhipcxx): remove this path of code once libhipcxx gets ready - -# include -# include - -THRUST_NAMESPACE_BEGIN - -/*! \addtogroup utility - * \{ - */ - -/*! \addtogroup tuple - * \{ - */ - -/*! This metafunction returns the type of a - * \p tuple's Nth element. - * - * \tparam N This parameter selects the element of interest. - * \tparam T A \c tuple type of interest. - * - * \see pair - * \see tuple - */ -template -struct tuple_element; - -/*! This metafunction returns the number of elements - * of a \p tuple type of interest. - * - * \tparam T A \c tuple type of interest. - * - * \see pair - * \see tuple - */ -template -struct tuple_size; - -// get function for non-const cons-lists, returns a reference to the element - -/*! The \p get function returns a reference to a \p tuple element of - * interest. - * - * \param t A reference to a \p tuple of interest. - * \return A reference to \p t's Nth element. - * - * \tparam N The index of the element of interest. - * - * The following code snippet demonstrates how to use \p get to print - * the value of a \p tuple element. - * - * \code - * #include - * #include - * ... - * thrust::tuple t(13, "thrust"); - * - * std::cout << "The 1st value of t is " << thrust::get<0>(t) << std::endl; - * \endcode - * - * \see pair - * \see tuple - */ -template -THRUST_HOST_DEVICE inline typename access_traits>::type>::non_const_type -get(detail::cons& t); - -/*! The \p get function returns a \c const reference to a \p tuple element of - * interest. - * - * \param t A reference to a \p tuple of interest. - * \return A \c const reference to \p t's Nth element. - * - * \tparam N The index of the element of interest. - * - * The following code snippet demonstrates how to use \p get to print - * the value of a \p tuple element. - * - * \code - * #include - * #include - * ... - * thrust::tuple t(13, "thrust"); - * - * std::cout << "The 1st value of t is " << thrust::get<0>(t) << std::endl; - * \endcode - * - * \see pair - * \see tuple - */ -template -THRUST_HOST_DEVICE inline typename access_traits>::type>::const_type -get(const detail::cons& t); - -/*! Constructs a \p tuple from a variadic list of types \p Ts, allowing the \p tuple to deduce - * its type as \p tuple based on the types of the provided arguments. - * - * \tparam Ts... The parameter pack of types that will determine the tuple's type. - * \note This deduction guide enables automatic type deduction for variadic arguments - * when constructing a \p tuple. - * \see tuple - */ -template -tuple(Ts...) -> tuple; - -/*! \cond - */ - -/*! A \p pair is a structure template holding two elements of types \p T1 and \p T2. - * - * \tparam T1 The type of the first element in the \p pair. - * \tparam T2 The type of the second element in the \p pair. - * \note \p pair is used to store two heterogeneous values and can be converted to a \p tuple. - * \see tuple - */ -template -struct pair; - -/*! \endcond - */ - -/*! Constructs a \p tuple from a \p pair, unpacking its elements to initialize - * the tuple as \p tuple. - * - * \tparam T1 The type of the first element in the \p pair. - * \tparam T2 The type of the second element in the \p pair. - * \note This deduction guide allows a \p tuple to be created directly from a \p pair, - * simplifying the type conversion. - * \see pair - * \see tuple - */ -template -tuple(pair) -> tuple; - -THRUST_SUPPRESS_DEPRECATED_PUSH - -/*! \brief \p tuple is a class template that can be instantiated with up to ten - * arguments. Each template argument specifies the type of element in the \p - * tuple. Consequently, tuples are heterogeneous, fixed-size collections of - * values. An instantiation of \p tuple with two arguments is similar to an - * instantiation of \p pair with the same two arguments. Individual elements - * of a \p tuple may be accessed with the \p get function. - * - * \tparam TN The type of the N \c tuple element. Thrust's \p tuple - * type currently supports up to ten elements. - * - * The following code snippet demonstrates how to create a new \p tuple object - * and inspect and modify the value of its elements. - * - * \code - * #include - * #include - * - * int main() { - * // Create a tuple containing an `int`, a `float`, and a string. - * thrust::tuple t(13, 0.1f, "thrust"); - * - * // Individual members are accessed with the free function `get`. - * std::cout << "The first element's value is " << thrust::get<0>(t) << std::endl; - * - * // ... or the member function `get`. - * std::cout << "The second element's value is " << t.get<1>() << std::endl; - * - * // We can also modify elements with the same function. - * thrust::get<0>(t) += 10; - * } - * \endcode - * - * \see pair - * \see get - * \see make_tuple - * \see tuple_element - * \see tuple_size - * \see tie - */ -template -class tuple - /*! \cond - */ - : public detail::map_tuple_to_cons::type -/*! \endcond - */ -{ - /*! \cond - */ - -private: - using inherited = typename detail::map_tuple_to_cons::type; - - /*! \endcond - */ - -public: - /*! \p tuple's no-argument constructor initializes each element. - */ - inline THRUST_HOST_DEVICE tuple(void) {} - - /*! \p tuple's one-argument constructor copy constructs the first element from the given parameter - * and intializes all other elements. - * \param t0 The value to assign to this \p tuple's first element. - */ - inline THRUST_HOST_DEVICE tuple(typename access_traits::parameter_type t0) - : inherited( - t0, - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type())) - {} - - /*! \p tuple's one-argument constructor copy constructs the first two elements from the given parameters - * and intializes all other elements. - * \param t0 The value to assign to this \p tuple's first element. - * \param t1 The value to assign to this \p tuple's second element. - * \note \p tuple's constructor has ten variants of this form, the rest of which are ommitted here for brevity. - */ - inline THRUST_HOST_DEVICE - tuple(typename access_traits::parameter_type t0, typename access_traits::parameter_type t1) - : inherited( - t0, - t1, - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type())) - {} - - /*! \cond - */ - - inline THRUST_HOST_DEVICE tuple(typename access_traits::parameter_type t0, - typename access_traits::parameter_type t1, - typename access_traits::parameter_type t2) - : inherited( - t0, - t1, - t2, - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type())) - {} - - inline THRUST_HOST_DEVICE - tuple(typename access_traits::parameter_type t0, - typename access_traits::parameter_type t1, - typename access_traits::parameter_type t2, - typename access_traits::parameter_type t3) - : inherited( - t0, - t1, - t2, - t3, - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type())) - {} - - inline THRUST_HOST_DEVICE - tuple(typename access_traits::parameter_type t0, - typename access_traits::parameter_type t1, - typename access_traits::parameter_type t2, - typename access_traits::parameter_type t3, - typename access_traits::parameter_type t4) - : inherited( - t0, - t1, - t2, - t3, - t4, - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type())) - {} - - inline THRUST_HOST_DEVICE - tuple(typename access_traits::parameter_type t0, - typename access_traits::parameter_type t1, - typename access_traits::parameter_type t2, - typename access_traits::parameter_type t3, - typename access_traits::parameter_type t4, - typename access_traits::parameter_type t5) - : inherited( - t0, - t1, - t2, - t3, - t4, - t5, - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type())) - {} - - inline THRUST_HOST_DEVICE - tuple(typename access_traits::parameter_type t0, - typename access_traits::parameter_type t1, - typename access_traits::parameter_type t2, - typename access_traits::parameter_type t3, - typename access_traits::parameter_type t4, - typename access_traits::parameter_type t5, - typename access_traits::parameter_type t6) - : inherited( - t0, - t1, - t2, - t3, - t4, - t5, - t6, - static_cast(null_type()), - static_cast(null_type()), - static_cast(null_type())) - {} - - inline THRUST_HOST_DEVICE tuple( - typename access_traits::parameter_type t0, - typename access_traits::parameter_type t1, - typename access_traits::parameter_type t2, - typename access_traits::parameter_type t3, - typename access_traits::parameter_type t4, - typename access_traits::parameter_type t5, - typename access_traits::parameter_type t6, - typename access_traits::parameter_type t7) - : inherited( - t0, - t1, - t2, - t3, - t4, - t5, - t6, - t7, - static_cast(null_type()), - static_cast(null_type())) - {} - - inline THRUST_HOST_DEVICE tuple( - typename access_traits::parameter_type t0, - typename access_traits::parameter_type t1, - typename access_traits::parameter_type t2, - typename access_traits::parameter_type t3, - typename access_traits::parameter_type t4, - typename access_traits::parameter_type t5, - typename access_traits::parameter_type t6, - typename access_traits::parameter_type t7, - typename access_traits::parameter_type t8) - : inherited(t0, t1, t2, t3, t4, t5, t6, t7, t8, static_cast(null_type())) - {} - - inline THRUST_HOST_DEVICE tuple( - typename access_traits::parameter_type t0, - typename access_traits::parameter_type t1, - typename access_traits::parameter_type t2, - typename access_traits::parameter_type t3, - typename access_traits::parameter_type t4, - typename access_traits::parameter_type t5, - typename access_traits::parameter_type t6, - typename access_traits::parameter_type t7, - typename access_traits::parameter_type t8, - typename access_traits::parameter_type t9) - : inherited(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) - {} - - template - inline THRUST_HOST_DEVICE tuple(const detail::cons& p) - : inherited(p) - {} - - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE tuple& operator=(const detail::cons& k) - { - inherited::operator=(k); - return *this; - } - - /*! \endcond - */ - - /*! This assignment operator allows assigning the first two elements of this \p tuple from a \p pair. - * \param k A \p pair to assign from. - */ - THRUST_EXEC_CHECK_DISABLE - template - THRUST_HOST_DEVICE inline tuple& operator=(const thrust::pair& k) - { - // BOOST_STATIC_ASSERT(length::value == 2);// check_length = 2 - this->head = k.first; - this->tail.head = k.second; - return *this; - } - - /*! \p swap swaps the elements of two tuples. - * - * \param t The other tuple with which to swap. - */ - inline THRUST_HOST_DEVICE void swap(tuple& t) - { - inherited::swap(t); - } -}; - -/*! \cond - */ - -template <> -class tuple - : public null_type -{ -public: - using inherited = null_type; -}; - -/*! \endcond - */ - -THRUST_SUPPRESS_DEPRECATED_POP - -/*! This version of \p make_tuple creates a new \c tuple object from a - * single object. - * - * \param t0 The object to copy from. - * \return A \p tuple object with a single member which is a copy of \p t0. - */ -template -THRUST_HOST_DEVICE inline typename detail::make_tuple_mapper::type make_tuple(const T0& t0); - -/*! This version of \p make_tuple creates a new \c tuple object from two - * objects. - * - * \param t0 The first object to copy from. - * \param t1 The second object to copy from. - * \return A \p tuple object with two members which are copies of \p t0 - * and \p t1. - * - * \note \p make_tuple has ten variants, the rest of which are omitted here - * for brevity. - */ -template -THRUST_HOST_DEVICE inline typename detail::make_tuple_mapper::type make_tuple(const T0& t0, const T1& t1); - -/*! This version of \p tie creates a new \c tuple whose single element is - * a reference which refers to this function's argument. - * - * \param t0 The object to reference. - * \return A \p tuple object with one member which is a reference to \p t0. - */ -template -THRUST_HOST_DEVICE inline tuple tie(T0& t0); - -/*! This version of \p tie creates a new \c tuple of references object which - * refers to this function's arguments. - * - * \param t0 The first object to reference. - * \param t1 The second object to reference. - * \return A \p tuple object with two members which are references to \p t0 - * and \p t1. - * - * \note \p tie has ten variants, the rest of which are omitted here for - * brevity. - */ -template -THRUST_HOST_DEVICE inline tuple tie(T0& t0, T1& t1); - -/*! \p swap swaps the contents of two tuples. - * - * \param x The first \p tuple to swap. - * \param y The second \p tuple to swap. - */ -template -inline THRUST_HOST_DEVICE void -swap(tuple& x, tuple& y); - -/*! \cond - */ - -template -THRUST_HOST_DEVICE inline typename detail::make_tuple_mapper::type -make_tuple(const T0& t0, const T1& t1, const T2& t2); - -template -THRUST_HOST_DEVICE inline typename detail::make_tuple_mapper::type -make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3); - -template -THRUST_HOST_DEVICE inline typename detail::make_tuple_mapper::type -make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4); - -template -THRUST_HOST_DEVICE inline typename detail::make_tuple_mapper::type -make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5); - -template -THRUST_HOST_DEVICE inline typename detail::make_tuple_mapper::type -make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6); - -template -THRUST_HOST_DEVICE inline typename detail::make_tuple_mapper::type make_tuple( - const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7); - -template -THRUST_HOST_DEVICE inline typename detail::make_tuple_mapper::type make_tuple( - const T0& t0, - const T1& t1, - const T2& t2, - const T3& t3, - const T4& t4, - const T5& t5, - const T6& t6, - const T7& t7, - const T8& t8); - -template -THRUST_HOST_DEVICE inline typename detail::make_tuple_mapper::type make_tuple( - const T0& t0, - const T1& t1, - const T2& t2, - const T3& t3, - const T4& t4, - const T5& t5, - const T6& t6, - const T7& t7, - const T8& t8, - const T9& t9); - -template -THRUST_HOST_DEVICE inline tuple tie(T0& t0, T1& t1, T2& t2); - -template -THRUST_HOST_DEVICE inline tuple tie(T0& t0, T1& t1, T2& t2, T3& t3); - -template -THRUST_HOST_DEVICE inline tuple tie(T0& t0, T1& t1, T2& t2, T3& t3, T4& t4); - -template -THRUST_HOST_DEVICE inline tuple tie(T0& t0, T1& t1, T2& t2, T3& t3, T4& t4, T5& t5); - -template -THRUST_HOST_DEVICE inline tuple -tie(T0& t0, T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6); - -template -THRUST_HOST_DEVICE inline tuple -tie(T0& t0, T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7); - -template -THRUST_HOST_DEVICE inline tuple -tie(T0& t0, T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8); - -template -THRUST_HOST_DEVICE inline tuple -tie(T0& t0, T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8, T9& t9); - -/*! \endcond - */ - -/*! \} // tuple - */ - -/*! \} // utility - */ - -# ifndef THRUST_DOXYGEN_INVOKED -namespace internal -{ -template -constexpr auto apply_tuple_impl(F&& f, Tuple&& t, ::std::index_sequence) -{ - return f(get(::std::forward(t))...); -} -} // namespace internal - -template -constexpr auto apply(F&& f, Tuple&& t) -{ - constexpr ::std::size_t N = tuple_size<::std::remove_reference_t>::value; - return internal::apply_tuple_impl(::std::forward(f), ::std::forward(t), ::std::make_index_sequence{}); -} -# endif - -THRUST_NAMESPACE_END - -_THRUST_STD_NAMESPACE_BEGIN - -template -struct tuple_size> : std::tuple_size> -{}; - -template -struct tuple_element> : std::tuple_element> -{}; - -THRUST_SUPPRESS_DEPRECATED_PUSH - -template <> -struct tuple_size> : std::integral_constant -{}; - -template -struct tuple_size> : std::integral_constant -{}; - -template -struct tuple_size> : std::integral_constant -{}; - -template -struct tuple_size> : std::integral_constant -{}; - -template -struct tuple_size> : std::integral_constant -{}; - -template -struct tuple_size> : std::integral_constant -{}; - -template -struct tuple_size> : std::integral_constant -{}; - -template -struct tuple_size> : std::integral_constant -{}; - -template -struct tuple_size> - : std::integral_constant -{}; - -template -struct tuple_size> - : std::integral_constant -{}; - -THRUST_SUPPRESS_DEPRECATED_POP -_THRUST_STD_NAMESPACE_END - -#endif // _THRUST_HAS_DEVICE_SYSTEM_STD From 708b65b35c49da768cab7f45a50b84b3fbc7ae23 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:36:25 -0400 Subject: [PATCH 19/48] refactor(rocthrust): CCCL 85bf1b00c4d parity - include libcxx in generic scan Related upstream commit: 85bf1b00c4d Refactor generic thrust scan dispatch (NVIDIA/cccl#6360) Related local port commit: fc66966f56f system/detail/generic/scan.h uses _THRUST_STD::plus<>; include _THRUST_LIBCXX_INCLUDE(functional) (upstream ) instead of , now that libhipcxx is mandatory. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../hipccl3/rocthrust/thrust/system/detail/generic/scan.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scan.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scan.h index 93fb1a7da803..cf20e4c1f2d1 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scan.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scan.h @@ -26,11 +26,12 @@ # pragma system_header #endif // no system header -#include #include #include #include +#include _THRUST_LIBCXX_INCLUDE(functional) + THRUST_NAMESPACE_BEGIN namespace system::detail::generic { From b0828f17c8891747b60ba7006ceac8b0fd39327f Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:37:08 -0400 Subject: [PATCH 20/48] refactor(rocthrust): CCCL 865e3d6429f parity - drop seq/tbb backend fallbacks, granular includes Related upstream commit: 865e3d6429f Inline remaining `*.inl` files in tbb and seq backends (NVIDIA/cccl#6437) Related local port commit: cd4d3034fbb libhipcxx is now mandatory, so the inlined seq/tbb backend headers follow upstream's includes: - sequential/sort.h: drop the unused libcxx_wrapper conjunction.h include and the !_THRUST_HAS_DEVICE_SYSTEM_STD fallback. - sequential/stable_merge_sort.h: include only _THRUST_STD_INCLUDE(__algorithm/min.h), unguarded (algorithm_wrapper.h fallback and the umbrella removed). - sequential/stable_primitive_sort.h: drop the fallback. - tbb/detail/reduce_by_key.h: unguarded __algorithm/{max,min}.h and __type_traits/void_t.h, plus upstream's __iterator/reverse_iterator.h and __utility/pair.h instead of the umbrella; algorithm_wrapper.h/ fallback removed. (thrust::pair -> _THRUST_STD::pair is done separately for CCCL 91434d76ab3.) The local _THRUST_IF_TARGET/THRUST_COMPILER spellings in sequential/sort.h are kept. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../thrust/system/detail/sequential/sort.h | 5 ----- .../system/detail/sequential/stable_merge_sort.h | 9 +-------- .../detail/sequential/stable_primitive_sort.h | 4 ---- .../thrust/system/tbb/detail/reduce_by_key.h | 15 +++++---------- 4 files changed, 6 insertions(+), 27 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/sort.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/sort.h index 30ac2dbff468..511e78e14fec 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/sort.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/sort.h @@ -31,7 +31,6 @@ # pragma system_header #endif // no system header -#include #include #include #include @@ -39,10 +38,6 @@ #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - THRUST_NAMESPACE_BEGIN namespace system::detail::sequential { diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/stable_merge_sort.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/stable_merge_sort.h index ba3589a6d229..e080d564d885 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/stable_merge_sort.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/stable_merge_sort.h @@ -33,14 +33,7 @@ #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(__algorithm/min.h) -# include _THRUST_STD_INCLUDE(iterator) -#endif +#include _THRUST_STD_INCLUDE(__algorithm/min.h) THRUST_NAMESPACE_BEGIN namespace system::detail::sequential diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/stable_primitive_sort.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/stable_primitive_sort.h index fecf33321265..7bfdb06c7ef9 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/stable_primitive_sort.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/stable_primitive_sort.h @@ -32,10 +32,6 @@ #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - THRUST_NAMESPACE_BEGIN namespace system::detail::sequential { diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/reduce_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/reduce_by_key.h index e0027679f63c..1f462c9bfe9b 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/reduce_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/reduce_by_key.h @@ -20,17 +20,12 @@ #include #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(__algorithm/max.h) -# include _THRUST_STD_INCLUDE(__algorithm/min.h) -# include _THRUST_STD_INCLUDE(__type_traits/void_t.h) -#else -# include - -# include -#endif +#include _THRUST_STD_INCLUDE(__algorithm/max.h) +#include _THRUST_STD_INCLUDE(__algorithm/min.h) +#include _THRUST_STD_INCLUDE(__iterator/reverse_iterator.h) +#include _THRUST_STD_INCLUDE(__type_traits/void_t.h) +#include _THRUST_STD_INCLUDE(__utility/pair.h) #include _THRUST_STD_INCLUDE(cassert) -#include _THRUST_STD_INCLUDE(iterator) #include From 4f7491babb8b0ff4b77baae803340d644e7c9150 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:39:47 -0400 Subject: [PATCH 21/48] refactor(rocthrust): CCCL 24deb145aec/369f2f72eca parity - complex math includes Related upstream commit: 24deb145aec Cleanup `thrust::complex` math includes and functions (NVIDIA/cccl#6546) Related upstream commit: 369f2f72eca Fix merge conflicts from dropping headers (NVIDIA/cccl#6563) Related local port commits: f58e51061b6, 556bd2a6c38 libhipcxx is now mandatory, so the thrust::complex headers can use the same granular libhipcxx includes as upstream instead of the umbrella: - thrust/detail/complex/*.h include the upstream __cmath/* headers (plus limits / __type_traits/common_type.h where upstream does). arithmetic.h keeps cfloat for FLT_MIN/DBL_MIN. - thrust/complex.h includes __type_traits/{common_type,remove_reference}.h as upstream and drops the dead !_THRUST_HAS_DEVICE_SYSTEM_STD fallback. - ::internal::common_type_t is replaced by _THRUST_STD::common_type_t (as upstream) in complex.h, arithmetic.h, cpow.h and test_complex.cpp, and the ::internal::common_type_t alias (TODO(libhipcxx)) is removed from thrust/detail/type_traits.h. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../hipccl3/rocthrust/test/test_complex.cpp | 12 ++-- .../hipccl/hipccl3/rocthrust/thrust/complex.h | 39 ++++++------ .../thrust/detail/complex/arithmetic.h | 59 ++++++++++--------- .../rocthrust/thrust/detail/complex/catrig.h | 11 +++- .../rocthrust/thrust/detail/complex/catrigf.h | 11 +++- .../rocthrust/thrust/detail/complex/ccosh.h | 6 +- .../rocthrust/thrust/detail/complex/ccoshf.h | 6 +- .../rocthrust/thrust/detail/complex/cexp.h | 3 +- .../rocthrust/thrust/detail/complex/cexpf.h | 3 +- .../rocthrust/thrust/detail/complex/clog.h | 5 +- .../rocthrust/thrust/detail/complex/clogf.h | 5 +- .../rocthrust/thrust/detail/complex/cpow.h | 16 ++--- .../rocthrust/thrust/detail/complex/cproj.h | 3 +- .../rocthrust/thrust/detail/complex/csinh.h | 6 +- .../rocthrust/thrust/detail/complex/csinhf.h | 6 +- .../rocthrust/thrust/detail/complex/csqrt.h | 8 ++- .../rocthrust/thrust/detail/complex/csqrtf.h | 8 ++- .../rocthrust/thrust/detail/complex/ctanh.h | 10 +++- .../rocthrust/thrust/detail/complex/ctanhf.h | 9 ++- .../rocthrust/thrust/detail/type_traits.h | 8 --- 20 files changed, 150 insertions(+), 84 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/test/test_complex.cpp b/projects/hipccl/hipccl3/rocthrust/test/test_complex.cpp index 8bfa087b22b3..923436f1df90 100644 --- a/projects/hipccl/hipccl3/rocthrust/test/test_complex.cpp +++ b/projects/hipccl/hipccl3/rocthrust/test/test_complex.cpp @@ -971,11 +971,11 @@ TYPED_TEST(ComplexPairsTests, TestCompoundPlusOperator) run_compound_tests( [=](std::complex& lhs, const std::complex& rhs) { - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; lhs = std::complex(lhs.real() + rhs.real(), lhs.imag() + rhs.imag()); }, [=](std::complex& lhs, const U& rhs) { - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; lhs = std::complex(lhs.real() + rhs, lhs.imag()); }, [=](thrust::complex& lhs, const thrust::complex& rhs) { @@ -995,11 +995,11 @@ TYPED_TEST(ComplexPairsTests, TestCompoundMinusOperator) run_compound_tests( [=](std::complex& lhs, const std::complex& rhs) { - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; lhs = std::complex(lhs.real() - rhs.real(), lhs.imag() - rhs.imag()); }, [=](std::complex& lhs, const U& rhs) { - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; lhs = std::complex(lhs.real() - rhs, lhs.imag()); }, [=](thrust::complex& lhs, const thrust::complex& rhs) { @@ -1020,7 +1020,7 @@ TYPED_TEST(ComplexPairsTests, TestCompoundMultiplyOperator) run_compound_tests( [=](std::complex& lhs, const std::complex& rhs) { // (a + bi)(c + di) = ac + i(ad + bc) - bd - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; type a = static_cast(lhs.real()); type b = static_cast(lhs.imag()); @@ -1054,7 +1054,7 @@ TYPED_TEST(ComplexPairsTests, TestCompoundDivisionOperator) run_compound_tests( [=](std::complex& lhs, const std::complex& rhs) { - using type = ::internal::common_type_t; + using type = _THRUST_STD::common_type_t; // (a + bi) / (c + di) = ((ac + bd) + (bc -ad)i) / (c^2 + d^2) type a = static_cast(lhs.real()); diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/complex.h b/projects/hipccl/hipccl3/rocthrust/thrust/complex.h index 13584b345570..d11882c350b3 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/complex.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/complex.h @@ -35,16 +35,13 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__type_traits/common_type.h) +#include _THRUST_STD_INCLUDE(__type_traits/remove_reference.h) #if !THRUST_COMPILER(NVRTC) # include # include #endif // !THRUST_COMPILER(NVRTC) -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - #define THRUST_STD_COMPLEX_REAL(z) \ reinterpret_cast::value_type(&)[2]>(z)[0] #define THRUST_STD_COMPLEX_IMAG(z) \ @@ -396,7 +393,7 @@ THRUST_HOST_DEVICE complex conj(const complex& z); * \param theta The phase of the returned \p complex in radians. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> polar(const T0& m, const T1& theta = T1()); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> polar(const T0& m, const T1& theta = T1()); /*! Returns the projection of a \p complex on the Riemann sphere. * For all finite \p complex it returns the argument. For \p complexs @@ -419,7 +416,7 @@ THRUST_HOST_DEVICE complex proj(const T& z); * \param y The second \p complex. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const complex& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const complex& x, const complex& y); /*! Adds a scalar to a \p complex number. * @@ -430,7 +427,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const co * \param y The scalar. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const complex& x, const T1& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const complex& x, const T1& y); /*! Adds a \p complex number to a scalar. * @@ -441,7 +438,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const co * \param y The \p complex. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const T0& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const T0& x, const complex& y); /*! Subtracts two \p complex numbers. * @@ -452,7 +449,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const T0 * \param y The second \p complex (subtrahend). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const complex& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const complex& x, const complex& y); /*! Subtracts a scalar from a \p complex number. * @@ -463,7 +460,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const co * \param y The scalar (subtrahend). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const complex& x, const T1& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const complex& x, const T1& y); /*! Subtracts a \p complex number from a scalar. * @@ -474,7 +471,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const co * \param y The \p complex (subtrahend). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const T0& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const T0& x, const complex& y); /*! Multiplies two \p complex numbers. * @@ -485,7 +482,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const T0 * \param y The second \p complex. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const complex& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const complex& x, const complex& y); /*! Multiplies a \p complex number by a scalar. * @@ -493,7 +490,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const co * \param y The scalar. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const complex& x, const T1& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const complex& x, const T1& y); /*! Multiplies a scalar by a \p complex number. * @@ -504,7 +501,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const co * \param y The \p complex. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const T0& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const T0& x, const complex& y); /*! Divides two \p complex numbers. * @@ -515,7 +512,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const T0 * \param y The denomimator (divisor). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const complex& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const complex& x, const complex& y); /*! Divides a \p complex number by a scalar. * @@ -526,7 +523,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const co * \param y The scalar denomimator (divisor). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const complex& x, const T1& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const complex& x, const T1& y); /*! Divides a scalar by a \p complex number. * @@ -537,7 +534,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const co * \param y The complex denomimator (divisor). */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const T0& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const T0& x, const complex& y); /* --- Unary Arithmetic operators --- */ @@ -590,7 +587,7 @@ THRUST_HOST_DEVICE complex log10(const complex& z); * \param y The exponent. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const complex& x, const complex& y); /*! Returns a \p complex number raised to a scalar. * @@ -601,7 +598,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex< * \param y The exponent. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex& x, const T1& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const complex& x, const T1& y); /*! Returns a scalar raised to a \p complex number. * @@ -612,7 +609,7 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex< * \param y The exponent. */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const T0& x, const complex& y); +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const T0& x, const complex& y); /*! Returns the complex square root of a \p complex number. * diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/arithmetic.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/arithmetic.h index a3e346b37923..b011e9db20f1 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/arithmetic.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/arithmetic.h @@ -24,79 +24,84 @@ #include #include _THRUST_STD_INCLUDE(cfloat) -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__type_traits/common_type.h) THRUST_NAMESPACE_BEGIN /* --- Binary Arithmetic Operators --- */ template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const complex& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const complex& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() + y.real(), x.imag() + y.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const complex& x, const T1& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const complex& x, const T1& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() + y, x.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator+(const T0& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator+(const T0& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x + y.real(), y.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const complex& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const complex& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() - y.real(), x.imag() - y.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const complex& x, const T1& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const complex& x, const T1& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() - y, x.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator-(const T0& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator-(const T0& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x - y.real(), -y.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const complex& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const complex& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() * y.real() - x.imag() * y.imag(), x.real() * y.imag() + x.imag() * y.real()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const complex& x, const T1& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const complex& x, const T1& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() * y, x.imag() * y); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator*(const T0& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator*(const T0& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x * y.real(), x * y.imag()); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const complex& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const complex& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; T s = _THRUST_STD::abs(y.real()) + _THRUST_STD::abs(y.imag()); T oos = T(1.0) / s; @@ -115,16 +120,16 @@ THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const co } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const complex& x, const T1& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const complex& x, const T1& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x.real() / y, x.imag() / y); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> operator/(const T0& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> operator/(const T0& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(x) / y; } @@ -199,9 +204,9 @@ THRUST_HOST_DEVICE inline double norm(const complex& z) } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> polar(const T0& m, const T1& theta) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> polar(const T0& m, const T1& theta) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return complex(m * _THRUST_STD::cos(theta), m * _THRUST_STD::sin(theta)); } diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrig.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrig.h index 9f56d1c723db..92289af389d6 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrig.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrig.h @@ -53,7 +53,16 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/isnan.h) +#include _THRUST_STD_INCLUDE(__cmath/logarithms.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/signbit.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrigf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrigf.h index eb25b6c26f34..b8b7222dc1f2 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrigf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/catrigf.h @@ -53,7 +53,16 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/isnan.h) +#include _THRUST_STD_INCLUDE(__cmath/logarithms.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/signbit.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccosh.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccosh.h index 47bc17a9658a..fd06e168949e 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccosh.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccosh.h @@ -53,7 +53,11 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccoshf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccoshf.h index c889ae3b9cab..bf70c8f988fe 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccoshf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ccoshf.h @@ -54,7 +54,11 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexp.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexp.h index 5eca70b07d44..2486d1c0de84 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexp.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexp.h @@ -55,7 +55,8 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexpf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexpf.h index 71c19a3a751f..17ed0217f6e1 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexpf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cexpf.h @@ -55,7 +55,8 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clog.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clog.h index a02ac302826b..ce5f3430710f 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clog.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clog.h @@ -51,7 +51,10 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/logarithms.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clogf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clogf.h index 1444dd5a6ab8..0e14e0bce28c 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clogf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/clogf.h @@ -51,7 +51,10 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/logarithms.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cpow.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cpow.h index 6155f4a4c577..5f80cd28c2a2 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cpow.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cpow.h @@ -25,14 +25,16 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/logarithms.h) +#include _THRUST_STD_INCLUDE(__type_traits/common_type.h) THRUST_NAMESPACE_BEGIN template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const complex& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return exp(log(complex(x)) * complex(y)); } @@ -68,16 +70,16 @@ THRUST_HOST_DEVICE inline complex pow(const complex& x, const comp #endif template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const complex& x, const T1& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const complex& x, const T1& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return exp(log(complex(x)) * T(y)); } template -THRUST_HOST_DEVICE complex<::internal::common_type_t> pow(const T0& x, const complex& y) +THRUST_HOST_DEVICE complex<_THRUST_STD::common_type_t> pow(const T0& x, const complex& y) { - using T = ::internal::common_type_t; + using T = _THRUST_STD::common_type_t; return exp(_THRUST_STD::log(T(x)) * complex(y)); } diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cproj.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cproj.h index 0f3afdb40140..6b3626a9574d 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cproj.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/cproj.h @@ -22,7 +22,8 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinh.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinh.h index a0af5d0b5c71..0656a5b648b4 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinh.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinh.h @@ -53,7 +53,11 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinhf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinhf.h index 033d4217dc20..8ad17db03749 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinhf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csinhf.h @@ -54,7 +54,11 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrt.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrt.h index 646c45c72e53..dc745c1a9816 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrt.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrt.h @@ -53,7 +53,13 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/isnan.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/signbit.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrtf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrtf.h index 0e6c7efa96f7..ac277fdf771e 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrtf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/csqrtf.h @@ -53,7 +53,13 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/hypot.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/isnan.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/signbit.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanh.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanh.h index 975091459a9a..a48b1a50a597 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanh.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanh.h @@ -92,7 +92,15 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/abs.h) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/isfinite.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanhf.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanhf.h index 08e288451748..2cc7d2ebde86 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanhf.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/complex/ctanhf.h @@ -57,7 +57,14 @@ #include #include -#include _THRUST_STD_INCLUDE(cmath) +#include _THRUST_STD_INCLUDE(__cmath/copysign.h) +#include _THRUST_STD_INCLUDE(__cmath/exponential_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/hyperbolic_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/inverse_trigonometric_functions.h) +#include _THRUST_STD_INCLUDE(__cmath/isfinite.h) +#include _THRUST_STD_INCLUDE(__cmath/isinf.h) +#include _THRUST_STD_INCLUDE(__cmath/roots.h) +#include _THRUST_STD_INCLUDE(__cmath/trigonometric_functions.h) THRUST_NAMESPACE_BEGIN namespace detail::complex diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h index 08072b58904a..14f8c30ae3fc 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h @@ -179,11 +179,3 @@ using detail::integral_constant; using detail::true_type; THRUST_NAMESPACE_END - -// TODO(libhipcxx): remove this namespace and replace ::internal::common_type_t -// with _THRUST_STD::common_type_t in rocThrust once libhipcxx gets ready -namespace internal -{ -template -using common_type_t = _THRUST_STD::common_type_t; -} // namespace internal From ff61ab2ab2f75d451933323b4f4e4af16415b870 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:41:50 -0400 Subject: [PATCH 22/48] refactor(rocthrust): CCCL 4b10fd26255 parity - is_integral/_If and includes Related upstream commit: 4b10fd26255 Cleanup includes in thrust (NVIDIA/cccl#6547) Related local port commit: ed712243cf1 The port kept the ::internal::is_integral / ::internal::If wrappers, the local umbrella include blocks and the dual less/greater list in cuda sort.h because of non-libhipcxx builds. libhipcxx is now mandatory, so: - ::internal::is_integral(_v) -> _THRUST_STD::is_integral(_v) in detail/type_traits.h, detail/vector_base.inl and counting_iterator.h (is_integral_v in distance_to, as upstream); the now-unused ::internal::is_integral/is_integral_v aliases are removed. - ::internal::If -> _THRUST_STD::_If (as upstream) in counting_iterator.h, iterator_adaptor_base.h, iterator_category_to_traversal.h, generic/reduce_by_key.inl and hip/detail/reduce_by_key.h; the libcxx_wrapper conditional.h includes are replaced by _THRUST_STD_INCLUDE(__type_traits/conditional.h). (The wrapper file itself stays because the dead fallback branch of the construct_at wrapper still includes it.) - counting_iterator.h and iterator_adaptor_base.h take the upstream granular __type_traits includes (drops the rocprim/type_traits.hpp fallback); minimum_system.h and iterator_category_to_traversal.h drop the type_traits includes as upstream. - cuda sort.h: can_use_primitive_sort uses the upstream is_same_v list without the duplicated _THRUST_STD:: comparators (_THRUST_STD is ::cuda::std there). thrust/detail/type_traits.h keeps its _THRUST_STD_INCLUDE(type_traits) umbrella; switching it to upstream's granular list would require the upstream include fixups in ~100 other headers. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../rocthrust/thrust/detail/type_traits.h | 4 +--- .../rocthrust/thrust/detail/vector_base.inl | 2 +- .../thrust/iterator/counting_iterator.h | 17 +++++++---------- .../iterator/detail/iterator_adaptor_base.h | 16 +++++++++------- .../detail/iterator_category_to_traversal.h | 11 +++-------- .../thrust/iterator/detail/minimum_system.h | 4 +--- .../rocthrust/thrust/system/cuda/detail/sort.h | 13 ++++--------- .../system/detail/generic/reduce_by_key.inl | 6 ++---- .../thrust/system/hip/detail/reduce_by_key.h | 8 ++++---- 9 files changed, 32 insertions(+), 49 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h index 14f8c30ae3fc..8cfe07629aeb 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/type_traits.h @@ -40,8 +40,6 @@ namespace internal { using _THRUST_STD::is_arithmetic; -using _THRUST_STD::is_integral; -using _THRUST_STD::is_integral_v; using _THRUST_STD::make_unsigned; template @@ -70,7 +68,7 @@ using true_type = _THRUST_STD::true_type; using false_type = _THRUST_STD::false_type; template -struct is_non_bool_integral : public ::internal::is_integral +struct is_non_bool_integral : public _THRUST_STD::is_integral {}; template <> struct is_non_bool_integral : public false_type diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.inl index 984e97a9dbf0..d1a63e5931d2 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.inl @@ -681,7 +681,7 @@ void vector_base::insert(iterator position, InputIterator first, Input { // we could have received insert(position, n, x), so disambiguate on the // type of InputIterator - using integral = typename ::internal::is_integral; + using integral = typename _THRUST_STD::is_integral; insert_dispatch(position, first, last, integral()); } // end vector_base::insert() diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/counting_iterator.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/counting_iterator.h index cafb596997ca..e9d5a1c5ebbe 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/counting_iterator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/counting_iterator.h @@ -40,21 +40,18 @@ # pragma system_header #endif // no system header -#include -#include #include #include #include #include #include +#include _THRUST_LIBCXX_INCLUDE(__type_traits/is_floating_point.h) +#include _THRUST_STD_INCLUDE(__type_traits/conditional.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_integral.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) #include _THRUST_STD_INCLUDE(cstddef) -#include _THRUST_STD_INCLUDE(type_traits) -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(type_traits) -#else -# include -#endif THRUST_NAMESPACE_BEGIN @@ -65,7 +62,7 @@ namespace detail { template using counting_iterator_difference_type = - ::internal::If<::internal::is_integral_v && sizeof(Number) < sizeof(int), int, _THRUST_STD::ptrdiff_t>; + _THRUST_STD::_If<_THRUST_STD::is_integral_v && sizeof(Number) < sizeof(int), int, _THRUST_STD::ptrdiff_t>; template struct make_counting_iterator_base @@ -290,7 +287,7 @@ class THRUST_DECLSPEC_EMPTY_BASES counting_iterator THRUST_HOST_DEVICE difference_type distance_to( counting_iterator const& y) const { - if constexpr (::internal::is_integral::value) + if constexpr (_THRUST_STD::is_integral_v) { return static_cast(y.base()) - static_cast(this->base()); } diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_adaptor_base.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_adaptor_base.h index ee65e3affbf3..08e1fd7065e7 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_adaptor_base.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_adaptor_base.h @@ -26,13 +26,15 @@ # pragma system_header #endif // no system header -#include #include #include #include #include -#include _THRUST_STD_INCLUDE(type_traits) +#include _THRUST_STD_INCLUDE(__type_traits/add_lvalue_reference.h) +#include _THRUST_STD_INCLUDE(__type_traits/conditional.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_same.h) +#include _THRUST_STD_INCLUDE(__type_traits/type_identity.h) THRUST_NAMESPACE_BEGIN @@ -50,8 +52,8 @@ namespace detail { // If T is use_default, return the result of invoking DefaultNullaryFn, otherwise return T. template -using replace_if_use_default = - typename ::internal::If<_THRUST_STD::is_same_v, DefaultNullaryFn, _THRUST_STD::type_identity>::type; +using replace_if_use_default = typename _THRUST_STD:: + _If<_THRUST_STD::is_same_v, DefaultNullaryFn, _THRUST_STD::type_identity>::type; // A metafunction which computes an iterator_adaptor's base class, a specialization of iterator_facade. template >; using reference = replace_if_use_default, - lazy_trait, - _THRUST_STD::add_lvalue_reference>>; + _THRUST_STD::_If<_THRUST_STD::is_same_v, + lazy_trait, + _THRUST_STD::add_lvalue_reference>>; using difference = replace_if_use_default>; public: diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_category_to_traversal.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_category_to_traversal.h index e1b0bdf02543..ea90a4f9143e 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_category_to_traversal.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/iterator_category_to_traversal.h @@ -26,15 +26,10 @@ # pragma system_header #endif // no system header -#include #include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - THRUST_NAMESPACE_BEGIN namespace detail @@ -58,9 +53,9 @@ THRUST_HOST_DEVICE auto cat_to_traversal_impl(const output_device_iterator_tag&) template struct iterator_category_to_traversal { - using type = ::internal::If<_THRUST_STD::is_convertible_v, - CategoryOrTraversal, - decltype(cat_to_traversal_impl(CategoryOrTraversal{}))>; + using type = _THRUST_STD::_If<_THRUST_STD::is_convertible_v, + CategoryOrTraversal, + decltype(cat_to_traversal_impl(CategoryOrTraversal{}))>; }; template diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/minimum_system.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/minimum_system.h index 816a5c04fba4..5328a24b0667 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/minimum_system.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/minimum_system.h @@ -25,13 +25,11 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include + #include #include #include -#include _THRUST_STD_INCLUDE(type_traits) - THRUST_NAMESPACE_BEGIN namespace detail { diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/cuda/detail/sort.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/cuda/detail/sort.h index 96180b34fe6c..d3e12aeecabc 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/cuda/detail/sort.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/cuda/detail/sort.h @@ -305,7 +305,6 @@ THRUST_RUNTIME_FUNCTION void radix_sort(execution_policy& policy, Key* namespace __smart_sort { -// TODO(bgruber): we can drop _THRUST_STD::less etc. when they truly alias to the ::cuda::std ones template using can_use_primitive_sort = ::cuda::std::integral_constant< bool, @@ -318,14 +317,10 @@ using can_use_primitive_sort = ::cuda::std::integral_constant< # endif // _CCCL_HAS_NVBF16() && !defined(__CUDA_NO_BFLOAT16_CONVERSIONS__) && // !defined(__CUDA_NO_BFLOAT16_OPERATORS__) ) - && (::cuda::std::is_same>::value - || ::cuda::std::is_same>::value - || ::cuda::std::is_same>::value - || ::cuda::std::is_same>::value - || ::cuda::std::is_same>::value - || ::cuda::std::is_same>::value - || ::cuda::std::is_same>::value - || ::cuda::std::is_same>::value)>; + && (::cuda::std::is_same_v> + || ::cuda::std::is_same_v> + || ::cuda::std::is_same_v> + || ::cuda::std::is_same_v>)>; template < class SORT_ITEMS, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.inl index a92fc79ed385..5686e332a345 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.inl @@ -27,7 +27,6 @@ #endif // no system header #include -#include #include #include #include @@ -41,6 +40,7 @@ # include _THRUST_STD_INCLUDE(iterator) #endif +#include _THRUST_STD_INCLUDE(__type_traits/conditional.h) #include _THRUST_STD_INCLUDE(limits) THRUST_NAMESPACE_BEGIN @@ -172,9 +172,7 @@ THRUST_HOST_DEVICE thrust::pair reduce_by_key( OutputIterator2 values_output, BinaryPredicate binary_pred) { - using T = ::internal:: - - If, + using T = _THRUST_STD::_If, thrust::detail::it_value_t, thrust::detail::it_value_t>; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/reduce_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/reduce_by_key.h index 591cfaa3527a..56ea7a91e0fe 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/reduce_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/reduce_by_key.h @@ -42,7 +42,6 @@ # include # include -# include # include # include # include @@ -59,6 +58,7 @@ # include _THRUST_STD_INCLUDE(iterator) # endif +# include _THRUST_STD_INCLUDE(__type_traits/conditional.h) # include _THRUST_STD_INCLUDE(cstdint) // rocprim include @@ -334,9 +334,9 @@ pair THRUST_HOST_DEVICE reduce_by_key( ValOutputIt values_output, BinaryPred binary_pred) { - using value_type = ::internal::If, - thrust::detail::it_value_t, - thrust::detail::it_value_t>; + using value_type = _THRUST_STD::_If, + thrust::detail::it_value_t, + thrust::detail::it_value_t>; return hip_rocprim::reduce_by_key( policy, keys_first, keys_last, values_first, keys_output, values_output, binary_pred, plus()); } From 6034ef447237cc1224553d1b168766e235e51558 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:42:33 -0400 Subject: [PATCH 23/48] refactor(rocthrust): CCCL 3a4892e1fb9 parity - mdspan in sum_rows/sum_columns Related upstream commit: 3a4892e1fb9 [Thrust]: New "sum rows" and "sum columns" examples (NVIDIA/cccl#4462) Related local port commit: db4bdf3502d The port used a raw pointer + manual row-major indexing and thrust::counting_iterator because cuda::std::mdspan / cuda::counting_iterator were unavailable without libhipcxx. libhipcxx is now mandatory, so the examples follow upstream: _THRUST_STD::mdspan for the 2D view (M.data_handle(), M.size(), M(i, j)) and _THRUST_LIBCXX::counting_iterator, with _THRUST_LIBCXX_INCLUDE(iterator) / _THRUST_STD_INCLUDE(mdspan). sum_columns.cu keeps its explicit permutation_iterator include. Also removes a stray "<<<<<<< ours" conflict marker left at the top of examples/sum_rows.cu by db4bdf3502d. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../hipccl3/rocthrust/examples/sum_columns.cu | 19 ++++++++------- .../hipccl3/rocthrust/examples/sum_rows.cu | 24 +++++++++---------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/examples/sum_columns.cu b/projects/hipccl/hipccl3/rocthrust/examples/sum_columns.cu index 780153c24ad9..991be54c4d3a 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/sum_columns.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/sum_columns.cu @@ -13,6 +13,9 @@ #include #include +#include _THRUST_LIBCXX_INCLUDE(iterator) +#include _THRUST_STD_INCLUDE(mdspan) + #include #include @@ -23,16 +26,15 @@ int main() const int rows = 32; const int cols = 16; - // Create a 2D row-major multidimensional array of ints. + // Create a 2D multidimensional array of ints. thrust::universal_vector data(rows * cols, 42); - int* M = thrust::raw_pointer_cast(data.data()); - const int size = rows * cols; + _THRUST_STD::mdspan M(thrust::raw_pointer_cast(data.data()), rows, cols); // Create an iterator to the flat linear index space for the multidimensional array. - auto flat_idx = thrust::counting_iterator(0); + auto flat_idx = _THRUST_LIBCXX::counting_iterator(0); // Fill the array with pseudorandom inputs in parallel on the device. - thrust::tabulate(thrust::device, M, M + size, [] __host__ __device__(int flat) { + thrust::tabulate(thrust::device, M.data_handle(), M.data_handle() + M.size(), [] __host__ __device__(int flat) { thrust::default_random_engine rng; thrust::uniform_int_distribution dist(0, 3); rng.discard(flat); // Advance to the current element's position. @@ -43,11 +45,12 @@ int main() auto col_idx_begin = thrust::make_transform_iterator(flat_idx, [=] __host__ __device__(int flat) { return flat / rows; }); - auto col_idx_end = col_idx_begin + size; + auto col_idx_end = col_idx_begin + M.size(); // Create a transposed view of the multidimensional array. auto M_transposed = thrust::make_permutation_iterator( - M, thrust::make_transform_iterator(thrust::counting_iterator(0), [=] __host__ __device__(int flat) { + M.data_handle(), + thrust::make_transform_iterator(_THRUST_LIBCXX::counting_iterator(0), [=] __host__ __device__(int flat) { int i = flat / cols; int j = flat % cols; return i + j * rows; @@ -62,7 +65,7 @@ int main() thrust::for_each_n(thrust::seq, flat_idx, rows, [&](int i) { std::cout << "[ "; thrust::for_each_n(thrust::seq, flat_idx, cols, [&](int j) { - std::cout << std::setw(2) << M[i * cols + j] << " "; + std::cout << std::setw(2) << M(i, j) << " "; }); std::cout << "]\n"; }); diff --git a/projects/hipccl/hipccl3/rocthrust/examples/sum_rows.cu b/projects/hipccl/hipccl3/rocthrust/examples/sum_rows.cu index 39e023a6d3e9..d5901d7d3452 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/sum_rows.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/sum_rows.cu @@ -1,4 +1,3 @@ -<<<<<<< ours // Copyright (c) 2020-2026 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -29,26 +28,28 @@ #include #include +#include _THRUST_LIBCXX_INCLUDE(iterator) +#include _THRUST_STD_INCLUDE(mdspan) + #include #include #include "include/host_device.h" -int main(void) +int main() { const int rows = 32; const int cols = 16; - // Create a 2D row-major multidimensional array of ints. + // Create a 2D multidimensional array of ints. thrust::universal_vector data(rows * cols, 42); - int* M = thrust::raw_pointer_cast(data.data()); - const int size = rows * cols; + _THRUST_STD::mdspan M(thrust::raw_pointer_cast(data.data()), rows, cols); // Create an iterator to the flat linear index space for the multidimensional array. - auto flat_idx = thrust::counting_iterator(0); + auto flat_idx = _THRUST_LIBCXX::counting_iterator(0); // Fill the array with pseudorandom inputs in parallel on the device. - thrust::tabulate(thrust::device, M, M + size, [] __host__ __device__(int flat) { + thrust::tabulate(thrust::device, M.data_handle(), M.data_handle() + M.size(), [] __host__ __device__(int flat) { thrust::default_random_engine rng; thrust::uniform_int_distribution dist(0, 3); rng.discard(flat); // Advance to the current element's position. @@ -59,20 +60,19 @@ int main(void) auto row_idx_begin = thrust::make_transform_iterator(flat_idx, [=] __host__ __device__(int flat) { return flat / cols; }); - auto row_idx_end = row_idx_begin + size; + auto row_idx_end = row_idx_begin + M.size(); // Sum each row, storing the result in a new vector. thrust::universal_vector sums(rows); - thrust::reduce_by_key(thrust::device, row_idx_begin, row_idx_end, M, thrust::make_discard_iterator(), sums.begin()); + thrust::reduce_by_key( + thrust::device, row_idx_begin, row_idx_end, M.data_handle(), thrust::make_discard_iterator(), sums.begin()); // Output the result. thrust::for_each_n(thrust::seq, flat_idx, rows, [&](int i) { std::cout << "[ "; thrust::for_each_n(thrust::seq, flat_idx, cols, [&](int j) { - std::cout << std::setw(2) << M[i * cols + j] << " "; + std::cout << std::setw(2) << M(i, j) << " "; }); std::cout << "] = " << sums[i] << "\n"; }); - - return 0; } From aaab958c6551d06955bf32cb471fc572acada75e Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:44:38 -0400 Subject: [PATCH 24/48] refactor(rocthrust): CCCL 91434d76ab3 parity - thrust::pair -> _THRUST_STD::pair Related upstream commit: 91434d76ab3 Replace uses of `thrust::pair` with `cuda::std::pair` (NVIDIA/cccl#6616) Related local port commit: 7bace77f410 The port only switched system/cuda and testing/cuda, keeping thrust::pair in generic/public headers, the sequential/omp/tbb backends, system/hip, tests and examples because thrust::pair was a distinct struct in the non-libhipcxx fallback. libhipcxx is now mandatory and thrust::pair is just an alias of _THRUST_STD::pair, so the remaining files follow upstream: - thrust::pair / unqualified pair / thrust::make_pair -> _THRUST_STD::pair / _THRUST_STD::make_pair in every non-cuda header, test and example touched by upstream (including doxygen snippets), plus testing/binary_search.cu and testing/transform.cu (upstream's catch2_test_binary_search.cu / catch2_test_transform.cu). - system/hip/detail (extrema, merge, mismatch, partition, reduce_by_key, set_operations, temporary_buffer, unique_by_key) gets the same spelling as its system/cuda counterpart, so hip tracks upstream. - #include is replaced with _THRUST_STD_INCLUDE(__utility/pair.h) (headers) or _THRUST_STD_INCLUDE(utility) (tests/examples) where upstream did so, or dropped where upstream dropped it. testing/pair.cu (tests thrust::pair itself), test/ and benchmark/ keep thrust::pair, which remains a public alias. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../rocthrust/examples/bounding_box.cu | 3 +- .../rocthrust/testing/binary_search.cu | 8 +- .../hipccl3/rocthrust/testing/memory.cu | 25 +-- .../hipccl3/rocthrust/testing/merge_by_key.cu | 10 +- .../rocthrust/testing/minmax_element.cu | 11 +- .../hipccl3/rocthrust/testing/mismatch.cu | 8 +- .../hipccl3/rocthrust/testing/pair_reduce.cu | 13 +- .../hipccl3/rocthrust/testing/pair_scan.cu | 13 +- .../rocthrust/testing/pair_scan_by_key.cu | 13 +- .../hipccl3/rocthrust/testing/pair_sort.cu | 9 +- .../rocthrust/testing/pair_sort_by_key.cu | 9 +- .../rocthrust/testing/pair_transform.cu | 11 +- .../hipccl3/rocthrust/testing/partition.cu | 184 +++++++++--------- .../rocthrust/testing/reduce_by_key.cu | 14 +- .../testing/set_difference_by_key.cu | 22 +-- .../set_difference_by_key_descending.cu | 6 +- .../testing/set_intersection_by_key.cu | 22 +-- .../set_intersection_by_key_descending.cu | 6 +- .../set_symmetric_difference_by_key.cu | 22 +-- ..._symmetric_difference_by_key_descending.cu | 6 +- .../rocthrust/testing/set_union_by_key.cu | 22 +-- .../testing/set_union_by_key_descending.cu | 6 +- .../hipccl3/rocthrust/testing/transform.cu | 7 +- .../hipccl3/rocthrust/testing/type_traits.cu | 9 +- .../rocthrust/testing/unique_by_key.cu | 62 +++--- .../hipccl3/rocthrust/thrust/binary_search.h | 11 +- .../detail/allocator/temporary_allocator.h | 4 +- .../rocthrust/thrust/detail/binary_search.inl | 8 +- .../thrust/detail/execute_with_allocator.h | 5 +- .../rocthrust/thrust/detail/extrema.inl | 8 +- .../hipccl3/rocthrust/thrust/detail/merge.inl | 8 +- .../rocthrust/thrust/detail/mismatch.inl | 8 +- .../rocthrust/thrust/detail/partition.inl | 16 +- .../rocthrust/thrust/detail/reduce.inl | 12 +- .../thrust/detail/set_operations.inl | 32 +-- .../thrust/detail/temporary_buffer.h | 15 +- .../rocthrust/thrust/detail/unique.inl | 16 +- .../hipccl/hipccl3/rocthrust/thrust/extrema.h | 19 +- .../detail/tuple_of_iterator_references.h | 5 +- .../hipccl/hipccl3/rocthrust/thrust/memory.h | 10 +- .../hipccl/hipccl3/rocthrust/thrust/merge.h | 19 +- .../hipccl3/rocthrust/thrust/mismatch.h | 19 +- .../hipccl3/rocthrust/thrust/partition.h | 19 +- .../random/detail/normal_distribution_base.h | 1 - .../thrust/random/normal_distribution.h | 5 +- .../thrust/random/uniform_int_distribution.h | 4 +- .../thrust/random/uniform_real_distribution.h | 5 +- .../hipccl/hipccl3/rocthrust/thrust/reduce.h | 27 +-- .../hipccl3/rocthrust/thrust/set_operations.h | 79 ++++---- .../system/detail/generic/binary_search.h | 4 +- .../system/detail/generic/binary_search.inl | 6 +- .../thrust/system/detail/generic/extrema.h | 7 +- .../thrust/system/detail/generic/extrema.inl | 11 +- .../thrust/system/detail/generic/memory.h | 1 - .../thrust/system/detail/generic/merge.h | 4 +- .../thrust/system/detail/generic/merge.inl | 6 +- .../thrust/system/detail/generic/mismatch.h | 4 +- .../thrust/system/detail/generic/mismatch.inl | 6 +- .../thrust/system/detail/generic/partition.h | 8 +- .../system/detail/generic/partition.inl | 15 +- .../system/detail/generic/reduce_by_key.h | 6 +- .../system/detail/generic/reduce_by_key.inl | 10 +- .../detail/generic/scalar/binary_search.h | 4 +- .../detail/generic/scalar/binary_search.inl | 7 +- .../system/detail/generic/set_operations.h | 19 +- .../system/detail/generic/set_operations.inl | 24 +-- .../system/detail/generic/temporary_buffer.h | 9 +- .../detail/generic/temporary_buffer.inl | 7 +- .../system/detail/generic/unique_by_key.h | 11 +- .../system/detail/generic/unique_by_key.inl | 10 +- .../thrust/system/detail/sequential/extrema.h | 7 +- .../thrust/system/detail/sequential/merge.h | 4 +- .../system/detail/sequential/partition.h | 11 +- .../system/detail/sequential/reduce_by_key.h | 7 +- .../thrust/system/detail/sequential/unique.h | 1 - .../system/detail/sequential/unique_by_key.h | 9 +- .../thrust/system/hip/detail/extrema.h | 9 +- .../thrust/system/hip/detail/merge.h | 12 +- .../thrust/system/hip/detail/mismatch.h | 10 +- .../thrust/system/hip/detail/partition.h | 52 ++--- .../thrust/system/hip/detail/reduce_by_key.h | 18 +- .../thrust/system/hip/detail/set_operations.h | 52 ++--- .../system/hip/detail/temporary_buffer.h | 8 +- .../thrust/system/hip/detail/unique_by_key.h | 26 +-- .../thrust/system/omp/detail/extrema.h | 2 +- .../thrust/system/omp/detail/partition.h | 7 +- .../thrust/system/omp/detail/reduce_by_key.h | 2 +- .../thrust/system/omp/detail/unique.h | 3 +- .../thrust/system/omp/detail/unique_by_key.h | 7 +- .../thrust/system/tbb/detail/extrema.h | 2 +- .../thrust/system/tbb/detail/merge.h | 4 +- .../thrust/system/tbb/detail/partition.h | 7 +- .../thrust/system/tbb/detail/reduce_by_key.h | 21 +- .../thrust/system/tbb/detail/unique.h | 1 - .../thrust/system/tbb/detail/unique_by_key.h | 7 +- .../hipccl/hipccl3/rocthrust/thrust/unique.h | 35 ++-- 96 files changed, 706 insertions(+), 673 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/examples/bounding_box.cu b/projects/hipccl/hipccl3/rocthrust/examples/bounding_box.cu index 8a27ea332807..ad74dc43e060 100644 --- a/projects/hipccl/hipccl3/rocthrust/examples/bounding_box.cu +++ b/projects/hipccl/hipccl3/rocthrust/examples/bounding_box.cu @@ -20,10 +20,11 @@ #include #include -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include "include/host_device.h" // This example shows how to compute a bounding box diff --git a/projects/hipccl/hipccl3/rocthrust/testing/binary_search.cu b/projects/hipccl/hipccl3/rocthrust/testing/binary_search.cu index 9a9806bfa14e..4417786787ff 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/binary_search.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/binary_search.cu @@ -223,11 +223,11 @@ void TestScalarEqualRangeSimple() DECLARE_VECTOR_UNITTEST(TestScalarEqualRangeSimple); template -thrust::pair +_THRUST_STD::pair equal_range(my_system& system, ForwardIterator first, ForwardIterator /*last*/, const LessThanComparable& /*value*/) { system.validate_dispatch(); - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestScalarEqualRangeDispatchExplicit() @@ -242,11 +242,11 @@ void TestScalarEqualRangeDispatchExplicit() DECLARE_UNITTEST(TestScalarEqualRangeDispatchExplicit); template -thrust::pair +_THRUST_STD::pair equal_range(my_tag, ForwardIterator first, ForwardIterator /*last*/, const LessThanComparable& /*value*/) { *first = 13; - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestScalarEqualRangeDispatchImplicit() diff --git a/projects/hipccl/hipccl3/rocthrust/testing/memory.cu b/projects/hipccl/hipccl3/rocthrust/testing/memory.cu index 212e64322125..8012c8af04a9 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/memory.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/memory.cu @@ -18,11 +18,12 @@ #include #include #include -#include #include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include #include @@ -80,12 +81,12 @@ struct my_old_temporary_allocation_system : public thrust::device_execution_poli {}; template -thrust::pair, std::ptrdiff_t> +_THRUST_STD::pair, std::ptrdiff_t> get_temporary_buffer(my_old_temporary_allocation_system, std::ptrdiff_t) { thrust::pointer const result(reinterpret_cast(4217)); - return thrust::make_pair(result, 314); + return _THRUST_STD::make_pair(result, 314); } template @@ -102,12 +103,12 @@ struct my_new_temporary_allocation_system : public thrust::device_execution_poli {}; template -thrust::pair, std::ptrdiff_t> +_THRUST_STD::pair, std::ptrdiff_t> get_temporary_buffer(my_new_temporary_allocation_system, std::ptrdiff_t) { thrust::pointer const result(reinterpret_cast(1742)); - return thrust::make_pair(result, 413); + return _THRUST_STD::make_pair(result, 413); } template @@ -184,7 +185,7 @@ void TestGetTemporaryBuffer() thrust::device_system_tag dev_tag; using pointer = thrust::pointer; - thrust::pair ptr_and_sz = thrust::get_temporary_buffer(dev_tag, n); + _THRUST_STD::pair ptr_and_sz = thrust::get_temporary_buffer(dev_tag, n); ASSERT_EQUAL(ptr_and_sz.second, n); @@ -254,15 +255,15 @@ void TestFreeDispatchExplicit() DECLARE_UNITTEST(TestFreeDispatchExplicit); template -thrust::pair, std::ptrdiff_t> +_THRUST_STD::pair, std::ptrdiff_t> get_temporary_buffer(my_memory_system& system, std::ptrdiff_t n) { system.validate_dispatch(); thrust::device_system_tag device_sys; - thrust::pair, std::ptrdiff_t> result = + _THRUST_STD::pair, std::ptrdiff_t> result = thrust::get_temporary_buffer(device_sys, n); - return thrust::make_pair(thrust::pointer(result.first.get()), result.second); + return _THRUST_STD::make_pair(thrust::pointer(result.first.get()), result.second); } // [NON-CCCL PARITY BEGIN] @@ -284,7 +285,7 @@ void TestGetTemporaryBufferDispatchExplicit() my_memory_system sys(0); using pointer = thrust::pointer; - thrust::pair ptr_and_sz = thrust::get_temporary_buffer(sys, n); + _THRUST_STD::pair ptr_and_sz = thrust::get_temporary_buffer(sys, n); ASSERT_EQUAL(ptr_and_sz.second, n); ASSERT_EQUAL(true, sys.is_valid()); @@ -333,7 +334,7 @@ void TestTemporaryBufferOldCustomization() { using system = my_old_namespace::my_old_temporary_allocation_system; using pointer = thrust::pointer; - using pointer_and_size = thrust::pair; + using pointer_and_size = _THRUST_STD::pair; system sys; @@ -353,7 +354,7 @@ void TestTemporaryBufferNewCustomization() { using system = my_new_namespace::my_new_temporary_allocation_system; using pointer = thrust::pointer; - using pointer_and_size = thrust::pair; + using pointer_and_size = _THRUST_STD::pair; system sys; diff --git a/projects/hipccl/hipccl3/rocthrust/testing/merge_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/merge_by_key.cu index 2526fe27694e..42683990fd49 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/merge_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/merge_by_key.cu @@ -61,7 +61,7 @@ template -thrust::pair merge_by_key( +_THRUST_STD::pair merge_by_key( my_system& system, InputIterator1, InputIterator1, @@ -73,7 +73,7 @@ thrust::pair merge_by_key( OutputIterator2 values_result) { system.validate_dispatch(); - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestMergeByKeyDispatchExplicit() @@ -94,7 +94,7 @@ template -thrust::pair merge_by_key( +_THRUST_STD::pair merge_by_key( my_tag, InputIterator1, InputIterator1, @@ -106,7 +106,7 @@ thrust::pair merge_by_key( OutputIterator2 values_result) { *keys_result = 13; - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestMergeByKeyDispatchImplicit() @@ -239,7 +239,7 @@ void TestMergeByKeyToDiscardIterator(size_t n) const thrust::device_vector d_a_vals = h_a_vals; const thrust::device_vector d_b_vals = h_b_vals; - using discard_pair = thrust::pair, thrust::discard_iterator<>>; + using discard_pair = _THRUST_STD::pair, thrust::discard_iterator<>>; const discard_pair h_result = thrust::merge_by_key( h_a_keys.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/minmax_element.cu b/projects/hipccl/hipccl3/rocthrust/testing/minmax_element.cu index 1a260fce2538..f7b260513507 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/minmax_element.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/minmax_element.cu @@ -80,10 +80,11 @@ void TestMinMaxElement(const size_t n) DECLARE_VARIABLE_UNITTEST(TestMinMaxElement); template -thrust::pair minmax_element(my_system& system, ForwardIterator first, ForwardIterator) +_THRUST_STD::pair +minmax_element(my_system& system, ForwardIterator first, ForwardIterator) { system.validate_dispatch(); - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestMinMaxElementDispatchExplicit() @@ -98,10 +99,10 @@ void TestMinMaxElementDispatchExplicit() DECLARE_UNITTEST(TestMinMaxElementDispatchExplicit); template -thrust::pair minmax_element(my_tag, ForwardIterator first, ForwardIterator) +_THRUST_STD::pair minmax_element(my_tag, ForwardIterator first, ForwardIterator) { *first = 13; - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestMinMaxElementDispatchImplicit() @@ -121,7 +122,7 @@ void TestMinMaxElementWithBigIndexesHelper(int magnitude) Iter end = begin + (1ll << magnitude); ASSERT_EQUAL(_THRUST_STD::distance(begin, end), 1ll << magnitude); - thrust::pair result = thrust::minmax_element(thrust::device, begin, end); + _THRUST_STD::pair result = thrust::minmax_element(thrust::device, begin, end); ASSERT_EQUAL(*result.first, 1); ASSERT_EQUAL(*result.second, (1ll << magnitude)); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/mismatch.cu b/projects/hipccl/hipccl3/rocthrust/testing/mismatch.cu index 60bc69eab07a..567af422d6f3 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/mismatch.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/mismatch.cu @@ -41,11 +41,11 @@ void TestMismatchSimple() DECLARE_VECTOR_UNITTEST(TestMismatchSimple); template -thrust::pair +_THRUST_STD::pair mismatch(my_system& system, InputIterator1 first, InputIterator1, InputIterator2) { system.validate_dispatch(); - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestMismatchDispatchExplicit() @@ -60,10 +60,10 @@ void TestMismatchDispatchExplicit() DECLARE_UNITTEST(TestMismatchDispatchExplicit); template -thrust::pair mismatch(my_tag, InputIterator1 first, InputIterator1, InputIterator2) +_THRUST_STD::pair mismatch(my_tag, InputIterator1 first, InputIterator1, InputIterator2) { *first = 13; - return thrust::make_pair(first, first); + return _THRUST_STD::make_pair(first, first); } void TestMismatchDispatchImplicit() diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_reduce.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_reduce.cu index 5dd6e6e2ce64..a5ae4e1a0c2e 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_reduce.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_reduce.cu @@ -15,18 +15,19 @@ * limitations under the License. */ -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -38,7 +39,7 @@ struct add_pairs // Need cast to undo integer promotion, decltype(char{} + char{}) == int using P1T1 = typename Pair1::first_type; using P1T2 = typename Pair1::second_type; - return thrust::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); + return _THRUST_STD::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); } // end operator() }; // end add_pairs @@ -47,7 +48,7 @@ struct TestPairReduce { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; thrust::host_vector h_p1 = unittest::random_integers(n); thrust::host_vector h_p2 = unittest::random_integers(n); @@ -60,7 +61,7 @@ struct TestPairReduce thrust::device_vector d_p2 = h_p2; thrust::device_vector

d_pairs = h_pairs; - P init = thrust::make_pair(T{13}, T{13}); + P init = _THRUST_STD::make_pair(T{13}, T{13}); // reduce on the host P h_result = thrust::reduce(h_pairs.begin(), h_pairs.end(), init, add_pairs()); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_scan.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_scan.cu index 662345b03608..863b7d583d96 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_scan.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_scan.cu @@ -15,19 +15,20 @@ * limitations under the License. */ -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include #include struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -36,7 +37,7 @@ struct add_pairs template THRUST_HOST_DEVICE Pair1 operator()(const Pair1& x, const Pair2& y) { - return thrust::make_pair(x.first + y.first, x.second + y.second); + return _THRUST_STD::make_pair(x.first + y.first, x.second + y.second); } // end operator() }; // end add_pairs @@ -45,7 +46,7 @@ struct TestPairScan { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; thrust::host_vector h_p1 = unittest::random_integers(n); thrust::host_vector h_p2 = unittest::random_integers(n); @@ -60,7 +61,7 @@ struct TestPairScan thrust::device_vector

d_pairs = h_pairs; thrust::device_vector

d_output(n); - P init = thrust::make_pair(13, 13); + P init = _THRUST_STD::make_pair(13, 13); // scan with plus thrust::inclusive_scan(h_pairs.begin(), h_pairs.end(), h_output.begin(), add_pairs()); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_scan_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_scan_by_key.cu index ff4ed73f6d23..25d39cf7d2c6 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_scan_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_scan_by_key.cu @@ -15,18 +15,19 @@ * limitations under the License. */ -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -38,7 +39,7 @@ struct add_pairs // Need cast to undo integer promotion, decltype(char{} + char{}) == int using P1T1 = typename Pair1::first_type; using P1T2 = typename Pair1::second_type; - return thrust::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); + return _THRUST_STD::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); } // end operator() }; // end add_pairs @@ -47,7 +48,7 @@ struct TestPairScanByKey { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; thrust::host_vector h_p1 = unittest::random_integers(n); thrust::host_vector h_p2 = unittest::random_integers(n); @@ -63,7 +64,7 @@ struct TestPairScanByKey thrust::host_vector h_keys = unittest::random_integers(n); thrust::device_vector d_keys = h_keys; - P init = thrust::make_pair(T{13}, T{13}); + P init = _THRUST_STD::make_pair(T{13}, T{13}); // scan on the host thrust::exclusive_scan_by_key( diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_sort.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_sort.cu index 68277db6e760..da52e1f881d8 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_sort.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_sort.cu @@ -15,18 +15,19 @@ * limitations under the License. */ -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -35,7 +36,7 @@ struct TestPairStableSortByKey { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; // host arrays thrust::host_vector h_p1 = unittest::random_integers(n); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_sort_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_sort_by_key.cu index b9385b95c0cf..b686a9e964cd 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_sort_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_sort_by_key.cu @@ -15,17 +15,18 @@ * limitations under the License. */ -#include #include +#include _THRUST_STD_INCLUDE(utility) + #include struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -34,7 +35,7 @@ struct TestPairStableSort { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; thrust::host_vector h_p1 = unittest::random_integers(n); thrust::host_vector h_p2 = unittest::random_integers(n); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/pair_transform.cu b/projects/hipccl/hipccl3/rocthrust/testing/pair_transform.cu index b486daac5fde..4e2f18d8f32b 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/pair_transform.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/pair_transform.cu @@ -16,10 +16,11 @@ */ #include -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include #if !_THRUST_HAS_DEVICE_SYSTEM_STD @@ -29,9 +30,9 @@ struct make_pair_functor { template - THRUST_HOST_DEVICE thrust::pair operator()(const T1& x, const T2& y) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(const T1& x, const T2& y) { - return thrust::make_pair(x, y); + return _THRUST_STD::make_pair(x, y); } // end operator()() }; // end make_pair_functor @@ -43,7 +44,7 @@ struct add_pairs using T1 = typename _THRUST_STD::common_type::type; using T2 = typename _THRUST_STD::common_type::type; - return thrust::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); + return _THRUST_STD::make_pair(static_cast(x.first + y.first), static_cast(x.second + y.second)); } // end operator() }; // end add_pairs @@ -52,7 +53,7 @@ struct TestPairTransform { void operator()(const size_t n) { - using P = thrust::pair; + using P = _THRUST_STD::pair; thrust::host_vector h_p1 = unittest::random_integers(n); thrust::host_vector h_p2 = unittest::random_integers(n); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/partition.cu b/projects/hipccl/hipccl3/rocthrust/testing/partition.cu index f8a2098736bc..86b614ed09a5 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/partition.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/partition.cu @@ -96,7 +96,7 @@ void TestPartitionCopySimple() Vector true_results(2); Vector false_results(3); - thrust::pair ends = + _THRUST_STD::pair ends = thrust::partition_copy(data.begin(), data.end(), true_results.begin(), false_results.begin(), is_even()); Vector true_ref(2, 2); @@ -122,7 +122,7 @@ void TestPartitionCopyStencilSimple() Vector true_results(2); Vector false_results(3); - thrust::pair ends = thrust::partition_copy( + _THRUST_STD::pair ends = thrust::partition_copy( data.begin(), data.end(), stencil.begin(), true_results.begin(), false_results.begin(), is_even()); Vector true_ref(2, 1); @@ -181,7 +181,7 @@ void TestStablePartitionCopySimple() Vector true_results(2); Vector false_results(3); - thrust::pair ends = + _THRUST_STD::pair ends = thrust::stable_partition_copy(data.begin(), data.end(), true_results.begin(), false_results.begin(), is_even()); Vector true_ref(2, 2); @@ -204,7 +204,7 @@ void TestStablePartitionCopyStencilSimple() Vector true_results(2); Vector false_results(3); - thrust::pair ends = thrust::stable_partition_copy( + _THRUST_STD::pair ends = thrust::stable_partition_copy( data.begin(), data.end(), stencil.begin(), true_results.begin(), false_results.begin(), _THRUST_STD::identity{}); Vector true_ref(2, 2); @@ -297,11 +297,11 @@ struct TestPartitionCopy thrust::device_vector d_true_results(n_true, 0); thrust::device_vector d_false_results(n_false, 0); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_ends = + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_ends = thrust::partition_copy( h_data.begin(), h_data.end(), h_true_results.begin(), h_false_results.begin(), is_even()); - thrust::pair::iterator, typename thrust::device_vector::iterator> d_ends = + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_ends = thrust::partition_copy( d_data.begin(), d_data.end(), d_true_results.begin(), d_false_results.begin(), is_even()); @@ -342,11 +342,11 @@ struct TestPartitionCopyStencil thrust::device_vector d_true_results(n_true, 0); thrust::device_vector d_false_results(n_false, 0); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_ends = + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_ends = thrust::partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), h_true_results.begin(), h_false_results.begin(), is_even()); - thrust::pair::iterator, typename thrust::device_vector::iterator> d_ends = + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_ends = thrust::partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), d_true_results.begin(), d_false_results.begin(), is_even()); @@ -387,11 +387,11 @@ struct TestStablePartitionCopyStencil thrust::device_vector d_true_results(n_true, 0); thrust::device_vector d_false_results(n_false, 0); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_ends = + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_ends = thrust::stable_partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), h_true_results.begin(), h_false_results.begin(), is_even()); - thrust::pair::iterator, typename thrust::device_vector::iterator> d_ends = + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_ends = thrust::stable_partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), d_true_results.begin(), d_false_results.begin(), is_even()); @@ -425,14 +425,14 @@ struct TestPartitionCopyToDiscardIterator std::ptrdiff_t n_false = n - n_true; // mask both ranges - thrust::pair, thrust::discard_iterator<>> h_result1 = thrust::partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> h_result1 = thrust::partition_copy( h_data.begin(), h_data.end(), thrust::make_discard_iterator(), thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> d_result1 = thrust::partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> d_result1 = thrust::partition_copy( d_data.begin(), d_data.end(), thrust::make_discard_iterator(), thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> reference1 = - thrust::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair, thrust::discard_iterator<>> reference1 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); ASSERT_EQUAL_QUIET(reference1, h_result1); ASSERT_EQUAL_QUIET(reference1, d_result1); @@ -441,19 +441,19 @@ struct TestPartitionCopyToDiscardIterator thrust::host_vector h_trues(n_true); thrust::device_vector d_trues(n_true); - thrust::pair::iterator, thrust::discard_iterator<>> h_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_result2 = thrust::partition_copy( h_data.begin(), h_data.end(), h_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> d_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_result2 = thrust::partition_copy( d_data.begin(), d_data.end(), d_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> h_reference2 = - thrust::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_reference2 = + _THRUST_STD::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); - thrust::pair::iterator, thrust::discard_iterator<>> d_reference2 = - thrust::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_reference2 = + _THRUST_STD::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); ASSERT_EQUAL(h_trues, d_trues); ASSERT_EQUAL_QUIET(h_reference2, h_result2); @@ -463,19 +463,19 @@ struct TestPartitionCopyToDiscardIterator thrust::host_vector h_falses(n_false); thrust::device_vector d_falses(n_false); - thrust::pair, typename thrust::host_vector::iterator> h_result3 = + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_result3 = thrust::partition_copy( h_data.begin(), h_data.end(), thrust::make_discard_iterator(), h_falses.begin(), is_even()); - thrust::pair, typename thrust::device_vector::iterator> d_result3 = + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_result3 = thrust::partition_copy( d_data.begin(), d_data.end(), thrust::make_discard_iterator(), d_falses.begin(), is_even()); - thrust::pair, typename thrust::host_vector::iterator> h_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); - thrust::pair, typename thrust::device_vector::iterator> d_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); ASSERT_EQUAL(h_falses, d_falses); ASSERT_EQUAL_QUIET(h_reference3, h_result3); @@ -499,7 +499,7 @@ struct TestPartitionCopyStencilToDiscardIterator std::ptrdiff_t n_false = n - n_true; // mask both ranges - thrust::pair, thrust::discard_iterator<>> h_result1 = thrust::partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> h_result1 = thrust::partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), @@ -507,7 +507,7 @@ struct TestPartitionCopyStencilToDiscardIterator thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> d_result1 = thrust::partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> d_result1 = thrust::partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), @@ -515,8 +515,8 @@ struct TestPartitionCopyStencilToDiscardIterator thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> reference1 = - thrust::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair, thrust::discard_iterator<>> reference1 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); ASSERT_EQUAL_QUIET(reference1, h_result1); ASSERT_EQUAL_QUIET(reference1, d_result1); @@ -525,19 +525,19 @@ struct TestPartitionCopyStencilToDiscardIterator thrust::host_vector h_trues(n_true); thrust::device_vector d_trues(n_true); - thrust::pair::iterator, thrust::discard_iterator<>> h_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_result2 = thrust::partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), h_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> d_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_result2 = thrust::partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), d_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> h_reference2 = - thrust::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_reference2 = + _THRUST_STD::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); - thrust::pair::iterator, thrust::discard_iterator<>> d_reference2 = - thrust::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_reference2 = + _THRUST_STD::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); ASSERT_EQUAL(h_trues, d_trues); ASSERT_EQUAL_QUIET(h_reference2, h_result2); @@ -547,7 +547,7 @@ struct TestPartitionCopyStencilToDiscardIterator thrust::host_vector h_falses(n_false); thrust::device_vector d_falses(n_false); - thrust::pair, typename thrust::host_vector::iterator> h_result3 = + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_result3 = thrust::partition_copy( h_data.begin(), h_data.end(), @@ -556,7 +556,7 @@ struct TestPartitionCopyStencilToDiscardIterator h_falses.begin(), is_even()); - thrust::pair, typename thrust::device_vector::iterator> d_result3 = + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_result3 = thrust::partition_copy( d_data.begin(), d_data.end(), @@ -565,11 +565,11 @@ struct TestPartitionCopyStencilToDiscardIterator d_falses.begin(), is_even()); - thrust::pair, typename thrust::host_vector::iterator> h_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); - thrust::pair, typename thrust::device_vector::iterator> d_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); ASSERT_EQUAL(h_falses, d_falses); ASSERT_EQUAL_QUIET(h_reference3, h_result3); @@ -649,11 +649,11 @@ struct TestStablePartitionCopy thrust::device_vector d_true_results(n_true, 0); thrust::device_vector d_false_results(n_false, 0); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_ends = + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_ends = thrust::stable_partition_copy( h_data.begin(), h_data.end(), h_true_results.begin(), h_false_results.begin(), is_even()); - thrust::pair::iterator, typename thrust::device_vector::iterator> d_ends = + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_ends = thrust::stable_partition_copy( d_data.begin(), d_data.end(), d_true_results.begin(), d_false_results.begin(), is_even()); @@ -683,14 +683,14 @@ struct TestStablePartitionCopyToDiscardIterator std::ptrdiff_t n_false = n - n_true; // mask both ranges - thrust::pair, thrust::discard_iterator<>> h_result1 = thrust::stable_partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> h_result1 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), thrust::make_discard_iterator(), thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> d_result1 = thrust::stable_partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> d_result1 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), thrust::make_discard_iterator(), thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> reference1 = - thrust::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair, thrust::discard_iterator<>> reference1 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); ASSERT_EQUAL_QUIET(reference1, h_result1); ASSERT_EQUAL_QUIET(reference1, d_result1); @@ -699,19 +699,19 @@ struct TestStablePartitionCopyToDiscardIterator thrust::host_vector h_trues(n_true); thrust::device_vector d_trues(n_true); - thrust::pair::iterator, thrust::discard_iterator<>> h_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_result2 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), h_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> d_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_result2 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), d_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> h_reference2 = - thrust::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_reference2 = + _THRUST_STD::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); - thrust::pair::iterator, thrust::discard_iterator<>> d_reference2 = - thrust::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_reference2 = + _THRUST_STD::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); ASSERT_EQUAL(h_trues, d_trues); ASSERT_EQUAL_QUIET(h_reference2, h_result2); @@ -721,19 +721,19 @@ struct TestStablePartitionCopyToDiscardIterator thrust::host_vector h_falses(n_false); thrust::device_vector d_falses(n_false); - thrust::pair, typename thrust::host_vector::iterator> h_result3 = + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_result3 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), thrust::make_discard_iterator(), h_falses.begin(), is_even()); - thrust::pair, typename thrust::device_vector::iterator> d_result3 = + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_result3 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), thrust::make_discard_iterator(), d_falses.begin(), is_even()); - thrust::pair, typename thrust::host_vector::iterator> h_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); - thrust::pair, typename thrust::device_vector::iterator> d_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); ASSERT_EQUAL(h_falses, d_falses); ASSERT_EQUAL_QUIET(h_reference3, h_result3); @@ -758,7 +758,7 @@ struct TestStablePartitionCopyStencilToDiscardIterator std::ptrdiff_t n_false = n - n_true; // mask both ranges - thrust::pair, thrust::discard_iterator<>> h_result1 = thrust::stable_partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> h_result1 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), @@ -766,7 +766,7 @@ struct TestStablePartitionCopyStencilToDiscardIterator thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> d_result1 = thrust::stable_partition_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> d_result1 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), @@ -774,8 +774,8 @@ struct TestStablePartitionCopyStencilToDiscardIterator thrust::make_discard_iterator(), is_even()); - thrust::pair, thrust::discard_iterator<>> reference1 = - thrust::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair, thrust::discard_iterator<>> reference1 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), thrust::make_discard_iterator(n_false)); ASSERT_EQUAL_QUIET(reference1, h_result1); ASSERT_EQUAL_QUIET(reference1, d_result1); @@ -784,19 +784,19 @@ struct TestStablePartitionCopyStencilToDiscardIterator thrust::host_vector h_trues(n_true); thrust::device_vector d_trues(n_true); - thrust::pair::iterator, thrust::discard_iterator<>> h_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_result2 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), h_stencil.begin(), h_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> d_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_result2 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), d_stencil.begin(), d_trues.begin(), thrust::make_discard_iterator(), is_even()); - thrust::pair::iterator, thrust::discard_iterator<>> h_reference2 = - thrust::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_reference2 = + _THRUST_STD::make_pair(h_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); - thrust::pair::iterator, thrust::discard_iterator<>> d_reference2 = - thrust::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_reference2 = + _THRUST_STD::make_pair(d_trues.begin() + n_true, thrust::make_discard_iterator(n_false)); ASSERT_EQUAL(h_trues, d_trues); ASSERT_EQUAL_QUIET(h_reference2, h_result2); @@ -806,7 +806,7 @@ struct TestStablePartitionCopyStencilToDiscardIterator thrust::host_vector h_falses(n_false); thrust::device_vector d_falses(n_false); - thrust::pair, typename thrust::host_vector::iterator> h_result3 = + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_result3 = thrust::stable_partition_copy( h_data.begin(), h_data.end(), @@ -815,7 +815,7 @@ struct TestStablePartitionCopyStencilToDiscardIterator h_falses.begin(), is_even()); - thrust::pair, typename thrust::device_vector::iterator> d_result3 = + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_result3 = thrust::stable_partition_copy( d_data.begin(), d_data.end(), @@ -824,11 +824,11 @@ struct TestStablePartitionCopyStencilToDiscardIterator d_falses.begin(), is_even()); - thrust::pair, typename thrust::host_vector::iterator> h_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), h_falses.begin() + n_false); - thrust::pair, typename thrust::device_vector::iterator> d_reference3 = - thrust::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(n_true), d_falses.begin() + n_false); ASSERT_EQUAL(h_falses, d_falses); ASSERT_EQUAL_QUIET(h_reference3, h_result3); @@ -1013,11 +1013,11 @@ void TestPartitionStencilDispatchImplicit() DECLARE_UNITTEST(TestPartitionStencilDispatchImplicit); template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( my_system& system, InputIterator, InputIterator, OutputIterator1 out_true, OutputIterator2 out_false, Predicate) { system.validate_dispatch(); - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestPartitionCopyDispatchExplicit() @@ -1036,7 +1036,7 @@ template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( my_system& system, InputIterator1, InputIterator1, @@ -1046,7 +1046,7 @@ thrust::pair partition_copy( Predicate) { system.validate_dispatch(); - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestPartitionCopyStencilDispatchExplicit() @@ -1061,11 +1061,11 @@ void TestPartitionCopyStencilDispatchExplicit() DECLARE_UNITTEST(TestPartitionCopyStencilDispatchExplicit); template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( my_tag, InputIterator first, InputIterator, OutputIterator1 out_true, OutputIterator2 out_false, Predicate) { *first = 13; - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestPartitionCopyDispatchImplicit() @@ -1088,7 +1088,7 @@ template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( my_tag, InputIterator1 first, InputIterator1, @@ -1098,7 +1098,7 @@ thrust::pair partition_copy( Predicate) { *first = 13; - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestPartitionCopyStencilDispatchImplicit() @@ -1189,11 +1189,11 @@ void TestStablePartitionStencilDispatchImplicit() DECLARE_UNITTEST(TestStablePartitionStencilDispatchImplicit); template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( my_system& system, InputIterator, InputIterator, OutputIterator1 out_true, OutputIterator2 out_false, Predicate) { system.validate_dispatch(); - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestStablePartitionCopyDispatchExplicit() @@ -1212,7 +1212,7 @@ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( my_system& system, InputIterator1, InputIterator1, @@ -1222,7 +1222,7 @@ thrust::pair stable_partition_copy( Predicate) { system.validate_dispatch(); - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestStablePartitionCopyStencilDispatchExplicit() @@ -1237,11 +1237,11 @@ void TestStablePartitionCopyStencilDispatchExplicit() DECLARE_UNITTEST(TestStablePartitionCopyStencilDispatchExplicit); template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( my_tag, InputIterator first, InputIterator, OutputIterator1 out_true, OutputIterator2 out_false, Predicate) { *first = 13; - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestStablePartitionCopyDispatchImplicit() @@ -1264,7 +1264,7 @@ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( my_tag, InputIterator1 first, InputIterator1, @@ -1274,7 +1274,7 @@ thrust::pair stable_partition_copy( Predicate) { *first = 13; - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } void TestStablePartitionCopyStencilDispatchImplicit() diff --git a/projects/hipccl/hipccl3/rocthrust/testing/reduce_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/reduce_by_key.cu index 29963c4993d4..73a2fc039a30 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/reduce_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/reduce_by_key.cu @@ -53,7 +53,7 @@ void TestReduceByKeySimple() Vector keys; Vector values; - typename thrust::pair new_last; + typename _THRUST_STD::pair new_last; // basic test initialize_keys(keys); @@ -144,8 +144,8 @@ struct TestReduceByKey using DeviceKeyIterator = typename thrust::device_vector::iterator; using DeviceValIterator = typename thrust::device_vector::iterator; - using HostIteratorPair = typename thrust::pair; - using DeviceIteratorPair = typename thrust::pair; + using HostIteratorPair = typename _THRUST_STD::pair; + using DeviceIteratorPair = typename _THRUST_STD::pair; HostIteratorPair h_last = thrust::reduce_by_key(h_keys.begin(), h_keys.end(), h_vals.begin(), h_keys_output.begin(), h_vals_output.begin()); @@ -212,7 +212,7 @@ struct TestReduceByKeyToDiscardIterator VariableUnitTest TestReduceByKeyToDiscardIteratorInstance; template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( my_system& system, InputIterator1, InputIterator1, @@ -221,7 +221,7 @@ thrust::pair reduce_by_key( OutputIterator2 values_output) { system.validate_dispatch(); - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } void TestReduceByKeyDispatchExplicit() @@ -236,11 +236,11 @@ void TestReduceByKeyDispatchExplicit() DECLARE_UNITTEST(TestReduceByKeyDispatchExplicit); template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( my_tag, InputIterator1, InputIterator1, InputIterator2, OutputIterator1 keys_output, OutputIterator2 values_output) { *keys_output = 13; - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } void TestReduceByKeyDispatchImplicit() diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key.cu index 1de71b603daf..ba901fa88d8b 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key.cu @@ -28,7 +28,7 @@ template -thrust::pair set_difference_by_key( +_THRUST_STD::pair set_difference_by_key( my_system& system, InputIterator1, InputIterator1, @@ -40,7 +40,7 @@ thrust::pair set_difference_by_key( OutputIterator2 values_result) { system.validate_dispatch(); - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetDifferenceByKeyDispatchExplicit() @@ -61,7 +61,7 @@ template -thrust::pair set_difference_by_key( +_THRUST_STD::pair set_difference_by_key( my_tag, InputIterator1, InputIterator1, @@ -73,7 +73,7 @@ thrust::pair set_difference_by_key( OutputIterator2 values_result) { *keys_result = 13; - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetDifferenceByKeyDispatchImplicit() @@ -110,7 +110,7 @@ void TestSetDifferenceByKeySimple() Vector result_key(2), result_val(2); - thrust::pair end = thrust::set_difference_by_key( + _THRUST_STD::pair end = thrust::set_difference_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -161,9 +161,9 @@ void TestSetDifferenceByKey(const size_t n) thrust::device_vector d_result_keys(n); thrust::device_vector d_result_vals(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_difference_by_key( h_a_keys.begin(), @@ -216,9 +216,9 @@ void TestSetDifferenceByKeyEquivalentRanges(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_difference_by_key( h_a_key.begin(), @@ -280,9 +280,9 @@ void TestSetDifferenceByKeyMultiset(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_difference_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key_descending.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key_descending.cu index 2ec484463d7d..4414bdc96084 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key_descending.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_difference_by_key_descending.cu @@ -34,7 +34,7 @@ void TestSetDifferenceByKeyDescendingSimple() Vector result_key(2), result_val(2); - thrust::pair end = thrust::set_difference_by_key( + _THRUST_STD::pair end = thrust::set_difference_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -74,9 +74,9 @@ void TestSetDifferenceByKeyDescending(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_difference_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key.cu index 3fcac17fb6cf..3f333a1bb2f9 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key.cu @@ -27,7 +27,7 @@ template -thrust::pair set_intersection_by_key( +_THRUST_STD::pair set_intersection_by_key( my_system& system, InputIterator1, InputIterator1, @@ -38,7 +38,7 @@ thrust::pair set_intersection_by_key( OutputIterator2 values_result) { system.validate_dispatch(); - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetIntersectionByKeyDispatchExplicit() @@ -58,7 +58,7 @@ template -thrust::pair set_intersection_by_key( +_THRUST_STD::pair set_intersection_by_key( my_tag, InputIterator1, InputIterator1, @@ -69,7 +69,7 @@ thrust::pair set_intersection_by_key( OutputIterator2 values_result) { *keys_result = 13; - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetIntersectionByKeyDispatchImplicit() @@ -100,7 +100,7 @@ void TestSetIntersectionByKeySimple() Vector ref_key{0, 4}, ref_val{0, 0}; Vector result_key(2), result_val(2); - thrust::pair end = thrust::set_intersection_by_key( + _THRUST_STD::pair end = thrust::set_intersection_by_key( a_key.begin(), a_key.end(), b_key.begin(), b_key.end(), a_val.begin(), result_key.begin(), result_val.begin()); ASSERT_EQUAL_QUIET(result_key.end(), end.first); @@ -142,9 +142,9 @@ void TestSetIntersectionByKey(const size_t n) thrust::device_vector d_result_keys(n); thrust::device_vector d_result_vals(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_intersection_by_key( h_a_keys.begin(), @@ -193,9 +193,9 @@ void TestSetIntersectionByKeyEquivalentRanges(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_intersection_by_key( h_a_key.begin(), @@ -253,9 +253,9 @@ void TestSetIntersectionByKeyMultiset(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_intersection_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key_descending.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key_descending.cu index a8c61ed7abdd..128c7ca109f9 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key_descending.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_intersection_by_key_descending.cu @@ -33,7 +33,7 @@ void TestSetIntersectionByKeyDescendingSimple() Vector ref_key{4, 0}, ref_val{0, 0}; Vector result_key(2), result_val(2); - thrust::pair end = thrust::set_intersection_by_key( + _THRUST_STD::pair end = thrust::set_intersection_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -70,9 +70,9 @@ void TestSetIntersectionByKeyDescending(const size_t n) thrust::host_vector h_result_key(n), h_result_val(n); thrust::device_vector d_result_key(n), d_result_val(n); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_intersection_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key.cu index 4471ba6e382a..c9109f7fb668 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key.cu @@ -28,7 +28,7 @@ template -thrust::pair set_symmetric_difference_by_key( +_THRUST_STD::pair set_symmetric_difference_by_key( my_system& system, InputIterator1, InputIterator1, @@ -40,7 +40,7 @@ thrust::pair set_symmetric_difference_by_key( OutputIterator2 values_result) { system.validate_dispatch(); - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetSymmetricDifferenceByKeyDispatchExplicit() @@ -61,7 +61,7 @@ template -thrust::pair set_symmetric_difference_by_key( +_THRUST_STD::pair set_symmetric_difference_by_key( my_tag, InputIterator1, InputIterator1, @@ -73,7 +73,7 @@ thrust::pair set_symmetric_difference_by_key( OutputIterator2 values_result) { *keys_result = 13; - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetSymmetricDifferenceByKeyDispatchImplicit() @@ -105,7 +105,7 @@ void TestSetSymmetricDifferenceByKeySimple() Vector ref_key{2, 3, 3, 6, 7}, ref_val{0, 1, 1, 0, 1}; Vector result_key(5), result_val(5); - thrust::pair end = thrust::set_symmetric_difference_by_key( + _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -158,9 +158,9 @@ void TestSetSymmetricDifferenceByKey(const size_t n) thrust::device_vector d_result_keys(max_size); thrust::device_vector d_result_vals(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_symmetric_difference_by_key( h_a_keys.begin(), @@ -215,9 +215,9 @@ void TestSetSymmetricDifferenceByKeyEquivalentRanges(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_symmetric_difference_by_key( h_a_key.begin(), @@ -280,9 +280,9 @@ void TestSetSymmetricDifferenceByKeyMultiset(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_symmetric_difference_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key_descending.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key_descending.cu index eee7ebc99861..8f259c4076cb 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key_descending.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_symmetric_difference_by_key_descending.cu @@ -33,7 +33,7 @@ void TestSetSymmetricDifferenceByKeyDescendingSimple() Vector ref_key{7, 6, 3, 3, 2}, ref_val{1, 0, 1, 1, 0}; Vector result_key(5), result_val(5); - thrust::pair end = thrust::set_symmetric_difference_by_key( + _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -74,9 +74,9 @@ void TestSetSymmetricDifferenceByKeyDescending(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_symmetric_difference_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key.cu index e1586782ef64..0a12738c6448 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key.cu @@ -28,7 +28,7 @@ template -thrust::pair set_union_by_key( +_THRUST_STD::pair set_union_by_key( my_system& system, InputIterator1, InputIterator1, @@ -40,7 +40,7 @@ thrust::pair set_union_by_key( OutputIterator2 values_result) { system.validate_dispatch(); - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetUnionByKeyDispatchExplicit() @@ -61,7 +61,7 @@ template -thrust::pair set_union_by_key( +_THRUST_STD::pair set_union_by_key( my_tag, InputIterator1, InputIterator1, @@ -73,7 +73,7 @@ thrust::pair set_union_by_key( OutputIterator2 values_result) { *keys_result = 13; - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } void TestSetUnionByKeyDispatchImplicit() @@ -105,7 +105,7 @@ void TestSetUnionByKeySimple() Vector ref_key{0, 2, 3, 3, 4}, ref_val{0, 0, 1, 1, 0}; Vector result_key(5), result_val(5); - thrust::pair end = thrust::set_union_by_key( + _THRUST_STD::pair end = thrust::set_union_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -158,9 +158,9 @@ void TestSetUnionByKey(const size_t n) thrust::device_vector d_result_keys(max_size); thrust::device_vector d_result_vals(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_union_by_key( h_a_keys.begin(), @@ -215,9 +215,9 @@ void TestSetUnionByKeyEquivalentRanges(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_union_by_key( h_a_key.begin(), @@ -280,9 +280,9 @@ void TestSetUnionByKeyMultiset(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_union_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key_descending.cu b/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key_descending.cu index 90156aa73adf..7ebeb17e0b9c 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key_descending.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/set_union_by_key_descending.cu @@ -33,7 +33,7 @@ void TestSetUnionByKeyDescendingSimple() Vector ref_key{4, 3, 3, 2, 0}, ref_val{0, 1, 1, 0, 0}; Vector result_key(5), result_val(5); - thrust::pair end = thrust::set_union_by_key( + _THRUST_STD::pair end = thrust::set_union_by_key( a_key.begin(), a_key.end(), b_key.begin(), @@ -74,9 +74,9 @@ void TestSetUnionByKeyDescending(const size_t n) thrust::host_vector h_result_key(max_size), h_result_val(max_size); thrust::device_vector d_result_key(max_size), d_result_val(max_size); - thrust::pair::iterator, typename thrust::host_vector::iterator> h_end; + _THRUST_STD::pair::iterator, typename thrust::host_vector::iterator> h_end; - thrust::pair::iterator, typename thrust::device_vector::iterator> d_end; + _THRUST_STD::pair::iterator, typename thrust::device_vector::iterator> d_end; h_end = thrust::set_union_by_key( h_a_key.begin(), diff --git a/projects/hipccl/hipccl3/rocthrust/testing/transform.cu b/projects/hipccl/hipccl3/rocthrust/testing/transform.cu index 34484688c373..899b799d2520 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/transform.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/transform.cu @@ -19,10 +19,11 @@ #include #include #include -#include #include #include +#include _THRUST_STD_INCLUDE(utility) + #include // There is a unfortunate miscompilation of the gcc-11 vectorizer leading to OOB writes @@ -410,9 +411,9 @@ DECLARE_VARIABLE_UNITTEST(TestTransformUnaryToDiscardIterator); struct repeat2 { template - THRUST_HOST_DEVICE thrust::pair operator()(T x) + THRUST_HOST_DEVICE _THRUST_STD::pair operator()(T x) { - return thrust::make_pair(x, x); + return _THRUST_STD::make_pair(x, x); } }; diff --git a/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu b/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu index 97f64b35c07f..d8aecb7b5f02 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/type_traits.cu @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -210,25 +209,25 @@ void TestTriviallyRelocatable() #if THRUST_COMPILER(GCC, >=, 7) static_assert(thrust::is_trivially_relocatable>::value, ""); static_assert(thrust::is_trivially_relocatable<_THRUST_STD::complex>::value, ""); - static_assert(thrust::is_trivially_relocatable>>::value, ""); + static_assert(thrust::is_trivially_relocatable<_THRUST_STD::pair>>::value, ""); static_assert(thrust::is_trivially_relocatable<_THRUST_STD::pair>>::value, ""); static_assert(thrust::is_trivially_relocatable, char>>::value, ""); static_assert(thrust::is_trivially_relocatable<_THRUST_STD::tuple, char>>::value, ""); #endif // THRUST_COMPILER(GCC, >=, 7) static_assert(thrust::is_trivially_relocatable< - _THRUST_STD::tuple>>, + _THRUST_STD::tuple<_THRUST_STD::pair>>, thrust::tuple<_THRUST_STD::pair>, int>>>::value, ""); - static_assert(!thrust::is_trivially_relocatable>::value, ""); + static_assert(!thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); static_assert(!thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); static_assert(!thrust::is_trivially_relocatable>::value, ""); static_assert(!thrust::is_trivially_relocatable<_THRUST_STD::tuple>::value, ""); // test propagation of relocatability through pair and tuple static_assert(thrust::is_trivially_relocatable::value, ""); - static_assert(thrust::is_trivially_relocatable>::value, ""); + static_assert(thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); static_assert(thrust::is_trivially_relocatable<_THRUST_STD::pair>::value, ""); static_assert(thrust::is_trivially_relocatable>::value, ""); static_assert(thrust::is_trivially_relocatable<_THRUST_STD::tuple>::value, ""); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/unique_by_key.cu b/projects/hipccl/hipccl3/rocthrust/testing/unique_by_key.cu index f1cade3d18d1..a1cb86e436ad 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/unique_by_key.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/unique_by_key.cu @@ -40,11 +40,11 @@ struct index_to_value_t }; template -thrust::pair +_THRUST_STD::pair unique_by_key(my_system& system, ForwardIterator1 keys_first, ForwardIterator1, ForwardIterator2 values_first) { system.validate_dispatch(); - return thrust::make_pair(keys_first, values_first); + return _THRUST_STD::make_pair(keys_first, values_first); } void TestUniqueByKeyDispatchExplicit() @@ -59,11 +59,11 @@ void TestUniqueByKeyDispatchExplicit() DECLARE_UNITTEST(TestUniqueByKeyDispatchExplicit); template -thrust::pair +_THRUST_STD::pair unique_by_key(my_tag, ForwardIterator1 keys_first, ForwardIterator1, ForwardIterator2 values_first) { *keys_first = 13; - return thrust::make_pair(keys_first, values_first); + return _THRUST_STD::make_pair(keys_first, values_first); } void TestUniqueByKeyDispatchImplicit() @@ -78,7 +78,7 @@ void TestUniqueByKeyDispatchImplicit() DECLARE_UNITTEST(TestUniqueByKeyDispatchImplicit); template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( my_system& system, InputIterator1, InputIterator1, @@ -87,7 +87,7 @@ thrust::pair unique_by_key_copy( OutputIterator2 values_output) { system.validate_dispatch(); - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } void TestUniqueByKeyCopyDispatchExplicit() @@ -102,11 +102,11 @@ void TestUniqueByKeyCopyDispatchExplicit() DECLARE_UNITTEST(TestUniqueByKeyCopyDispatchExplicit); template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( my_tag, InputIterator1, InputIterator1, InputIterator2, OutputIterator1 keys_output, OutputIterator2 values_output) { *keys_output = 13; - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } void TestUniqueByKeyCopyDispatchImplicit() @@ -155,7 +155,7 @@ void TestUniqueByKeySimple() Vector keys; Vector values; - typename thrust::pair new_last; + typename _THRUST_STD::pair new_last; // basic test initialize_keys(keys); @@ -201,7 +201,7 @@ void TestUniqueCopyByKeySimple() Vector keys; Vector values; - typename thrust::pair new_last; + typename _THRUST_STD::pair new_last; // basic test initialize_keys(keys); @@ -262,8 +262,8 @@ struct TestUniqueByKey using DeviceKeyIterator = typename thrust::device_vector::iterator; using DeviceValIterator = typename thrust::device_vector::iterator; - using HostIteratorPair = typename thrust::pair; - using DeviceIteratorPair = typename thrust::pair; + using HostIteratorPair = typename _THRUST_STD::pair; + using DeviceIteratorPair = typename _THRUST_STD::pair; HostIteratorPair h_last = thrust::unique_by_key(h_keys.begin(), h_keys.end(), h_vals.begin()); DeviceIteratorPair d_last = thrust::unique_by_key(d_keys.begin(), d_keys.end(), d_vals.begin()); @@ -308,8 +308,8 @@ struct TestUniqueCopyByKey using DeviceKeyIterator = typename thrust::device_vector::iterator; using DeviceValIterator = typename thrust::device_vector::iterator; - using HostIteratorPair = typename thrust::pair; - using DeviceIteratorPair = typename thrust::pair; + using HostIteratorPair = typename _THRUST_STD::pair; + using DeviceIteratorPair = typename _THRUST_STD::pair; HostIteratorPair h_last = thrust::unique_by_key_copy( h_keys.begin(), h_keys.end(), h_vals.begin(), h_keys_output.begin(), h_vals_output.begin()); @@ -358,51 +358,51 @@ struct TestUniqueCopyByKeyToDiscardIterator size_t num_unique_keys = h_unique_keys.size(); // mask both outputs - thrust::pair, thrust::discard_iterator<>> h_result1 = thrust::unique_by_key_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> h_result1 = thrust::unique_by_key_copy( h_keys.begin(), h_keys.end(), h_vals.begin(), thrust::make_discard_iterator(), thrust::make_discard_iterator()); - thrust::pair, thrust::discard_iterator<>> d_result1 = thrust::unique_by_key_copy( + _THRUST_STD::pair, thrust::discard_iterator<>> d_result1 = thrust::unique_by_key_copy( d_keys.begin(), d_keys.end(), d_vals.begin(), thrust::make_discard_iterator(), thrust::make_discard_iterator()); - thrust::pair, thrust::discard_iterator<>> reference1 = - thrust::make_pair(thrust::make_discard_iterator(num_unique_keys), thrust::make_discard_iterator(num_unique_keys)); + _THRUST_STD::pair, thrust::discard_iterator<>> reference1 = _THRUST_STD::make_pair( + thrust::make_discard_iterator(num_unique_keys), thrust::make_discard_iterator(num_unique_keys)); ASSERT_EQUAL_QUIET(reference1, h_result1); ASSERT_EQUAL_QUIET(reference1, d_result1); // mask values output - thrust::pair::iterator, thrust::discard_iterator<>> h_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_result2 = thrust::unique_by_key_copy( h_keys.begin(), h_keys.end(), h_vals.begin(), h_keys_output.begin(), thrust::make_discard_iterator()); - thrust::pair::iterator, thrust::discard_iterator<>> d_result2 = + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_result2 = thrust::unique_by_key_copy( d_keys.begin(), d_keys.end(), d_vals.begin(), d_keys_output.begin(), thrust::make_discard_iterator()); - thrust::pair::iterator, thrust::discard_iterator<>> h_reference2 = - thrust::make_pair(h_keys_output.begin() + num_unique_keys, thrust::make_discard_iterator(num_unique_keys)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> h_reference2 = + _THRUST_STD::make_pair(h_keys_output.begin() + num_unique_keys, thrust::make_discard_iterator(num_unique_keys)); - thrust::pair::iterator, thrust::discard_iterator<>> d_reference2 = - thrust::make_pair(d_keys_output.begin() + num_unique_keys, thrust::make_discard_iterator(num_unique_keys)); + _THRUST_STD::pair::iterator, thrust::discard_iterator<>> d_reference2 = + _THRUST_STD::make_pair(d_keys_output.begin() + num_unique_keys, thrust::make_discard_iterator(num_unique_keys)); ASSERT_EQUAL(h_keys_output, d_keys_output); ASSERT_EQUAL_QUIET(h_reference2, h_result2); ASSERT_EQUAL_QUIET(d_reference2, d_result2); // mask keys output - thrust::pair, typename thrust::host_vector::iterator> h_result3 = + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_result3 = thrust::unique_by_key_copy( h_keys.begin(), h_keys.end(), h_vals.begin(), thrust::make_discard_iterator(), h_vals_output.begin()); - thrust::pair, typename thrust::device_vector::iterator> d_result3 = + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_result3 = thrust::unique_by_key_copy( d_keys.begin(), d_keys.end(), d_vals.begin(), thrust::make_discard_iterator(), d_vals_output.begin()); - thrust::pair, typename thrust::host_vector::iterator> h_reference3 = - thrust::make_pair(thrust::make_discard_iterator(num_unique_keys), h_vals_output.begin() + num_unique_keys); + _THRUST_STD::pair, typename thrust::host_vector::iterator> h_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(num_unique_keys), h_vals_output.begin() + num_unique_keys); - thrust::pair, typename thrust::device_vector::iterator> d_reference3 = - thrust::make_pair(thrust::make_discard_iterator(num_unique_keys), d_vals_output.begin() + num_unique_keys); + _THRUST_STD::pair, typename thrust::device_vector::iterator> d_reference3 = + _THRUST_STD::make_pair(thrust::make_discard_iterator(num_unique_keys), d_vals_output.begin() + num_unique_keys); ASSERT_EQUAL(h_vals_output, d_vals_output); ASSERT_EQUAL_QUIET(h_reference3, h_result3); @@ -504,7 +504,7 @@ struct Entry void TestKeysWithoutEqualityOperator() { - using Key = thrust::pair; + using Key = _THRUST_STD::pair; const auto k1 = Key{1, {}}; const auto k2 = Key{2, {}}; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/binary_search.h b/projects/hipccl/hipccl3/rocthrust/thrust/binary_search.h index 38cd22ef6a51..1bc2a9289122 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/binary_search.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/binary_search.h @@ -30,7 +30,8 @@ # pragma system_header #endif // no system header #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN @@ -774,7 +775,7 @@ bool binary_search(ForwardIterator first, ForwardIterator last, const T& value, * \see \p binary_search */ template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -839,7 +840,7 @@ THRUST_HOST_DEVICE thrust::pair equal_range( * \see \p binary_search */ template -thrust::pair +_THRUST_STD::pair equal_range(ForwardIterator first, ForwardIterator last, const LessThanComparable& value); /*! \p equal_range is a version of binary search: it attempts to find @@ -917,7 +918,7 @@ equal_range(ForwardIterator first, ForwardIterator last, const LessThanComparabl * \see \p binary_search */ template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -994,7 +995,7 @@ THRUST_HOST_DEVICE thrust::pair equal_range( * \see \p binary_search */ template -thrust::pair +_THRUST_STD::pair equal_range(ForwardIterator first, ForwardIterator last, const T& value, StrictWeakOrdering comp); /*! \addtogroup vectorized_binary_search Vectorized Searches diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/temporary_allocator.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/temporary_allocator.h index a7b9b5308bd5..4b445d54ab78 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/temporary_allocator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/allocator/temporary_allocator.h @@ -33,9 +33,9 @@ #include #include #include -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) #include _THRUST_STD_INCLUDE(cassert) #if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA @@ -118,7 +118,7 @@ class temporary_allocator : public thrust::detail::tagged_allocator; + using pointer_and_size = _THRUST_STD::pair; }; // end temporary_allocator } // namespace detail THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/binary_search.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/binary_search.inl index 964533dc2c59..382dd507e4f7 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/binary_search.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/binary_search.inl @@ -123,7 +123,7 @@ THRUST_HOST_DEVICE bool binary_search( THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -136,7 +136,7 @@ THRUST_HOST_DEVICE thrust::pair equal_range( THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -346,7 +346,7 @@ bool binary_search(ForwardIterator first, ForwardIterator last, const T& value, } template -thrust::pair +_THRUST_STD::pair equal_range(ForwardIterator first, ForwardIterator last, const LessThanComparable& value) { using thrust::system::detail::generic::select_system; @@ -359,7 +359,7 @@ equal_range(ForwardIterator first, ForwardIterator last, const LessThanComparabl } template -thrust::pair +_THRUST_STD::pair equal_range(ForwardIterator first, ForwardIterator last, const T& value, StrictWeakOrdering comp) { using thrust::system::detail::generic::select_system; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h index e2b2e823fb29..236c122f4ddf 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/execute_with_allocator.h @@ -30,7 +30,6 @@ #include #include #include -#include #include _THRUST_LIBCXX_INCLUDE(__cmath/ceil_div.h) #include _THRUST_STD_INCLUDE(__utility/pair.h) @@ -40,7 +39,7 @@ THRUST_NAMESPACE_BEGIN namespace detail { template class BaseSystem> -THRUST_HOST thrust::pair +THRUST_HOST _THRUST_STD::pair get_temporary_buffer(thrust::detail::execute_with_allocator& system, std::ptrdiff_t n) { using naked_allocator = _THRUST_STD::remove_reference_t; @@ -56,7 +55,7 @@ get_temporary_buffer(thrust::detail::execute_with_allocator(ptr), n); + return _THRUST_STD::make_pair(thrust::reinterpret_pointer_cast(ptr), n); } template class BaseSystem> diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/extrema.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/extrema.inl index 443a35cb454f..251d98261e2d 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/extrema.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/extrema.inl @@ -90,7 +90,7 @@ THRUST_HOST_DEVICE ForwardIterator max_element( THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair minmax_element( +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last) { using thrust::system::detail::generic::minmax_element; @@ -99,7 +99,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair minmax_element( +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -158,7 +158,7 @@ ForwardIterator max_element(ForwardIterator first, ForwardIterator last, BinaryP } // end max_element() template -thrust::pair minmax_element(ForwardIterator first, ForwardIterator last) +_THRUST_STD::pair minmax_element(ForwardIterator first, ForwardIterator last) { using thrust::system::detail::generic::select_system; @@ -170,7 +170,7 @@ thrust::pair minmax_element(ForwardIterator fi } // end minmax_element() template -thrust::pair +_THRUST_STD::pair minmax_element(ForwardIterator first, ForwardIterator last, BinaryPredicate comp) { using thrust::system::detail::generic::select_system; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/merge.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/merge.inl index 2d6507a21d6c..36db57e93421 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/merge.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/merge.inl @@ -89,7 +89,7 @@ template -THRUST_HOST_DEVICE thrust::pair merge_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair merge_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -122,7 +122,7 @@ template -THRUST_HOST_DEVICE thrust::pair merge_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair merge_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -194,7 +194,7 @@ template -thrust::pair merge_by_key( +_THRUST_STD::pair merge_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -240,7 +240,7 @@ template -thrust::pair merge_by_key( +_THRUST_STD::pair merge_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/mismatch.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/mismatch.inl index e531c55dc78f..f97bad718279 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/mismatch.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/mismatch.inl @@ -48,7 +48,7 @@ THRUST_NAMESPACE_BEGIN THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair +THRUST_HOST_DEVICE _THRUST_STD::pair mismatch(const thrust::detail::execution_policy_base& exec, InputIterator1 first1, InputIterator1 last1, @@ -60,7 +60,7 @@ mismatch(const thrust::detail::execution_policy_base& exec, THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair mismatch( +THRUST_HOST_DEVICE _THRUST_STD::pair mismatch( const thrust::detail::execution_policy_base& exec, InputIterator1 first1, InputIterator1 last1, @@ -72,7 +72,7 @@ THRUST_HOST_DEVICE thrust::pair mismatch( } // end mismatch() template -thrust::pair mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) +_THRUST_STD::pair mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) { using thrust::system::detail::generic::select_system; @@ -86,7 +86,7 @@ thrust::pair mismatch(InputIterator1 first1, Inp } // end mismatch() template -thrust::pair +_THRUST_STD::pair mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred) { using thrust::system::detail::generic::select_system; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/partition.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/partition.inl index 1524c0435e2a..eb586af02cd4 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/partition.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/partition.inl @@ -77,7 +77,7 @@ template -THRUST_HOST_DEVICE thrust::pair partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator first, InputIterator last, @@ -97,7 +97,7 @@ template -THRUST_HOST_DEVICE thrust::pair partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 first, InputIterator1 last, @@ -142,7 +142,7 @@ template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator first, InputIterator last, @@ -162,7 +162,7 @@ template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 first, InputIterator1 last, @@ -253,7 +253,7 @@ ForwardIterator stable_partition(ForwardIterator first, ForwardIterator last, In } // end stable_partition() template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( InputIterator first, InputIterator last, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred) { using thrust::system::detail::generic::select_system; @@ -274,7 +274,7 @@ template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( InputIterator1 first, InputIterator1 last, InputIterator2 stencil, @@ -299,7 +299,7 @@ thrust::pair partition_copy( } // end partition_copy() template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( InputIterator first, InputIterator last, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred) { using thrust::system::detail::generic::select_system; @@ -320,7 +320,7 @@ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( InputIterator1 first, InputIterator1 last, InputIterator2 stencil, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/reduce.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/reduce.inl index 65b82a7b360f..8ecd6a3389fb 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/reduce.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/reduce.inl @@ -132,7 +132,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -157,7 +157,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -185,7 +185,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -286,7 +286,7 @@ void reduce_into(InputIterator first, InputIterator last, OutputIterator output, } template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, @@ -314,7 +314,7 @@ template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, @@ -350,7 +350,7 @@ template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/set_operations.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/set_operations.inl index 829117096b0d..463bf4281b82 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/set_operations.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/set_operations.inl @@ -88,7 +88,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -121,7 +121,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -189,7 +189,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_intersection_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_intersection_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -219,7 +219,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_intersection_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_intersection_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -286,7 +286,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_symmetric_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_symmetric_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -319,7 +319,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_symmetric_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_symmetric_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -388,7 +388,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_union_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_union_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -421,7 +421,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_union_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_union_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -493,7 +493,7 @@ template -thrust::pair set_difference_by_key( +_THRUST_STD::pair set_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -539,7 +539,7 @@ template -thrust::pair set_difference_by_key( +_THRUST_STD::pair set_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -622,7 +622,7 @@ template -thrust::pair set_intersection_by_key( +_THRUST_STD::pair set_intersection_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -663,7 +663,7 @@ template -thrust::pair set_intersection_by_key( +_THRUST_STD::pair set_intersection_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -745,7 +745,7 @@ template -thrust::pair set_symmetric_difference_by_key( +_THRUST_STD::pair set_symmetric_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -791,7 +791,7 @@ template -thrust::pair set_symmetric_difference_by_key( +_THRUST_STD::pair set_symmetric_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -875,7 +875,7 @@ template -thrust::pair set_union_by_key( +_THRUST_STD::pair set_union_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -921,7 +921,7 @@ template -thrust::pair set_union_by_key( +_THRUST_STD::pair set_union_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_buffer.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_buffer.h index e0ab6b44893d..d3f6ab12d3d4 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_buffer.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/temporary_buffer.h @@ -30,7 +30,8 @@ #include #include #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) // Include all active backend system implementations (generic, sequential, host and device) #include @@ -52,15 +53,15 @@ namespace detail { template THRUST_HOST_DEVICE - thrust::pair, typename thrust::pointer::difference_type> - down_cast_pair(Pair p) +_THRUST_STD::pair, typename thrust::pointer::difference_type> +down_cast_pair(Pair p) { // XXX should use a hypothetical thrust::static_pointer_cast here thrust::pointer ptr = thrust::pointer(static_cast(thrust::raw_pointer_cast(p.first))); using result_type = - thrust::pair, typename thrust::pointer::difference_type>; + _THRUST_STD::pair, typename thrust::pointer::difference_type>; return result_type(ptr, p.second); } // end down_cast_pair() } // namespace detail @@ -68,9 +69,9 @@ THRUST_HOST_DEVICE THRUST_EXEC_CHECK_DISABLE template THRUST_HOST_DEVICE - thrust::pair, typename thrust::pointer::difference_type> - get_temporary_buffer(const thrust::detail::execution_policy_base& exec, - typename thrust::pointer::difference_type n) +_THRUST_STD::pair, typename thrust::pointer::difference_type> +get_temporary_buffer(const thrust::detail::execution_policy_base& exec, + typename thrust::pointer::difference_type n) { using thrust::detail::get_temporary_buffer; // execute_with_allocator using thrust::system::detail::generic::get_temporary_buffer; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/unique.inl b/projects/hipccl/hipccl3/rocthrust/thrust/detail/unique.inl index 8af545a0905b..6cc3e2342991 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/unique.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/unique.inl @@ -104,7 +104,7 @@ THRUST_HOST_DEVICE OutputIterator unique_copy( THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( const thrust::detail::execution_policy_base& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -117,7 +117,7 @@ THRUST_HOST_DEVICE thrust::pair unique_by_ke THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( const thrust::detail::execution_policy_base& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -135,7 +135,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -160,7 +160,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -233,7 +233,7 @@ OutputIterator unique_copy(InputIterator first, InputIterator last, OutputIterat } // end unique_copy() template -thrust::pair +_THRUST_STD::pair unique_by_key(ForwardIterator1 keys_first, ForwardIterator1 keys_last, ForwardIterator2 values_first) { using thrust::system::detail::generic::select_system; @@ -248,7 +248,7 @@ unique_by_key(ForwardIterator1 keys_first, ForwardIterator1 keys_last, ForwardIt } // end unique_by_key() template -thrust::pair unique_by_key( +_THRUST_STD::pair unique_by_key( ForwardIterator1 keys_first, ForwardIterator1 keys_last, ForwardIterator2 values_first, BinaryPredicate binary_pred) { using thrust::system::detail::generic::select_system; @@ -263,7 +263,7 @@ thrust::pair unique_by_key( } // end unique_by_key() template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, @@ -291,7 +291,7 @@ template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/extrema.h b/projects/hipccl/hipccl3/rocthrust/thrust/extrema.h index 128ff58d614d..7594b6829981 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/extrema.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/extrema.h @@ -30,7 +30,8 @@ # pragma system_header #endif // no system header #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) #if !_THRUST_HAS_DEVICE_SYSTEM_STD # include #endif @@ -480,7 +481,7 @@ ForwardIterator max_element(ForwardIterator first, ForwardIterator last, BinaryP * #include * ... * int data[6] = {1, 0, 2, 2, 1, 3}; - * thrust::pair result = thrust::minmax_element(thrust::host, data, data + 6); + * _THRUST_STD::pair result = thrust::minmax_element(thrust::host, data, data + 6); * * // result.first is data + 1 * // result.second is data + 5 @@ -493,7 +494,7 @@ ForwardIterator max_element(ForwardIterator first, ForwardIterator last, BinaryP * \see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1840.pdf */ template -THRUST_HOST_DEVICE thrust::pair minmax_element( +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last); /*! \p minmax_element finds the smallest and largest elements in the range [first, last). @@ -514,7 +515,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element * #include * ... * int data[6] = {1, 0, 2, 2, 1, 3}; - * thrust::pair result = thrust::minmax_element(data, data + 6); + * _THRUST_STD::pair result = thrust::minmax_element(data, data + 6); * * // result.first is data + 1 * // result.second is data + 5 @@ -527,7 +528,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element * \see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1840.pdf */ template -thrust::pair minmax_element(ForwardIterator first, ForwardIterator last); +_THRUST_STD::pair minmax_element(ForwardIterator first, ForwardIterator last); /*! \p minmax_element finds the smallest and largest elements in the range [first, last). * It returns a pair of iterators (imin, imax) where \c imin is the same iterator @@ -576,7 +577,7 @@ thrust::pair minmax_element(ForwardIterator fi * ... * key_value data[4] = { {4,5}, {0,7}, {2,3}, {6,1} }; * - * thrust::pair extrema = thrust::minmax_element(thrust::host, data, data + 4, + * _THRUST_STD::pair extrema = thrust::minmax_element(thrust::host, data, data + 4, * compare_key_value()); * * // extrema.first == data + 1 @@ -590,7 +591,7 @@ thrust::pair minmax_element(ForwardIterator fi * \see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1840.pdf */ template -THRUST_HOST_DEVICE thrust::pair minmax_element( +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element( const thrust::detail::execution_policy_base& exec, ForwardIterator first, ForwardIterator last, @@ -637,7 +638,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element * ... * key_value data[4] = { {4,5}, {0,7}, {2,3}, {6,1} }; * - * thrust::pair extrema = thrust::minmax_element(data, data + 4, compare_key_value()); + * _THRUST_STD::pair extrema = thrust::minmax_element(data, data + 4, compare_key_value()); * * // extrema.first == data + 1 * // *extrema.first == {0,7} @@ -650,7 +651,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element * \see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1840.pdf */ template -thrust::pair +_THRUST_STD::pair minmax_element(ForwardIterator first, ForwardIterator last, BinaryPredicate comp); /*! \} // end extrema diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h index 25fb17eb1d39..e3db3101dcde 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h @@ -29,9 +29,10 @@ #include #include -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + #if _THRUST_HAS_DEVICE_SYSTEM_STD # include _THRUST_STD_INCLUDE(tuple) # include _THRUST_STD_INCLUDE(type_traits) @@ -98,7 +99,7 @@ class tuple_of_iterator_references : public tuple // XXX might be worthwhile to guard this with an enable_if is_assignable THRUST_EXEC_CHECK_DISABLE template - THRUST_HOST_DEVICE tuple_of_iterator_references& operator=(const pair& other) + THRUST_HOST_DEVICE tuple_of_iterator_references& operator=(const _THRUST_STD::pair& other) { super_t::operator=(other); return *this; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/memory.h b/projects/hipccl/hipccl3/rocthrust/thrust/memory.h index d7882810a4ca..5166904c6f30 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/memory.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/memory.h @@ -148,7 +148,7 @@ malloc(const thrust::detail::execution_policy_base& system, std:: * // allocate storage for 100 ints with thrust::get_temporary_buffer * const int N = 100; * - * using ptr_and_size_t = thrust::pair< + * using ptr_and_size_t = _THRUST_STD::pair< * thrust::pointer, * std::ptrdiff_t * >; @@ -171,9 +171,9 @@ malloc(const thrust::detail::execution_policy_base& system, std:: */ template THRUST_HOST_DEVICE - thrust::pair, typename thrust::pointer::difference_type> - get_temporary_buffer(const thrust::detail::execution_policy_base& system, - typename thrust::pointer::difference_type n); +_THRUST_STD::pair, typename thrust::pointer::difference_type> +get_temporary_buffer(const thrust::detail::execution_policy_base& system, + typename thrust::pointer::difference_type n); /*! \p free deallocates the storage previously allocated by \p thrust::malloc. * @@ -230,7 +230,7 @@ THRUST_HOST_DEVICE void free(const thrust::detail::execution_policy_base, * std::ptrdiff_t * >; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/merge.h b/projects/hipccl/hipccl3/rocthrust/thrust/merge.h index d7bb43f247fd..30cfdcd60234 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/merge.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/merge.h @@ -30,7 +30,8 @@ # pragma system_header #endif // no system header #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN @@ -384,7 +385,7 @@ merge(InputIterator1 first1, * int keys_result[13]; * int vals_result[13]; * - * thrust::pair end = + * _THRUST_STD::pair end = * thrust::merge_by_key(thrust::host, * A_keys, A_keys + 6, * B_keys, B_keys + 7, @@ -406,7 +407,7 @@ template -THRUST_HOST_DEVICE thrust::pair merge_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair merge_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -486,7 +487,7 @@ THRUST_HOST_DEVICE thrust::pair merge_by_key( * int keys_result[13]; * int vals_result[13]; * - * thrust::pair end = thrust::merge_by_key(A_keys, A_keys + 6, B_keys, B_keys + 7, A_vals, B_vals, + * _THRUST_STD::pair end = thrust::merge_by_key(A_keys, A_keys + 6, B_keys, B_keys + 7, A_vals, B_vals, * keys_result, vals_result); * * // keys_result = {1, 1, 1, 2, 3, 3, 5, 5, 7, 8, 9, 11, 13} @@ -503,7 +504,7 @@ template -thrust::pair merge_by_key( +_THRUST_STD::pair merge_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -585,7 +586,7 @@ thrust::pair merge_by_key( * int keys_result[13]; * int vals_result[13]; * - * thrust::pair end = + * _THRUST_STD::pair end = * thrust::merge_by_key(thrust::host, * A_keys, A_keys + 6, * B_keys, B_keys + 7, @@ -609,7 +610,7 @@ template -THRUST_HOST_DEVICE thrust::pair merge_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair merge_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -688,7 +689,7 @@ THRUST_HOST_DEVICE thrust::pair merge_by_key( * int keys_result[13]; * int vals_result[13]; * - * thrust::pair end = thrust::merge_by_key(A_keys, A_keys + 6, B_keys, B_keys + 7, A_vals, B_vals, + * _THRUST_STD::pair end = thrust::merge_by_key(A_keys, A_keys + 6, B_keys, B_keys + 7, A_vals, B_vals, * keys_result, vals_result, _THRUST_STD::greater()); * * // keys_result = {13, 11, 9, 8, 7, 5, 5, 3, 3, 2, 1, 1, 1} @@ -706,7 +707,7 @@ template -thrust::pair merge_by_key( +_THRUST_STD::pair merge_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/mismatch.h b/projects/hipccl/hipccl3/rocthrust/thrust/mismatch.h index d2043bf4c9ba..55cb28cdff7a 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/mismatch.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/mismatch.h @@ -30,7 +30,8 @@ # pragma system_header #endif // no system header #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN @@ -80,7 +81,7 @@ THRUST_NAMESPACE_BEGIN * vec1[3] = 7; vec2[3] = 7; * * using Iterator = thrust::device_vector::iterator; - * thrust::pair result; + * _THRUST_STD::pair result; * * result = thrust::mismatch(thrust::device, vec1.begin(), vec1.end(), vec2.begin()); * @@ -92,7 +93,7 @@ THRUST_NAMESPACE_BEGIN * \see find_if */ template -THRUST_HOST_DEVICE thrust::pair +THRUST_HOST_DEVICE _THRUST_STD::pair mismatch(const thrust::detail::execution_policy_base& exec, InputIterator1 first1, InputIterator1 last1, @@ -131,7 +132,7 @@ mismatch(const thrust::detail::execution_policy_base& exec, * vec1[3] = 7; vec2[3] = 7; * * using Iterator = thrust::device_vector::iterator; - * thrust::pair result; + * _THRUST_STD::pair result; * * result = thrust::mismatch(vec1.begin(), vec1.end(), vec2.begin()); * @@ -143,7 +144,7 @@ mismatch(const thrust::detail::execution_policy_base& exec, * \see find_if */ template -thrust::pair +_THRUST_STD::pair mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); /*! \p mismatch finds the first position where the two ranges [first1, last1) @@ -185,7 +186,7 @@ mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); * vec1[3] = 7; vec2[3] = 7; * * using Iterator = thrust::device_vector::iterator; - * thrust::pair result; + * _THRUST_STD::pair result; * * result = thrust::mismatch(thrust::device, vec1.begin(), vec1.end(), vec2.begin(), _THRUST_STD::equal_to()); * @@ -197,7 +198,7 @@ mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); * \see find_if */ template -THRUST_HOST_DEVICE thrust::pair mismatch( +THRUST_HOST_DEVICE _THRUST_STD::pair mismatch( const thrust::detail::execution_policy_base& exec, InputIterator1 first1, InputIterator1 last1, @@ -238,7 +239,7 @@ THRUST_HOST_DEVICE thrust::pair mismatch( * vec1[3] = 7; vec2[3] = 7; * * using Iterator = thrust::device_vector::iterator; - * thrust::pair result; + * _THRUST_STD::pair result; * * result = thrust::mismatch(vec1.begin(), vec1.end(), vec2.begin(), _THRUST_STD::equal_to()); * @@ -250,7 +251,7 @@ THRUST_HOST_DEVICE thrust::pair mismatch( * \see find_if */ template -thrust::pair +_THRUST_STD::pair mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred); /*! \} // end searching diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/partition.h b/projects/hipccl/hipccl3/rocthrust/thrust/partition.h index 8d25651aeb0e..19552446b404 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/partition.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/partition.h @@ -30,7 +30,8 @@ # pragma system_header #endif // no system header #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN @@ -361,7 +362,7 @@ template -THRUST_HOST_DEVICE thrust::pair partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator first, InputIterator last, @@ -433,7 +434,7 @@ THRUST_HOST_DEVICE thrust::pair partition_copy * \see \p partition */ template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( InputIterator first, InputIterator last, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred); /*! \p partition_copy differs from \p partition only in that the reordered @@ -508,7 +509,7 @@ template -THRUST_HOST_DEVICE thrust::pair partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 first, InputIterator1 last, @@ -582,7 +583,7 @@ template -thrust::pair partition_copy( +_THRUST_STD::pair partition_copy( InputIterator1 first, InputIterator1 last, InputIterator2 stencil, @@ -920,7 +921,7 @@ template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator first, InputIterator last, @@ -994,7 +995,7 @@ THRUST_HOST_DEVICE thrust::pair stable_partiti * \see \p stable_partition */ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( InputIterator first, InputIterator last, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred); /*! \p stable_partition_copy differs from \p stable_partition only in that the reordered @@ -1071,7 +1072,7 @@ template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 first, InputIterator1 last, @@ -1147,7 +1148,7 @@ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( InputIterator1 first, InputIterator1 last, InputIterator2 stencil, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/random/detail/normal_distribution_base.h b/projects/hipccl/hipccl3/rocthrust/thrust/random/detail/normal_distribution_base.h index fe6f3bc42be0..a4b93e51975f 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/random/detail/normal_distribution_base.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/random/detail/normal_distribution_base.h @@ -33,7 +33,6 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include #include _THRUST_STD_INCLUDE(cmath) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/random/normal_distribution.h b/projects/hipccl/hipccl3/rocthrust/thrust/random/normal_distribution.h index 2176a0999c0e..6f7d110a4b4d 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/random/normal_distribution.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/random/normal_distribution.h @@ -29,10 +29,11 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + #include THRUST_NAMESPACE_BEGIN @@ -100,7 +101,7 @@ class normal_distribution : public detail::normal_distribution_base::t /*! \typedef param_type * \brief The type of the object encapsulating this \p normal_distribution's parameters. */ - using param_type = thrust::pair; + using param_type = _THRUST_STD::pair; // constructors and reset functions diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/random/uniform_int_distribution.h b/projects/hipccl/hipccl3/rocthrust/thrust/random/uniform_int_distribution.h index 171cd478d42e..f176603f4425 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/random/uniform_int_distribution.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/random/uniform_int_distribution.h @@ -29,9 +29,9 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) #include _THRUST_STD_INCLUDE(limits) #include @@ -105,7 +105,7 @@ class uniform_int_distribution /*! \typedef param_type * \brief The type of the object encapsulating this \p uniform_int_distribution's parameters. */ - using param_type = thrust::pair; + using param_type = _THRUST_STD::pair; // constructors and reset functions diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/random/uniform_real_distribution.h b/projects/hipccl/hipccl3/rocthrust/thrust/random/uniform_real_distribution.h index 3622a9f239f7..d2ecd4e74b4c 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/random/uniform_real_distribution.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/random/uniform_real_distribution.h @@ -29,9 +29,10 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + #include THRUST_NAMESPACE_BEGIN @@ -102,7 +103,7 @@ class uniform_real_distribution /*! \typedef param_type * \brief The type of the object encapsulating this \p uniform_real_distribution's parameters. */ - using param_type = thrust::pair; + using param_type = _THRUST_STD::pair; // constructors and reset functions diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/reduce.h b/projects/hipccl/hipccl3/rocthrust/thrust/reduce.h index c52541933224..bb386c4688d7 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/reduce.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/reduce.h @@ -31,7 +31,8 @@ #endif // no system header #include #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN @@ -721,7 +722,7 @@ void reduce_into(InputIterator first, InputIterator last, OutputIterator output, * int C[N]; // output keys * int D[N]; // output values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * new_end = thrust::reduce_by_key(thrust::host, A, A + N, B, C, D); * * // The first four keys in C are now {1, 3, 2, 1} and new_end.first - C is 4. @@ -738,7 +739,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -785,7 +786,7 @@ THRUST_HOST_DEVICE thrust::pair reduce_by_key( * int C[N]; // output keys * int D[N]; // output values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * new_end = thrust::reduce_by_key(A, A + N, B, C, D); * * // The first four keys in C are now {1, 3, 2, 1} and new_end.first - C is 4. @@ -798,7 +799,7 @@ THRUST_HOST_DEVICE thrust::pair reduce_by_key( * \see unique_by_key_copy */ template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, @@ -852,7 +853,7 @@ thrust::pair reduce_by_key( * int C[N]; // output keys * int D[N]; // output values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * _THRUST_STD::equal_to binary_pred; * new_end = thrust::reduce_by_key(thrust::host, A, A + N, B, C, D, binary_pred); * @@ -871,7 +872,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -921,7 +922,7 @@ THRUST_HOST_DEVICE thrust::pair reduce_by_key( * int C[N]; // output keys * int D[N]; // output values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * _THRUST_STD::equal_to binary_pred; * new_end = thrust::reduce_by_key(A, A + N, B, C, D, binary_pred); * @@ -939,7 +940,7 @@ template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, @@ -999,7 +1000,7 @@ thrust::pair reduce_by_key( * int C[N]; // output keys * int D[N]; // output values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * _THRUST_STD::equal_to binary_pred; * _THRUST_STD::plus binary_op; * new_end = thrust::reduce_by_key(thrust::host, A, A + N, B, C, D, binary_pred, binary_op); @@ -1020,7 +1021,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -1076,7 +1077,7 @@ THRUST_HOST_DEVICE thrust::pair reduce_by_key( * int C[N]; // output keys * int D[N]; // output values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * _THRUST_STD::equal_to binary_pred; * _THRUST_STD::plus binary_op; * new_end = thrust::reduce_by_key(A, A + N, B, C, D, binary_pred, binary_op); @@ -1096,7 +1097,7 @@ template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/set_operations.h b/projects/hipccl/hipccl3/rocthrust/thrust/set_operations.h index 07be193e0552..b0c3ff2f1f18 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/set_operations.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/set_operations.h @@ -30,7 +30,8 @@ # pragma system_header #endif // no system header #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN @@ -1372,8 +1373,8 @@ OutputIterator set_union( * int keys_result[3]; * int vals_result[3]; * - * thrust::pair end = thrust::set_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, B_keys + 5, - * A_vals, B_vals, keys_result, vals_result); + * _THRUST_STD::pair end = thrust::set_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, B_keys + + * 5, A_vals, B_vals, keys_result, vals_result); * // keys_result is now {0, 4, 6} * // vals_result is now {0, 0, 0} * \endcode @@ -1391,7 +1392,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -1474,8 +1475,8 @@ THRUST_HOST_DEVICE thrust::pair set_difference * int keys_result[3]; * int vals_result[3]; * - * thrust::pair end = thrust::set_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, A_vals, B_vals, - * keys_result, vals_result); + * _THRUST_STD::pair end = thrust::set_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, A_vals, + * B_vals, keys_result, vals_result); * // keys_result is now {0, 4, 6} * // vals_result is now {0, 0, 0} * \endcode @@ -1492,7 +1493,7 @@ template -thrust::pair set_difference_by_key( +_THRUST_STD::pair set_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -1584,8 +1585,8 @@ thrust::pair set_difference_by_key( * int keys_result[3]; * int vals_result[3]; * - * thrust::pair end = thrust::set_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, B_keys + 5, - * A_vals, B_vals, keys_result, vals_result, _THRUST_STD::greater()); + * _THRUST_STD::pair end = thrust::set_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, B_keys + + * 5, A_vals, B_vals, keys_result, vals_result, _THRUST_STD::greater()); * // keys_result is now {0, 4, 6} * // vals_result is now {0, 0, 0} * \endcode @@ -1604,7 +1605,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -1692,8 +1693,8 @@ THRUST_HOST_DEVICE thrust::pair set_difference * int keys_result[3]; * int vals_result[3]; * - * thrust::pair end = thrust::set_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, A_vals, B_vals, - * keys_result, vals_result, _THRUST_STD::greater()); + * _THRUST_STD::pair end = thrust::set_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, A_vals, + * B_vals, keys_result, vals_result, _THRUST_STD::greater()); * // keys_result is now {0, 4, 6} * // vals_result is now {0, 0, 0} * \endcode @@ -1711,7 +1712,7 @@ template -thrust::pair set_difference_by_key( +_THRUST_STD::pair set_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -1800,8 +1801,8 @@ thrust::pair set_difference_by_key( * int keys_result[7]; * int vals_result[7]; * - * thrust::pair end = thrust::set_intersection_by_key(thrust::host, A_keys, A_keys + 6, B_keys, B_keys + 7, - * A_vals, keys_result, vals_result); + * _THRUST_STD::pair end = thrust::set_intersection_by_key(thrust::host, A_keys, A_keys + 6, B_keys, B_keys + * + 7, A_vals, keys_result, vals_result); * * // keys_result is now {1, 3, 5} * // vals_result is now {0, 0, 0} @@ -1819,7 +1820,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_intersection_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_intersection_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -1901,7 +1902,7 @@ THRUST_HOST_DEVICE thrust::pair set_intersecti * int keys_result[7]; * int vals_result[7]; * - * thrust::pair end = thrust::set_intersection_by_key(A_keys, A_keys + 6, B_keys, B_keys + 7, A_vals, + * _THRUST_STD::pair end = thrust::set_intersection_by_key(A_keys, A_keys + 6, B_keys, B_keys + 7, A_vals, * keys_result, vals_result); * * // keys_result is now {1, 3, 5} @@ -1919,7 +1920,7 @@ template -thrust::pair set_intersection_by_key( +_THRUST_STD::pair set_intersection_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -2010,8 +2011,8 @@ thrust::pair set_intersection_by_key( * int keys_result[7]; * int vals_result[7]; * - * thrust::pair end = thrust::set_intersection_by_key(thrust::host, A_keys, A_keys + 6, B_keys, B_keys + 7, - * A_vals, keys_result, vals_result, _THRUST_STD::greater()); + * _THRUST_STD::pair end = thrust::set_intersection_by_key(thrust::host, A_keys, A_keys + 6, B_keys, B_keys + * + 7, A_vals, keys_result, vals_result, _THRUST_STD::greater()); * * // keys_result is now {5, 3, 1} * // vals_result is now {0, 0, 0} @@ -2030,7 +2031,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_intersection_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_intersection_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -2117,7 +2118,7 @@ THRUST_HOST_DEVICE thrust::pair set_intersecti * int keys_result[7]; * int vals_result[7]; * - * thrust::pair end = thrust::set_intersection_by_key(A_keys, A_keys + 6, B_keys, B_keys + 7, A_vals, + * _THRUST_STD::pair end = thrust::set_intersection_by_key(A_keys, A_keys + 6, B_keys, B_keys + 7, A_vals, * keys_result, vals_result, _THRUST_STD::greater()); * * // keys_result is now {5, 3, 1} @@ -2136,7 +2137,7 @@ template -thrust::pair set_intersection_by_key( +_THRUST_STD::pair set_intersection_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -2227,7 +2228,7 @@ thrust::pair set_intersection_by_key( * int keys_result[6]; * int vals_result[6]; * - * thrust::pair end = thrust::set_symmetric_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, + * _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, * B_keys + 5, A_vals, B_vals, keys_result, vals_result); * // keys_result is now {0, 4, 5, 6, 7, 8} * // vals_result is now {0, 0, 1, 0, 0, 1} @@ -2246,7 +2247,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_symmetric_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_symmetric_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -2332,7 +2333,7 @@ THRUST_HOST_DEVICE thrust::pair set_symmetric_ * int keys_result[6]; * int vals_result[6]; * - * thrust::pair end = thrust::set_symmetric_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, + * _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, * A_vals, B_vals, keys_result, vals_result); * // keys_result is now {0, 4, 5, 6, 7, 8} * // vals_result is now {0, 0, 1, 0, 0, 1} @@ -2350,7 +2351,7 @@ template -thrust::pair set_symmetric_difference_by_key( +_THRUST_STD::pair set_symmetric_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -2445,7 +2446,7 @@ thrust::pair set_symmetric_difference_by_key( * int keys_result[6]; * int vals_result[6]; * - * thrust::pair end = thrust::set_symmetric_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, + * _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, * B_keys + 5, A_vals, B_vals, keys_result, vals_result); * // keys_result is now {8, 7, 6, 5, 4, 0} * // vals_result is now {1, 0, 0, 1, 0, 0} @@ -2465,7 +2466,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_symmetric_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_symmetric_difference_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -2556,7 +2557,7 @@ THRUST_HOST_DEVICE thrust::pair set_symmetric_ * int keys_result[6]; * int vals_result[6]; * - * thrust::pair end = thrust::set_symmetric_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, + * _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, * A_vals, B_vals, keys_result, vals_result); * // keys_result is now {8, 7, 6, 5, 4, 0} * // vals_result is now {1, 0, 0, 1, 0, 0} @@ -2575,7 +2576,7 @@ template -thrust::pair set_symmetric_difference_by_key( +_THRUST_STD::pair set_symmetric_difference_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -2665,7 +2666,7 @@ thrust::pair set_symmetric_difference_by_key( * int keys_result[11]; * int vals_result[11]; * - * thrust::pair end = thrust::set_symmetric_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, + * _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, * B_keys + 5, A_vals, B_vals, keys_result, vals_result); * // keys_result is now {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12} * // vals_result is now {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0} @@ -2684,7 +2685,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_union_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_union_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -2768,7 +2769,7 @@ THRUST_HOST_DEVICE thrust::pair set_union_by_k * int keys_result[11]; * int vals_result[11]; * - * thrust::pair end = thrust::set_symmetric_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, + * _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, * A_vals, B_vals, keys_result, vals_result); * // keys_result is now {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12} * // vals_result is now {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0} @@ -2786,7 +2787,7 @@ template -thrust::pair set_union_by_key( +_THRUST_STD::pair set_union_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, @@ -2879,7 +2880,7 @@ thrust::pair set_union_by_key( * int keys_result[11]; * int vals_result[11]; * - * thrust::pair end = thrust::set_symmetric_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, + * _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key(thrust::host, A_keys, A_keys + 6, B_keys, * B_keys + 5, A_vals, B_vals, keys_result, vals_result, _THRUST_STD::greater()); * // keys_result is now {12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0} * // vals_result is now { 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0} @@ -2899,7 +2900,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_union_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_union_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -2988,7 +2989,7 @@ THRUST_HOST_DEVICE thrust::pair set_union_by_k * int keys_result[11]; * int vals_result[11]; * - * thrust::pair end = thrust::set_symmetric_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, + * _THRUST_STD::pair end = thrust::set_symmetric_difference_by_key(A_keys, A_keys + 6, B_keys, B_keys + 5, * A_vals, B_vals, keys_result, vals_result, _THRUST_STD::greater()); * // keys_result is now {12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0} * // vals_result is now { 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0} @@ -3007,7 +3008,7 @@ template -thrust::pair set_union_by_key( +_THRUST_STD::pair set_union_by_key( InputIterator1 keys_first1, InputIterator1 keys_last1, InputIterator2 keys_first2, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/binary_search.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/binary_search.h index 9cf1b169d564..56134fe33fd0 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/binary_search.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/binary_search.h @@ -140,14 +140,14 @@ THRUST_HOST_DEVICE OutputIterator binary_search( StrictWeakOrdering comp); template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( thrust::execution_policy& exec, ForwardIterator first, ForwardIterator last, const LessThanComparable& value); template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( thrust::execution_policy& exec, ForwardIterator first, ForwardIterator last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/binary_search.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/binary_search.inl index 6857b31f0c90..a9510be8f325 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/binary_search.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/binary_search.inl @@ -345,7 +345,7 @@ THRUST_HOST_DEVICE OutputIterator binary_search( } template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( thrust::execution_policy& exec, ForwardIterator first, ForwardIterator last, @@ -355,7 +355,7 @@ THRUST_HOST_DEVICE thrust::pair equal_range( } template -THRUST_HOST_DEVICE thrust::pair equal_range( +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range( thrust::execution_policy& exec, ForwardIterator first, ForwardIterator last, @@ -364,7 +364,7 @@ THRUST_HOST_DEVICE thrust::pair equal_range( { ForwardIterator lb = thrust::lower_bound(exec, first, last, value, comp); ForwardIterator ub = thrust::upper_bound(exec, first, last, value, comp); - return thrust::make_pair(lb, ub); + return _THRUST_STD::make_pair(lb, ub); } } // namespace system::detail::generic THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/extrema.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/extrema.h index 21caef0769b3..de2b8b2c9975 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/extrema.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/extrema.h @@ -29,9 +29,10 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::detail::generic { @@ -52,11 +53,11 @@ THRUST_HOST_DEVICE ForwardIterator min_element( thrust::execution_policy& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate comp); template -THRUST_HOST_DEVICE thrust::pair +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element(thrust::execution_policy& exec, ForwardIterator first, ForwardIterator last); template -THRUST_HOST_DEVICE thrust::pair minmax_element( +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element( thrust::execution_policy& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate comp); } // namespace system::detail::generic THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/extrema.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/extrema.inl index aa50e4ae2128..136f2cb36c8b 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/extrema.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/extrema.inl @@ -31,10 +31,11 @@ #include #include #include -#include #include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::detail::generic { @@ -208,7 +209,7 @@ THRUST_HOST_DEVICE ForwardIterator max_element( } // end max_element() template -THRUST_HOST_DEVICE thrust::pair +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element(thrust::execution_policy& exec, ForwardIterator first, ForwardIterator last) { using value_type = thrust::detail::it_value_t; @@ -217,12 +218,12 @@ minmax_element(thrust::execution_policy& exec, ForwardIterator fi } // end minmax_element() template -THRUST_HOST_DEVICE thrust::pair minmax_element( +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element( thrust::execution_policy& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate comp) { if (first == last) { - return thrust::make_pair(last, last); + return _THRUST_STD::make_pair(last, last); } using InputType = thrust::detail::it_value_t; @@ -238,7 +239,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element thrust::tuple(thrust::detail::get_iterator_value(derived_cast(exec), first), 0)), detail::minmax_element_reduction(comp)); - return thrust::make_pair(first + thrust::get<1>(thrust::get<0>(result)), + return _THRUST_STD::make_pair(first + thrust::get<1>(thrust::get<0>(result)), first + thrust::get<1>(thrust::get<1>(result))); } // end minmax_element() } // namespace system::detail::generic diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/memory.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/memory.h index d640c3ff8881..81ed5a1b3016 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/memory.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/memory.h @@ -33,7 +33,6 @@ #include #include #include -#include #include THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/merge.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/merge.h index 68ea635655c6..99f0e7c240f4 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/merge.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/merge.h @@ -62,7 +62,7 @@ template -THRUST_HOST_DEVICE thrust::pair merge_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair merge_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -81,7 +81,7 @@ template -THRUST_HOST_DEVICE thrust::pair merge_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair merge_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/merge.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/merge.inl index ef838b7fe079..29d07042b2bd 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/merge.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/merge.inl @@ -74,7 +74,7 @@ template -THRUST_HOST_DEVICE thrust::pair merge_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair merge_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -108,7 +108,7 @@ THRUST_HOST_DEVICE thrust::pair merge_by_key( thrust::merge(exec, zipped_first1, zipped_last1, zipped_first2, zipped_last2, zipped_result, comp_first) .get_iterator_tuple(); - return thrust::make_pair(thrust::get<0>(result), thrust::get<1>(result)); + return _THRUST_STD::make_pair(thrust::get<0>(result), thrust::get<1>(result)); } // end merge_by_key() template -THRUST_HOST_DEVICE thrust::pair merge_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair merge_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/mismatch.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/mismatch.h index 57c28f169110..493c0619b6f0 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/mismatch.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/mismatch.h @@ -31,11 +31,11 @@ THRUST_NAMESPACE_BEGIN namespace system::detail::generic { template -THRUST_HOST_DEVICE thrust::pair mismatch( +THRUST_HOST_DEVICE _THRUST_STD::pair mismatch( thrust::execution_policy& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2); template -THRUST_HOST_DEVICE thrust::pair mismatch( +THRUST_HOST_DEVICE _THRUST_STD::pair mismatch( thrust::execution_policy& exec, InputIterator1 first1, InputIterator1 last1, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/mismatch.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/mismatch.inl index 76e408785836..e238b0ca6e8c 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/mismatch.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/mismatch.inl @@ -34,7 +34,7 @@ THRUST_NAMESPACE_BEGIN namespace system::detail::generic { template -THRUST_HOST_DEVICE thrust::pair mismatch( +THRUST_HOST_DEVICE _THRUST_STD::pair mismatch( thrust::execution_policy& exec, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) { using namespace thrust::placeholders; @@ -43,7 +43,7 @@ THRUST_HOST_DEVICE thrust::pair mismatch( } // end mismatch() template -THRUST_HOST_DEVICE thrust::pair mismatch( +THRUST_HOST_DEVICE _THRUST_STD::pair mismatch( thrust::execution_policy& exec, InputIterator1 first1, InputIterator1 last1, @@ -60,7 +60,7 @@ THRUST_HOST_DEVICE thrust::pair mismatch( ZipIterator result = thrust::find_if_not(exec, zipped_first, zipped_last, thrust::detail::tuple_binary_predicate{pred}); - return thrust::make_pair(thrust::get<0>(result.get_iterator_tuple()), thrust::get<1>(result.get_iterator_tuple())); + return _THRUST_STD::make_pair(thrust::get<0>(result.get_iterator_tuple()), thrust::get<1>(result.get_iterator_tuple())); } // end mismatch() } // namespace system::detail::generic THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/partition.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/partition.h index 3c6be85cf9ec..1aca4ca045c7 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/partition.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/partition.h @@ -51,7 +51,7 @@ template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( thrust::execution_policy& exec, InputIterator first, InputIterator last, @@ -65,7 +65,7 @@ template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( thrust::execution_policy& exec, InputIterator1 first, InputIterator1 last, @@ -91,7 +91,7 @@ template -THRUST_HOST_DEVICE thrust::pair partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair partition_copy( thrust::execution_policy& exec, InputIterator first, InputIterator last, @@ -105,7 +105,7 @@ template -THRUST_HOST_DEVICE thrust::pair partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair partition_copy( thrust::execution_policy& exec, InputIterator1 first, InputIterator1 last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/partition.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/partition.inl index 748028d4c792..51dd971614ec 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/partition.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/partition.inl @@ -31,12 +31,13 @@ #include #include #include -#include #include #include #include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::detail::generic { @@ -89,7 +90,7 @@ template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( thrust::execution_policy& exec, InputIterator first, InputIterator last, @@ -105,7 +106,7 @@ THRUST_HOST_DEVICE thrust::pair stable_partiti // remove_copy_if the false partition to out_false OutputIterator2 end_of_false_partition = thrust::remove_copy_if(exec, first, last, out_false, pred); - return thrust::make_pair(end_of_true_partition, end_of_false_partition); + return _THRUST_STD::make_pair(end_of_true_partition, end_of_false_partition); } // end stable_partition_copy() template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( thrust::execution_policy& exec, InputIterator1 first, InputIterator1 last, @@ -131,7 +132,7 @@ THRUST_HOST_DEVICE thrust::pair stable_partiti // remove_copy_if the false partition to out_false OutputIterator2 end_of_false_partition = thrust::remove_copy_if(exec, first, last, stencil, out_false, pred); - return thrust::make_pair(end_of_true_partition, end_of_false_partition); + return _THRUST_STD::make_pair(end_of_true_partition, end_of_false_partition); } // end stable_partition_copy() template @@ -157,7 +158,7 @@ template -THRUST_HOST_DEVICE thrust::pair partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair partition_copy( thrust::execution_policy& exec, InputIterator first, InputIterator last, @@ -174,7 +175,7 @@ template -THRUST_HOST_DEVICE thrust::pair partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair partition_copy( thrust::execution_policy& exec, InputIterator1 first, InputIterator1 last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.h index 85f5898e3320..ed121f7cc13a 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.h @@ -36,7 +36,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( thrust::execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -50,7 +50,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( thrust::execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -66,7 +66,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( thrust::execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.inl index 5686e332a345..cbfcb5f5a7d2 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/reduce_by_key.inl @@ -74,7 +74,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( thrust::execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -93,7 +93,7 @@ THRUST_HOST_DEVICE thrust::pair reduce_by_key( if (keys_first == keys_last) { - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } // input size @@ -134,7 +134,7 @@ THRUST_HOST_DEVICE thrust::pair reduce_by_key( thrust::scatter_if( exec, scanned_values.begin(), scanned_values.end(), scanned_tail_flags.begin(), tail_flags.begin(), values_output); - return thrust::make_pair(keys_output + N, values_output + N); + return _THRUST_STD::make_pair(keys_output + N, values_output + N); } // end reduce_by_key() template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( thrust::execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -163,7 +163,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( thrust::execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scalar/binary_search.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scalar/binary_search.h index 1458edba8ec5..11791624fe73 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scalar/binary_search.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scalar/binary_search.h @@ -25,7 +25,7 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN @@ -48,7 +48,7 @@ THRUST_HOST_DEVICE RandomAccessIterator upper_bound(RandomAccessIterator first, RandomAccessIterator last, const T& val, BinaryPredicate comp); template -THRUST_HOST_DEVICE pair +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range(RandomAccessIterator first, RandomAccessIterator last, const T& val, BinaryPredicate comp); template diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scalar/binary_search.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scalar/binary_search.inl index 48844ec80c9a..a9c9be17c2c4 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scalar/binary_search.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/scalar/binary_search.inl @@ -27,7 +27,8 @@ #endif // no system header #include #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN @@ -100,11 +101,11 @@ upper_bound(RandomAccessIterator first, RandomAccessIterator last, const T& val, } template -THRUST_HOST_DEVICE pair +THRUST_HOST_DEVICE _THRUST_STD::pair equal_range(RandomAccessIterator first, RandomAccessIterator last, const T& val, BinaryPredicate comp) { RandomAccessIterator lb = thrust::system::detail::generic::scalar::lower_bound(first, last, val, comp); - return thrust::make_pair(lb, thrust::system::detail::generic::scalar::upper_bound(lb, last, val, comp)); + return _THRUST_STD::make_pair(lb, thrust::system::detail::generic::scalar::upper_bound(lb, last, val, comp)); } template diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/set_operations.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/set_operations.h index ea73bdca58d7..6db4215263c5 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/set_operations.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/set_operations.h @@ -25,9 +25,10 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::detail::generic { @@ -62,7 +63,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_difference_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -81,7 +82,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_difference_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -123,7 +124,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_intersection_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_intersection_by_key( thrust::execution_policy& system, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -140,7 +141,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_intersection_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_intersection_by_key( thrust::execution_policy& system, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -182,7 +183,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_symmetric_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_symmetric_difference_by_key( thrust::execution_policy& system, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -201,7 +202,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_symmetric_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_symmetric_difference_by_key( thrust::execution_policy& system, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -244,7 +245,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_union_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_union_by_key( thrust::execution_policy& system, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -263,7 +264,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_union_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_union_by_key( thrust::execution_policy& system, InputIterator1 keys_first1, InputIterator1 keys_last1, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/set_operations.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/set_operations.inl index 0c483e5a8213..d7093cebbb4e 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/set_operations.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/set_operations.inl @@ -56,7 +56,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_difference_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -89,7 +89,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_difference_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -123,7 +123,7 @@ THRUST_HOST_DEVICE thrust::pair set_difference thrust::set_difference(exec, zipped_first1, zipped_last1, zipped_first2, zipped_last2, zipped_result, comp_first) .get_iterator_tuple(); - return thrust::make_pair(thrust::get<0>(result), thrust::get<1>(result)); + return _THRUST_STD::make_pair(thrust::get<0>(result), thrust::get<1>(result)); } // end set_difference_by_key() template @@ -145,7 +145,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_intersection_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_intersection_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -175,7 +175,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_intersection_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_intersection_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -215,7 +215,7 @@ THRUST_HOST_DEVICE thrust::pair set_intersecti thrust::set_intersection(exec, zipped_first1, zipped_last1, zipped_first2, zipped_last2, zipped_result, comp_first) .get_iterator_tuple(); - return thrust::make_pair(thrust::get<0>(result), thrust::get<1>(result)); + return _THRUST_STD::make_pair(thrust::get<0>(result), thrust::get<1>(result)); } // end set_intersection_by_key() template @@ -238,7 +238,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_symmetric_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_symmetric_difference_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -271,7 +271,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_symmetric_difference_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_symmetric_difference_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -306,7 +306,7 @@ THRUST_HOST_DEVICE thrust::pair set_symmetric_ exec, zipped_first1, zipped_last1, zipped_first2, zipped_last2, zipped_result, comp_first) .get_iterator_tuple(); - return thrust::make_pair(thrust::get<0>(result), thrust::get<1>(result)); + return _THRUST_STD::make_pair(thrust::get<0>(result), thrust::get<1>(result)); } // end set_symmetric_difference_by_key() template @@ -329,7 +329,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_union_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_union_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -362,7 +362,7 @@ template -THRUST_HOST_DEVICE thrust::pair set_union_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair set_union_by_key( thrust::execution_policy& exec, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -396,7 +396,7 @@ THRUST_HOST_DEVICE thrust::pair set_union_by_k thrust::set_union(exec, zipped_first1, zipped_last1, zipped_first2, zipped_last2, zipped_result, comp_first) .get_iterator_tuple(); - return thrust::make_pair(thrust::get<0>(result), thrust::get<1>(result)); + return _THRUST_STD::make_pair(thrust::get<0>(result), thrust::get<1>(result)); } // end set_union_by_key() template -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::detail::generic { template THRUST_HOST_DEVICE - thrust::pair, typename thrust::pointer::difference_type> - get_temporary_buffer(thrust::execution_policy& exec, - typename thrust::pointer::difference_type n); +_THRUST_STD::pair, typename thrust::pointer::difference_type> +get_temporary_buffer(thrust::execution_policy& exec, + typename thrust::pointer::difference_type n); THRUST_EXEC_CHECK_DISABLE template diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/temporary_buffer.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/temporary_buffer.inl index f7c899b07065..dcc4d8c4d53f 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/temporary_buffer.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/temporary_buffer.inl @@ -27,15 +27,16 @@ #endif // no system header #include #include -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::detail::generic { template THRUST_HOST_DEVICE -thrust::pair, typename thrust::pointer::difference_type> +_THRUST_STD::pair, typename thrust::pointer::difference_type> get_temporary_buffer(thrust::execution_policy& exec, typename thrust::pointer::difference_type n) { @@ -47,7 +48,7 @@ get_temporary_buffer(thrust::execution_policy& exec, n = 0; } // end if - return thrust::make_pair(ptr, n); + return _THRUST_STD::make_pair(ptr, n); } // end get_temporary_buffer() THRUST_EXEC_CHECK_DISABLE diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/unique_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/unique_by_key.h index 717cd19273c1..8aa07ae7308f 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/unique_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/unique_by_key.h @@ -25,21 +25,22 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::detail::generic { template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( thrust::execution_policy& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, ForwardIterator2 values_first); template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( thrust::execution_policy& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -51,7 +52,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( thrust::execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -65,7 +66,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( thrust::execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/unique_by_key.inl b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/unique_by_key.inl index b754c96b6377..2795026903fa 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/unique_by_key.inl +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/generic/unique_by_key.inl @@ -39,7 +39,7 @@ THRUST_NAMESPACE_BEGIN namespace system::detail::generic { template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( thrust::execution_policy& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -50,7 +50,7 @@ THRUST_HOST_DEVICE thrust::pair unique_by_ke } // end unique_by_key() template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( thrust::execution_policy& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -73,7 +73,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( thrust::execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -92,7 +92,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( thrust::execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -118,7 +118,7 @@ THRUST_HOST_DEVICE thrust::pair unique_by_key_ difference_type output_size = result - thrust::make_zip_iterator(keys_output, values_output); - return thrust::make_pair(keys_output + output_size, values_output + output_size); + return _THRUST_STD::make_pair(keys_output + output_size, values_output + output_size); } // end unique_by_key_copy() } // namespace system::detail::generic THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/extrema.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/extrema.h index e2a98e0fc528..732887263338 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/extrema.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/extrema.h @@ -30,9 +30,10 @@ # pragma system_header #endif // no system header #include -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::detail::sequential { @@ -80,7 +81,7 @@ THRUST_HOST_DEVICE ForwardIterator max_element( THRUST_EXEC_CHECK_DISABLE template -THRUST_HOST_DEVICE thrust::pair minmax_element( +THRUST_HOST_DEVICE _THRUST_STD::pair minmax_element( sequential::execution_policy&, ForwardIterator first, ForwardIterator last, BinaryPredicate comp) { // wrap comp @@ -102,7 +103,7 @@ THRUST_HOST_DEVICE thrust::pair minmax_element } } - return thrust::make_pair(imin, imax); + return _THRUST_STD::make_pair(imin, imax); } } // namespace system::detail::sequential THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/merge.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/merge.h index 40a7276e954d..f47704293954 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/merge.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/merge.h @@ -83,7 +83,7 @@ template -THRUST_HOST_DEVICE thrust::pair merge_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair merge_by_key( sequential::execution_policy&, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -141,7 +141,7 @@ THRUST_HOST_DEVICE thrust::pair merge_by_key( ++values_result; } - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } } // namespace system::detail::sequential THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/partition.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/partition.h index 634d8d14d146..624c7cafabb2 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/partition.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/partition.h @@ -31,9 +31,10 @@ #endif // no system header #include #include -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + #if !_THRUST_HAS_DEVICE_SYSTEM_STD # include #endif @@ -234,7 +235,7 @@ template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( sequential::execution_policy&, InputIterator first, InputIterator last, @@ -259,7 +260,7 @@ THRUST_HOST_DEVICE thrust::pair stable_partiti } // end else } - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } THRUST_EXEC_CHECK_DISABLE @@ -269,7 +270,7 @@ template -THRUST_HOST_DEVICE thrust::pair stable_partition_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair stable_partition_copy( sequential::execution_policy&, InputIterator1 first, InputIterator1 last, @@ -295,7 +296,7 @@ THRUST_HOST_DEVICE thrust::pair stable_partiti } // end else } - return thrust::make_pair(out_true, out_false); + return _THRUST_STD::make_pair(out_true, out_false); } } // namespace system::detail::sequential THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/reduce_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/reduce_by_key.h index cd86dafaae31..12d8377e4b48 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/reduce_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/reduce_by_key.h @@ -26,9 +26,10 @@ # pragma system_header #endif // no system header #include -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::detail::sequential { @@ -40,7 +41,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( sequential::execution_policy&, InputIterator1 keys_first, InputIterator1 keys_last, @@ -90,7 +91,7 @@ THRUST_HOST_DEVICE thrust::pair reduce_by_key( ++values_output; } - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } } // namespace system::detail::sequential THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/unique.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/unique.h index 7bdcd2ebf1c3..d1c9802e2283 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/unique.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/unique.h @@ -30,7 +30,6 @@ # pragma system_header #endif // no system header #include -#include #include THRUST_NAMESPACE_BEGIN diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/unique_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/unique_by_key.h index f68d3cb112de..07bc1b2fb0bb 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/unique_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/detail/sequential/unique_by_key.h @@ -30,9 +30,10 @@ # pragma system_header #endif // no system header #include -#include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::detail::sequential { @@ -43,7 +44,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( sequential::execution_policy&, InputIterator1 keys_first, InputIterator1 keys_last, @@ -85,11 +86,11 @@ THRUST_HOST_DEVICE thrust::pair unique_by_key_ ++values_output; } - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } // end unique_by_key_copy() template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( sequential::execution_policy& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/extrema.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/extrema.h index 42cab0f0622f..cc2b481fb826 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/extrema.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/extrema.h @@ -308,10 +308,10 @@ ItemsIt THRUST_HOST_DEVICE max_element(execution_policy& policy, ItemsI THRUST_EXEC_CHECK_DISABLE template -pair THRUST_HOST_DEVICE +_THRUST_STD::pair THRUST_HOST_DEVICE minmax_element(execution_policy& policy, ItemsIt first, ItemsIt last, BinaryPred binary_pred) { - auto ret = thrust::make_pair(last, last); + auto ret = _THRUST_STD::make_pair(last, last); using InputType = thrust::detail::it_value_t; using IndexType = thrust::detail::it_difference_t; @@ -339,7 +339,7 @@ minmax_element(execution_policy& policy, ItemsIt first, ItemsIt last, B zip_iterator begin = make_zip_iterator(iter_tuple); two_pairs_type result = __extrema::extrema( policy, transform_t(begin, duplicate_t()), num_items, arg_minmax_t(binary_pred), (two_pairs_type*) (nullptr)); - ret = thrust::make_pair(first + get<1>(get<0>(result)), first + get<1>(get<1>(result))); + ret = _THRUST_STD::make_pair(first + get<1>(get<0>(result)), first + get<1>(get<1>(result))); # else // defined(__HIP_DEVICE_COMPILE__) ret = thrust::minmax_element(cvt_to_seq(derived_cast(policy)), first, last, binary_pred); # endif // !defined(__HIP_DEVICE_COMPILE__) @@ -347,7 +347,8 @@ minmax_element(execution_policy& policy, ItemsIt first, ItemsIt last, B } template -pair THRUST_HOST_DEVICE minmax_element(execution_policy& policy, ItemsIt first, ItemsIt last) +_THRUST_STD::pair THRUST_HOST_DEVICE +minmax_element(execution_policy& policy, ItemsIt first, ItemsIt last) { using value_type = thrust::detail::it_value_t; return hip_rocprim::minmax_element(policy, first, last, less()); diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/merge.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/merge.h index 0e071ea7f333..0c586d7eeb7d 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/merge.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/merge.h @@ -135,7 +135,7 @@ template -THRUST_HIP_RUNTIME_FUNCTION pair merge( +THRUST_HIP_RUNTIME_FUNCTION _THRUST_STD::pair merge( execution_policy& policy, KeysIt1 keys1_begin, KeysIt1 keys1_end, @@ -159,7 +159,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair merge( if (input1_size == 0 && input2_size == 0) { - return thrust::make_pair(keys_out_begin, items_out_begin); + return _THRUST_STD::make_pair(keys_out_begin, items_out_begin); }; size_t storage_size = 0; @@ -201,7 +201,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair merge( hip_rocprim::throw_on_error(hip_rocprim::synchronize_optional(policy), "merge: failed to synchronize"); size_t count = input1_size + input2_size; - return thrust::make_pair(keys_out_begin + count, items_out_begin + count); + return _THRUST_STD::make_pair(keys_out_begin + count, items_out_begin + count); } } // namespace __merge @@ -265,7 +265,7 @@ template > -pair THRUST_HOST_DEVICE merge_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE merge_by_key( execution_policy& policy, KeysIt1 keys1_begin, KeysIt1 keys1_end, @@ -280,7 +280,7 @@ pair THRUST_HOST_DEVICE merge_by_key( // struct workaround is required for HIP-clang struct workaround { - THRUST_HOST static pair par( + THRUST_HOST static _THRUST_STD::pair par( execution_policy& policy, KeysIt1 keys1_begin, KeysIt1 keys1_end, @@ -305,7 +305,7 @@ pair THRUST_HOST_DEVICE merge_by_key( compare_op); } # if defined(__HIP_DEVICE_COMPILE__) - THRUST_DEVICE static pair seq( + THRUST_DEVICE static _THRUST_STD::pair seq( execution_policy& policy, KeysIt1 keys1_begin, KeysIt1 keys1_end, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h index 5311541c1902..a499108d9ec0 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h @@ -50,11 +50,11 @@ THRUST_NAMESPACE_BEGIN namespace hip_rocprim { template -pair THRUST_HOST_DEVICE +_THRUST_STD::pair THRUST_HOST_DEVICE mismatch(execution_policy& policy, InputIt1 first1, InputIt1 last1, InputIt2 first2, BinaryPred binary_pred); template -pair THRUST_HOST_DEVICE +_THRUST_STD::pair THRUST_HOST_DEVICE mismatch(execution_policy& policy, InputIt1 first1, InputIt1 last1, InputIt2 first2); } // namespace hip_rocprim THRUST_NAMESPACE_END @@ -65,7 +65,7 @@ THRUST_NAMESPACE_BEGIN namespace hip_rocprim { template -pair THRUST_HOST_DEVICE +_THRUST_STD::pair THRUST_HOST_DEVICE mismatch(execution_policy& policy, InputIt1 first1, InputIt1 last1, InputIt2 first2, BinaryPred binary_pred) { const auto n = _THRUST_STD::distance(first1, last1); @@ -73,11 +73,11 @@ mismatch(execution_policy& policy, InputIt1 first1, InputIt1 last1, Inp const auto last = thrust::make_zip_iterator(last1, first2 + n); const auto mismatch_pos = hip_rocprim::find_if_not(policy, first, last, thrust::make_zip_function(binary_pred)); const auto dist = _THRUST_STD::distance(first, mismatch_pos); - return thrust::make_pair(first1 + dist, first2 + dist); + return _THRUST_STD::make_pair(first1 + dist, first2 + dist); } template -pair THRUST_HOST_DEVICE +_THRUST_STD::pair THRUST_HOST_DEVICE mismatch(execution_policy& policy, InputIt1 first1, InputIt1 last1, InputIt2 first2) { using InputType1 = thrust::detail::it_value_t; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/partition.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/partition.h index ad45507f6b04..682de04aa63f 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/partition.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/partition.h @@ -65,7 +65,7 @@ namespace detail { template -THRUST_HIP_RUNTIME_FUNCTION pair partition( +THRUST_HIP_RUNTIME_FUNCTION _THRUST_STD::pair partition( execution_policy& policy, InputIt first, InputIt last, @@ -86,7 +86,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair partition( if (num_items <= 0) { - return thrust::make_pair(selected_result, rejected_result); + return _THRUST_STD::make_pair(selected_result, rejected_result); } // Determine temporary device storage requirements. @@ -123,11 +123,11 @@ THRUST_HIP_RUNTIME_FUNCTION pair partition( thrust::copy_n(policy, d_partition_out, num_items, selected_result); - return thrust::make_pair(selected_result + num_selected, rejected_result); + return _THRUST_STD::make_pair(selected_result + num_selected, rejected_result); } template -pair THRUST_HIP_RUNTIME_FUNCTION partition( +_THRUST_STD::pair THRUST_HIP_RUNTIME_FUNCTION partition( execution_policy& policy, InputIt first, InputIt last, @@ -150,7 +150,7 @@ pair THRUST_HIP_RUNTIME_FUNCTION partition( if (num_items <= 0) { - return thrust::make_pair(selected_result, rejected_result); + return _THRUST_STD::make_pair(selected_result, rejected_result); } // Determine temporary device storage requirements. @@ -187,11 +187,11 @@ pair THRUST_HIP_RUNTIME_FUNCTION partition( thrust::copy_n(policy, d_partition_out, num_items, selected_result); - return thrust::make_pair(selected_result + num_selected, rejected_result); + return _THRUST_STD::make_pair(selected_result + num_selected, rejected_result); } template -THRUST_HIP_RUNTIME_FUNCTION pair partition_copy( +THRUST_HIP_RUNTIME_FUNCTION _THRUST_STD::pair partition_copy( execution_policy& policy, InputIt first, InputIt last, @@ -210,7 +210,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair partition_copy( if (num_items <= 0) { - return thrust::make_pair(selected_result, rejected_result); + return _THRUST_STD::make_pair(selected_result, rejected_result); } hip_rocprim::throw_on_error( @@ -260,11 +260,11 @@ THRUST_HIP_RUNTIME_FUNCTION pair partition_copy( size_type num_selected = get_value(policy, d_num_selected_out); - return thrust::make_pair(selected_result + num_selected, rejected_result + num_items - num_selected); + return _THRUST_STD::make_pair(selected_result + num_selected, rejected_result + num_items - num_selected); } template -THRUST_HIP_RUNTIME_FUNCTION pair partition_copy( +THRUST_HIP_RUNTIME_FUNCTION _THRUST_STD::pair partition_copy( execution_policy& policy, InputIt first, InputIt last, @@ -285,7 +285,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair partition_copy( if (num_items <= 0) { - return thrust::make_pair(selected_result, rejected_result); + return _THRUST_STD::make_pair(selected_result, rejected_result); } hip_rocprim::throw_on_error( @@ -335,7 +335,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair partition_copy( size_type num_selected = get_value(policy, d_num_selected_out); - return thrust::make_pair(selected_result + num_selected, rejected_result + num_items - num_selected); + return _THRUST_STD::make_pair(selected_result + num_selected, rejected_result + num_items - num_selected); } template @@ -356,7 +356,7 @@ inplace_partition(execution_policy& policy, InputIt first, InputIt last hip_rocprim::uninitialized_copy(policy, first, last, tmp.begin()); // Partition input from temporary storage to the user-provided range [`first`, `last`) - pair result = + _THRUST_STD::pair result = partition(policy, tmp.data().get(), tmp.data().get() + num_items, first, first, predicate); std::size_t num_selected = result.first - first; @@ -382,7 +382,7 @@ THRUST_HIP_RUNTIME_FUNCTION InputIt inplace_partition( hip_rocprim::uninitialized_copy(policy, first, last, tmp.begin()); // Partition input from temporary storage to the user-provided range [`first`, `last`) - pair result = + _THRUST_STD::pair result = partition(policy, tmp.data().get(), tmp.data().get() + num_items, stencil, first, first, predicate); std::size_t num_selected = result.first - first; @@ -398,7 +398,7 @@ THRUST_HIP_RUNTIME_FUNCTION InputIt inplace_partition( THRUST_EXEC_CHECK_DISABLE template -pair THRUST_HOST_DEVICE partition_copy( +_THRUST_STD::pair THRUST_HOST_DEVICE partition_copy( execution_policy& policy, InputIt first, InputIt last, @@ -410,7 +410,7 @@ pair THRUST_HOST_DEVICE partition_copy( // struct workaround is required for HIP-clang struct workaround { - THRUST_HOST static pair + THRUST_HOST static _THRUST_STD::pair par(execution_policy& policy, InputIt first, InputIt last, @@ -423,7 +423,7 @@ pair THRUST_HOST_DEVICE partition_copy( } # if defined(__HIP_DEVICE_COMPILE__) - THRUST_DEVICE static pair + THRUST_DEVICE static _THRUST_STD::pair seq(execution_policy& policy, InputIt first, InputIt last, @@ -446,7 +446,7 @@ pair THRUST_HOST_DEVICE partition_copy( THRUST_EXEC_CHECK_DISABLE template -pair THRUST_HOST_DEVICE partition_copy( +_THRUST_STD::pair THRUST_HOST_DEVICE partition_copy( execution_policy& policy, InputIt first, InputIt last, @@ -457,7 +457,7 @@ pair THRUST_HOST_DEVICE partition_copy( // struct workaround is required for HIP-clang struct workaround { - THRUST_HOST static pair + THRUST_HOST static _THRUST_STD::pair par(execution_policy& policy, InputIt first, InputIt last, @@ -469,7 +469,7 @@ pair THRUST_HOST_DEVICE partition_copy( } # if defined(__HIP_DEVICE_COMPILE__) - THRUST_DEVICE static pair + THRUST_DEVICE static _THRUST_STD::pair seq(execution_policy& policy, InputIt first, InputIt last, @@ -491,7 +491,7 @@ pair THRUST_HOST_DEVICE partition_copy( THRUST_EXEC_CHECK_DISABLE template -pair THRUST_HOST_DEVICE stable_partition_copy( +_THRUST_STD::pair THRUST_HOST_DEVICE stable_partition_copy( execution_policy& policy, InputIt first, InputIt last, @@ -503,7 +503,7 @@ pair THRUST_HOST_DEVICE stable_partition_copy( // struct workaround is required for HIP-clang struct workaround { - THRUST_HOST static pair + THRUST_HOST static _THRUST_STD::pair par(execution_policy& policy, InputIt first, InputIt last, @@ -515,7 +515,7 @@ pair THRUST_HOST_DEVICE stable_partition_copy( return detail::partition_copy(policy, first, last, stencil, selected_result, rejected_result, predicate); } # if defined(__HIP_DEVICE_COMPILE__) - THRUST_DEVICE static pair + THRUST_DEVICE static _THRUST_STD::pair seq(execution_policy& policy, InputIt first, InputIt last, @@ -538,7 +538,7 @@ pair THRUST_HOST_DEVICE stable_partition_copy( THRUST_EXEC_CHECK_DISABLE template -pair THRUST_HOST_DEVICE stable_partition_copy( +_THRUST_STD::pair THRUST_HOST_DEVICE stable_partition_copy( execution_policy& policy, InputIt first, InputIt last, @@ -549,7 +549,7 @@ pair THRUST_HOST_DEVICE stable_partition_copy( // struct workaround is required for HIP-clang struct workaround { - THRUST_HOST static pair + THRUST_HOST static _THRUST_STD::pair par(execution_policy& policy, InputIt first, InputIt last, @@ -561,7 +561,7 @@ pair THRUST_HOST_DEVICE stable_partition_copy( } # if defined(__HIP_DEVICE_COMPILE__) - THRUST_DEVICE static pair + THRUST_DEVICE static _THRUST_STD::pair seq(execution_policy& policy, InputIt first, InputIt last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/reduce_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/reduce_by_key.h index 56ea7a91e0fe..e00ca6454b63 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/reduce_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/reduce_by_key.h @@ -72,7 +72,7 @@ template -THRUST_HOST_DEVICE thrust::pair reduce_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair reduce_by_key( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -170,7 +170,7 @@ template -THRUST_HIP_RUNTIME_FUNCTION pair reduce_by_key( +THRUST_HIP_RUNTIME_FUNCTION _THRUST_STD::pair reduce_by_key( execution_policy& policy, KeysInputIt keys_first, KeysInputIt keys_last, @@ -191,7 +191,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair reduce_by_key( if (num_items == 0) { - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } hip_rocprim::throw_on_error( @@ -248,7 +248,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair reduce_by_key( const auto num_runs_out = hip_rocprim::get_value(policy, d_num_runs_out); - return thrust::make_pair(keys_output + num_runs_out, values_output + num_runs_out); + return _THRUST_STD::make_pair(keys_output + num_runs_out, values_output + num_runs_out); } } // namespace __reduce_by_key @@ -265,7 +265,7 @@ template -pair THRUST_HOST_DEVICE reduce_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE reduce_by_key( execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -278,7 +278,7 @@ pair THRUST_HOST_DEVICE reduce_by_key( // struct workaround is required for HIP-clang struct workaround { - THRUST_HOST static pair + THRUST_HOST static _THRUST_STD::pair par(execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -293,7 +293,7 @@ pair THRUST_HOST_DEVICE reduce_by_key( } # if defined(__HIP_DEVICE_COMPILE__) - THRUST_DEVICE static pair + THRUST_DEVICE static _THRUST_STD::pair seq(execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -325,7 +325,7 @@ pair THRUST_HOST_DEVICE reduce_by_key( } template -pair THRUST_HOST_DEVICE reduce_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE reduce_by_key( execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -342,7 +342,7 @@ pair THRUST_HOST_DEVICE reduce_by_key( } template -pair THRUST_HOST_DEVICE reduce_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE reduce_by_key( execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/set_operations.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/set_operations.h index baaea64ee2d0..5f34f9d1c161 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/set_operations.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/set_operations.h @@ -156,7 +156,7 @@ THRUST_HIP_DEVICE_FUNCTION Size merge_path(It1 a, Size aCount, It2 b, Size bCoun } template -THRUST_HIP_DEVICE_FUNCTION pair +THRUST_HIP_DEVICE_FUNCTION _THRUST_STD::pair balanced_path(It1 keys1, It2 keys2, Size num_keys1, Size num_keys2, Size diag, Size2 levels, CompareOp compare_op) { using T = thrust::detail::it_value_t; @@ -198,7 +198,7 @@ balanced_path(It1 keys1, It2 keys2, Size num_keys1, Size num_keys2, Size diag, S index1 = start1 + advance1; } - return thrust::make_pair(index1, (diag - index1) + star); + return _THRUST_STD::make_pair(index1, (diag - index1) + star); } // func balanced_path template @@ -347,7 +347,7 @@ struct SetOpAgent ValuesOutputIt values_out, CompareOp compare_op, SetOp set_op, - pair* partitions, + _THRUST_STD::pair* partitions, Size* output_count) { using block_scan_type = ::rocprim::block_scan; @@ -377,8 +377,8 @@ struct SetOpAgent }; } storage; - pair partition_beg = partitions[tile_idx + 0]; - pair partition_end = partitions[tile_idx + 1]; + _THRUST_STD::pair partition_beg = partitions[tile_idx + 0]; + _THRUST_STD::pair partition_end = partitions[tile_idx + 1]; Size keys1_beg = partition_beg.first; Size keys1_end = partition_end.first; @@ -401,7 +401,7 @@ struct SetOpAgent int diag_loc = min(ITEMS_PER_THREAD * threadIdx.x, num_keys1 + num_keys2); - pair partition_loc = balanced_path( + _THRUST_STD::pair partition_loc = balanced_path( &storage.keys_shared.get_unsafe_array()[0], &storage.keys_shared.get_unsafe_array()[num_keys1], num_keys1, @@ -422,8 +422,8 @@ struct SetOpAgent ::rocprim::syncthreads(); - pair partition1_loc = - thrust::make_pair(storage.offset[threadIdx.x] >> 16, storage.offset[threadIdx.x] & 0xFFFF); + _THRUST_STD::pair partition1_loc = + _THRUST_STD::make_pair(storage.offset[threadIdx.x] >> 16, storage.offset[threadIdx.x] & 0xFFFF); int keys1_end_loc = partition1_loc.first; int keys2_end_loc = partition1_loc.second; @@ -801,7 +801,7 @@ ROCPRIM_KERNEL THRUST_HIP_LAUNCH_BOUNDS_DEFAULT void lookback_set_op_kernel( ValuesOutputIt values_output, CompareOp compare_op, SetOp set_op, - pair* partitions, + _THRUST_STD::pair* partitions, Size* output_count, LookBackScanState lookback_scan_state, rocprim::detail::ordered_block_id ordered_bid) @@ -924,7 +924,7 @@ hipError_t THRUST_HIP_RUNTIME_FUNCTION doit_step( } scan_state_bytes = ::rocprim::detail::align_size(scan_state_bytes); size_t ordered_block_id_bytes = ::rocprim::detail::align_size(ordered_block_id_type::get_storage_size()); - size_t partition_storage_bytes = (number_of_blocks + 1) * sizeof(pair); + size_t partition_storage_bytes = (number_of_blocks + 1) * sizeof(_THRUST_STD::pair); if (d_temp_storage == nullptr) { // temp_storage_size is never zero @@ -955,7 +955,7 @@ hipError_t THRUST_HIP_RUNTIME_FUNCTION doit_step( // Create and initialize ordered_block_id obj auto ordered_bid = ordered_block_id_type::create(reinterpret_cast(ptr)); ptr += ordered_block_id_bytes; - pair* partitions = reinterpret_cast*>(ptr); + _THRUST_STD::pair* partitions = reinterpret_cast<_THRUST_STD::pair*>(ptr); if (debug_synchronous) { @@ -1024,7 +1024,7 @@ template -THRUST_HIP_RUNTIME_FUNCTION pair set_operations( +THRUST_HIP_RUNTIME_FUNCTION _THRUST_STD::pair set_operations( execution_policy& policy, KeysIt1 keys1_first, KeysIt1 keys1_last, @@ -1045,7 +1045,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair set_operations( if (num_keys1 + num_keys2 == 0) { - return thrust::make_pair(keys_output, values_output); + return _THRUST_STD::make_pair(keys_output, values_output); } size_t temp_storage_bytes = 0; @@ -1112,7 +1112,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair set_operations( std::size_t output_count = hip_rocprim::get_value(policy, d_output_count); - return thrust::make_pair(keys_output + output_count, values_output + output_count); + return _THRUST_STD::make_pair(keys_output + output_count, values_output + output_count); } } // namespace __set_operations @@ -1384,7 +1384,7 @@ template -pair THRUST_HOST_DEVICE set_difference_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE set_difference_by_key( execution_policy& policy, KeysIt1 keys1_first, KeysIt1 keys1_last, @@ -1408,7 +1408,7 @@ pair THRUST_HOST_DEVICE set_difference_by_key( ItemsOutputIt, CompareOp, __set_operations::serial_set_difference>) ); - auto ret = thrust::make_pair(keys_result, items_result); + auto ret = _THRUST_STD::make_pair(keys_result, items_result); # if !defined(__HIP_DEVICE_COMPILE__) ret = __set_operations::set_operations( policy, @@ -1439,7 +1439,7 @@ pair THRUST_HOST_DEVICE set_difference_by_key( } template -pair THRUST_HOST_DEVICE set_difference_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE set_difference_by_key( execution_policy& policy, KeysIt1 keys1_first, KeysIt1 keys1_last, @@ -1475,7 +1475,7 @@ template -pair THRUST_HOST_DEVICE set_intersection_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE set_intersection_by_key( execution_policy& policy, KeysIt1 keys1_first, KeysIt1 keys1_last, @@ -1498,7 +1498,7 @@ pair THRUST_HOST_DEVICE set_intersection_by_key( ItemsOutputIt, CompareOp, __set_operations::serial_set_intersection>) ); - auto ret = thrust::make_pair(keys_result, items_result); + auto ret = _THRUST_STD::make_pair(keys_result, items_result); # if !defined(__HIP_DEVICE_COMPILE__) ret = __set_operations::set_operations( policy, @@ -1528,7 +1528,7 @@ pair THRUST_HOST_DEVICE set_intersection_by_key( } template -pair THRUST_HOST_DEVICE set_intersection_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE set_intersection_by_key( execution_policy& policy, KeysIt1 keys1_first, KeysIt1 keys1_last, @@ -1562,7 +1562,7 @@ template -pair THRUST_HOST_DEVICE set_symmetric_difference_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE set_symmetric_difference_by_key( execution_policy& policy, KeysIt1 keys1_first, KeysIt1 keys1_last, @@ -1586,7 +1586,7 @@ pair THRUST_HOST_DEVICE set_symmetric_difference_by ItemsOutputIt, CompareOp, __set_operations::serial_set_symmetric_difference>) ); - auto ret = thrust::make_pair(keys_result, items_result); + auto ret = _THRUST_STD::make_pair(keys_result, items_result); # if !defined(__HIP_DEVICE_COMPILE__) ret = __set_operations::set_operations( policy, @@ -1617,7 +1617,7 @@ pair THRUST_HOST_DEVICE set_symmetric_difference_by } template -pair THRUST_HOST_DEVICE set_symmetric_difference_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE set_symmetric_difference_by_key( execution_policy& policy, KeysIt1 keys1_first, KeysIt1 keys1_last, @@ -1653,7 +1653,7 @@ template -pair THRUST_HOST_DEVICE set_union_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE set_union_by_key( execution_policy& policy, KeysIt1 keys1_first, KeysIt1 keys1_last, @@ -1677,7 +1677,7 @@ pair THRUST_HOST_DEVICE set_union_by_key( ItemsOutputIt, CompareOp, __set_operations::serial_set_union>) ); - auto ret = thrust::make_pair(keys_result, items_result); + auto ret = _THRUST_STD::make_pair(keys_result, items_result); # if !defined(__HIP_DEVICE_COMPILE__) ret = __set_operations::set_operations( policy, @@ -1708,7 +1708,7 @@ pair THRUST_HOST_DEVICE set_union_by_key( } template -pair THRUST_HOST_DEVICE set_union_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE set_union_by_key( execution_policy& policy, KeysIt1 keys1_first, KeysIt1 keys1_last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/temporary_buffer.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/temporary_buffer.h index f4ecde7f5d17..fd575dd8da32 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/temporary_buffer.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/temporary_buffer.h @@ -43,7 +43,7 @@ namespace hip_rocprim // overloads should be selected. template -THRUST_HOST pair get_temporary_buffer(par_nosync_t&, _THRUST_STD::ptrdiff_t n) +THRUST_HOST _THRUST_STD::pair get_temporary_buffer(par_nosync_t&, _THRUST_STD::ptrdiff_t n) { void* ptr; hipError_t status = hipMallocAsync(&ptr, sizeof(T) * n, nullptr); @@ -62,7 +62,7 @@ THRUST_HOST pair get_temporary_buffer(par_nosync_t&, } } - return make_pair(reinterpret_pointer_cast(ptr), n); + return _THRUST_STD::make_pair(reinterpret_pointer_cast(ptr), n); } template @@ -88,7 +88,7 @@ THRUST_HOST void return_temporary_buffer(par_nosync_t&, Pointer ptr, _THRUST_STD } template -THRUST_HOST pair +THRUST_HOST _THRUST_STD::pair get_temporary_buffer(execute_on_stream_nosync& system, _THRUST_STD::ptrdiff_t n) { void* ptr; @@ -108,7 +108,7 @@ get_temporary_buffer(execute_on_stream_nosync& system, _THRUST_STD::ptrdiff_t n) } } - return make_pair(reinterpret_pointer_cast(ptr), n); + return _THRUST_STD::make_pair(reinterpret_pointer_cast(ptr), n); } template diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/unique_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/unique_by_key.h index 20291e598a5c..4655ae67e279 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/unique_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/unique_by_key.h @@ -59,7 +59,7 @@ THRUST_NAMESPACE_BEGIN template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( const thrust::detail::execution_policy_base& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -69,7 +69,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -89,7 +89,7 @@ template -THRUST_HIP_RUNTIME_FUNCTION pair unique_by_key( +THRUST_HIP_RUNTIME_FUNCTION _THRUST_STD::pair unique_by_key( execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -108,7 +108,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair unique_by_key( if (num_items == 0) { - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } // Determine temporary device storage requirements. @@ -163,7 +163,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair unique_by_key( size_type num_selected = get_value(policy, d_num_selected_out); - return thrust::make_pair(keys_result + num_selected, values_result + num_selected); + return _THRUST_STD::make_pair(keys_result + num_selected, values_result + num_selected); } } // namespace detail @@ -173,7 +173,7 @@ THRUST_HIP_RUNTIME_FUNCTION pair unique_by_key( //------------------------- THRUST_EXEC_CHECK_DISABLE template -pair THRUST_HOST_DEVICE unique_by_key_copy( +_THRUST_STD::pair THRUST_HOST_DEVICE unique_by_key_copy( execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -185,7 +185,7 @@ pair THRUST_HOST_DEVICE unique_by_key_copy( // struct workaround is required for HIP-clang struct workaround { - THRUST_HOST static pair + THRUST_HOST static _THRUST_STD::pair par(execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -197,7 +197,7 @@ pair THRUST_HOST_DEVICE unique_by_key_copy( return detail::unique_by_key(policy, keys_first, keys_last, values_first, keys_result, values_result, binary_pred); } # if defined(__HIP_DEVICE_COMPILE__) - THRUST_DEVICE static pair + THRUST_DEVICE static _THRUST_STD::pair seq(execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -219,7 +219,7 @@ pair THRUST_HOST_DEVICE unique_by_key_copy( } template -pair THRUST_HOST_DEVICE unique_by_key_copy( +_THRUST_STD::pair THRUST_HOST_DEVICE unique_by_key_copy( execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -233,7 +233,7 @@ pair THRUST_HOST_DEVICE unique_by_key_copy( } template -pair THRUST_HOST_DEVICE unique_by_key( +_THRUST_STD::pair THRUST_HOST_DEVICE unique_by_key( execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -243,7 +243,7 @@ pair THRUST_HOST_DEVICE unique_by_key( // struct workaround is required for HIP-clang struct workaround { - THRUST_HOST static pair + THRUST_HOST static _THRUST_STD::pair par(execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -254,7 +254,7 @@ pair THRUST_HOST_DEVICE unique_by_key( policy, keys_first, keys_last, values_first, keys_first, values_first, binary_pred); } # if defined(__HIP_DEVICE_COMPILE__) - THRUST_DEVICE static pair + THRUST_DEVICE static _THRUST_STD::pair seq(execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, @@ -273,7 +273,7 @@ pair THRUST_HOST_DEVICE unique_by_key( } template -pair THRUST_HOST_DEVICE +_THRUST_STD::pair THRUST_HOST_DEVICE unique_by_key(execution_policy& policy, KeyInputIt keys_first, KeyInputIt keys_last, ValInputIt values_first) { using key_type = thrust::detail::it_value_t; diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/extrema.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/extrema.h index 9b36c0480637..8db27ff12b21 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/extrema.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/extrema.h @@ -36,7 +36,7 @@ min_element(execution_policy& exec, ForwardIterator first, Forwar } // end min_element() template -thrust::pair +_THRUST_STD::pair minmax_element(execution_policy& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate comp) { // omp prefers generic::minmax_element to cpp::minmax_element diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/partition.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/partition.h index d5c5b057923e..2599959728ae 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/partition.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/partition.h @@ -17,10 +17,11 @@ # pragma system_header #endif // no system header -#include #include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::omp::detail { @@ -49,7 +50,7 @@ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( execution_policy& exec, InputIterator first, InputIterator last, @@ -67,7 +68,7 @@ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( execution_policy& exec, InputIterator1 first, InputIterator1 last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/reduce_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/reduce_by_key.h index 9ef303f46c12..755b3da0ce2d 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/reduce_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/reduce_by_key.h @@ -31,7 +31,7 @@ template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/unique.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/unique.h index 32a42b9efc0b..b96dd4a7baae 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/unique.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/unique.h @@ -13,10 +13,11 @@ # pragma system_header #endif // no system header -#include #include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::omp::detail { diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/unique_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/unique_by_key.h index cb41c37974cc..4d527b42db75 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/unique_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/omp/detail/unique_by_key.h @@ -13,15 +13,16 @@ # pragma system_header #endif // no system header -#include #include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::omp::detail { template -thrust::pair unique_by_key( +_THRUST_STD::pair unique_by_key( execution_policy& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -38,7 +39,7 @@ template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/extrema.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/extrema.h index 75ab11bb1e63..3317dd5ea386 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/extrema.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/extrema.h @@ -35,7 +35,7 @@ min_element(execution_policy& exec, ForwardIterator first, Forwar } // end min_element() template -thrust::pair +_THRUST_STD::pair minmax_element(execution_policy& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate comp) { // tbb prefers generic::minmax_element to cpp::minmax_element diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/merge.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/merge.h index 2bf14b3aa0bf..0ea6bbd23d49 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/merge.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/merge.h @@ -263,7 +263,7 @@ template -thrust::pair merge_by_key( +_THRUST_STD::pair merge_by_key( execution_policy&, InputIterator1 keys_first1, InputIterator1 keys_last1, @@ -296,7 +296,7 @@ thrust::pair merge_by_key( _THRUST_STD::advance(values_result, _THRUST_STD::distance(keys_first1, keys_last1) + _THRUST_STD::distance(keys_first2, keys_last2)); - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } } // end namespace system::tbb::detail THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/partition.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/partition.h index d73782fa864f..449607f855bf 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/partition.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/partition.h @@ -12,10 +12,11 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::tbb::detail { @@ -44,7 +45,7 @@ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( execution_policy& exec, InputIterator first, InputIterator last, @@ -62,7 +63,7 @@ template -thrust::pair stable_partition_copy( +_THRUST_STD::pair stable_partition_copy( execution_policy& exec, InputIterator1 first, InputIterator1 last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/reduce_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/reduce_by_key.h index 1f462c9bfe9b..4817bb0a978a 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/reduce_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/reduce_by_key.h @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -50,9 +49,9 @@ struct partial_sum_type }; template -thrust::pair, - typename partial_sum_type::type>> +_THRUST_STD::pair, + typename partial_sum_type::type>> reduce_last_segment_backward( InputIterator1 keys_first, InputIterator1 keys_last, @@ -77,7 +76,7 @@ reduce_last_segment_backward( result_value = binary_op(result_value, *values_first_r); } - return thrust::make_pair(keys_first_r.base(), thrust::make_pair(result_key, result_value)); + return _THRUST_STD::make_pair(keys_first_r.base(), _THRUST_STD::make_pair(result_key, result_value)); } template , - typename partial_sum_type::type> + _THRUST_STD::pair, + typename partial_sum_type::type> carry; thrust::tie(keys_last, carry) = @@ -196,7 +195,7 @@ struct serial_reduce_by_key_body using value_type = typename partial_sum_type::type; // XXX is there a way to pose this so that we don't require default construction of carry? - thrust::pair carry; + _THRUST_STD::pair carry; thrust::tie(my_keys_result, my_values_result, carry.first, carry.second) = reduce_by_key_with_carry( my_keys_first, my_keys_last, my_values_first, my_keys_result, my_values_result, binary_pred, binary_op); @@ -274,7 +273,7 @@ template -thrust::pair reduce_by_key( +_THRUST_STD::pair reduce_by_key( thrust::tbb::execution_policy& exec, Iterator1 keys_first, Iterator1 keys_last, @@ -288,7 +287,7 @@ thrust::pair reduce_by_key( difference_type n = keys_last - keys_first; if (n == 0) { - return thrust::make_pair(keys_result, values_result); + return _THRUST_STD::make_pair(keys_result, values_result); } // XXX this value is a tuning opportunity @@ -373,7 +372,7 @@ thrust::pair reduce_by_key( } } - return thrust::make_pair(keys_result + size_of_result, values_result + size_of_result); + return _THRUST_STD::make_pair(keys_result + size_of_result, values_result + size_of_result); } } // namespace system::tbb::detail THRUST_NAMESPACE_END diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/unique.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/unique.h index 8a4557a472a2..43475f50f8c4 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/unique.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/unique.h @@ -12,7 +12,6 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include #include diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/unique_by_key.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/unique_by_key.h index e3f668a1e1c8..d346abd09049 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/unique_by_key.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/tbb/detail/unique_by_key.h @@ -12,15 +12,16 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include #include #include +#include _THRUST_STD_INCLUDE(__utility/pair.h) + THRUST_NAMESPACE_BEGIN namespace system::tbb::detail { template -thrust::pair unique_by_key( +_THRUST_STD::pair unique_by_key( execution_policy& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -37,7 +38,7 @@ template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( execution_policy& exec, InputIterator1 keys_first, InputIterator1 keys_last, diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/unique.h b/projects/hipccl/hipccl3/rocthrust/thrust/unique.h index edd3c427e1dd..3d6b60a546c6 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/unique.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/unique.h @@ -31,7 +31,8 @@ #endif // no system header #include #include -#include + +#include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN @@ -466,7 +467,7 @@ OutputIterator unique_copy(InputIterator first, InputIterator last, OutputIterat * int A[N] = {1, 3, 3, 3, 2, 2, 1}; // keys * int B[N] = {9, 8, 7, 6, 5, 4, 3}; // values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * new_end = thrust::unique_by_key(thrust::host, A, A + N, B); * * // The first four keys in A are now {1, 3, 2, 1} and new_end.first - A is 4. @@ -478,7 +479,7 @@ OutputIterator unique_copy(InputIterator first, InputIterator last, OutputIterat * \see reduce_by_key */ template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( const thrust::detail::execution_policy_base& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -523,7 +524,7 @@ THRUST_HOST_DEVICE thrust::pair unique_by_ke * int A[N] = {1, 3, 3, 3, 2, 2, 1}; // keys * int B[N] = {9, 8, 7, 6, 5, 4, 3}; // values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * new_end = thrust::unique_by_key(A, A + N, B); * * // The first four keys in A are now {1, 3, 2, 1} and new_end.first - A is 4. @@ -535,7 +536,7 @@ THRUST_HOST_DEVICE thrust::pair unique_by_ke * \see reduce_by_key */ template -thrust::pair +_THRUST_STD::pair unique_by_key(ForwardIterator1 keys_first, ForwardIterator1 keys_last, ForwardIterator2 values_first); /*! \p unique_by_key is a generalization of \p unique to key-value pairs. @@ -580,7 +581,7 @@ unique_by_key(ForwardIterator1 keys_first, ForwardIterator1 keys_last, ForwardIt * int A[N] = {1, 3, 3, 3, 2, 2, 1}; // keys * int B[N] = {9, 8, 7, 6, 5, 4, 3}; // values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * _THRUST_STD::equal_to binary_pred; * new_end = thrust::unique_by_key(thrust::host, A, A + N, B, binary_pred); * @@ -593,7 +594,7 @@ unique_by_key(ForwardIterator1 keys_first, ForwardIterator1 keys_last, ForwardIt * \see reduce_by_key */ template -THRUST_HOST_DEVICE thrust::pair unique_by_key( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key( const thrust::detail::execution_policy_base& exec, ForwardIterator1 keys_first, ForwardIterator1 keys_last, @@ -636,7 +637,7 @@ THRUST_HOST_DEVICE thrust::pair unique_by_ke * int A[N] = {1, 3, 3, 3, 2, 2, 1}; // keys * int B[N] = {9, 8, 7, 6, 5, 4, 3}; // values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * _THRUST_STD::equal_to binary_pred; * new_end = thrust::unique_by_key(A, A + N, B, binary_pred); * @@ -649,7 +650,7 @@ THRUST_HOST_DEVICE thrust::pair unique_by_ke * \see reduce_by_key */ template -thrust::pair unique_by_key( +_THRUST_STD::pair unique_by_key( ForwardIterator1 keys_first, ForwardIterator1 keys_last, ForwardIterator2 values_first, BinaryPredicate binary_pred); /*! \p unique_by_key_copy is a generalization of \p unique_copy to key-value pairs. @@ -698,7 +699,7 @@ thrust::pair unique_by_key( * int C[N]; // output keys * int D[N]; // output values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * new_end = thrust::unique_by_key_copy(thrust::host, A, A + N, B, C, D); * * // The first four keys in C are now {1, 3, 2, 1} and new_end.first - C is 4. @@ -714,7 +715,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -762,7 +763,7 @@ THRUST_HOST_DEVICE thrust::pair unique_by_key_ * int C[N]; // output keys * int D[N]; // output values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * new_end = thrust::unique_by_key_copy(A, A + N, B, C, D); * * // The first four keys in C are now {1, 3, 2, 1} and new_end.first - C is 4. @@ -774,7 +775,7 @@ THRUST_HOST_DEVICE thrust::pair unique_by_key_ * \see reduce_by_key */ template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, @@ -829,7 +830,7 @@ thrust::pair unique_by_key_copy( * int C[N]; // output keys * int D[N]; // output values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * _THRUST_STD::equal_to binary_pred; * new_end = thrust::unique_by_key_copy(thrust::host, A, A + N, B, C, D, binary_pred); * @@ -847,7 +848,7 @@ template -THRUST_HOST_DEVICE thrust::pair unique_by_key_copy( +THRUST_HOST_DEVICE _THRUST_STD::pair unique_by_key_copy( const thrust::detail::execution_policy_base& exec, InputIterator1 keys_first, InputIterator1 keys_last, @@ -898,7 +899,7 @@ THRUST_HOST_DEVICE thrust::pair unique_by_key_ * int C[N]; // output keys * int D[N]; // output values * - * thrust::pair new_end; + * _THRUST_STD::pair new_end; * _THRUST_STD::equal_to binary_pred; * new_end = thrust::unique_by_key_copy(A, A + N, B, C, D, binary_pred); * @@ -915,7 +916,7 @@ template -thrust::pair unique_by_key_copy( +_THRUST_STD::pair unique_by_key_copy( InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, From e54ee268578644e9f0ea450e81fd161623b7eab0 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:45:14 -0400 Subject: [PATCH 25/48] refactor(rocthrust): CCCL 2f529edf653 parity - transform_iterator includes Related upstream commit: 2f529edf653 Ensure that we properly warn about device lambdas that need to query the return type (#6765) (NVIDIA/cccl#6782) Related local port commit: 99ecdb91b5f The port kept the local include block (type_traits umbrella plus !_THRUST_HAS_DEVICE_SYSTEM_STD fallbacks) instead of upstream's granular includes. libhipcxx is now mandatory, so transform_iterator.h now: - includes the upstream __functional/{identity,invoke}.h, __memory/construct_at.h and __type_traits/{is_copy_assignable, is_copy_constructible,remove_cvref,remove_reference}.h headers, dropping the dead fallback includes and the libcxx_wrapper construct_at.h; - spells ::internal::remove_cvref / __destroy_at / __construct_at as _THRUST_STD:: like upstream's ::cuda::std::. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../thrust/iterator/transform_iterator.h | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/transform_iterator.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/transform_iterator.h index c9ef48b7d19f..4a22fdcd9e09 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/transform_iterator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/transform_iterator.h @@ -42,21 +42,18 @@ #endif // no system header #include -#include #include #include #include #include -#include _THRUST_STD_INCLUDE(type_traits) -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(functional) -#endif - -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -#endif +#include _THRUST_STD_INCLUDE(__functional/identity.h) +#include _THRUST_STD_INCLUDE(__functional/invoke.h) +#include _THRUST_STD_INCLUDE(__memory/construct_at.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_copy_assignable.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_copy_constructible.h) +#include _THRUST_STD_INCLUDE(__type_traits/remove_cvref.h) +#include _THRUST_STD_INCLUDE(__type_traits/remove_reference.h) THRUST_NAMESPACE_BEGIN @@ -92,7 +89,7 @@ struct make_transform_iterator_base { private: using reference = replace_if_use_default>; - using value_type = replace_if_use_default>; + using value_type = replace_if_use_default>; public: using type = @@ -279,8 +276,8 @@ class transform_iterator } else if constexpr (_THRUST_STD::is_copy_constructible_v) { - ::internal::__destroy_at(&m_f); - ::internal::__construct_at(&m_f, other.m_f); + _THRUST_STD::__destroy_at(&m_f); + _THRUST_STD::__construct_at(&m_f, other.m_f); } else { From 5536bbb284d9e3895a291be6a309b3dd1c33f335 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:45:49 -0400 Subject: [PATCH 26/48] refactor(rocthrust): CCCL b85d41e36d4 parity - bit_width in random_bijection Related upstream commit: b85d41e36d4 Fixes for thrust::shuffle (#7172) (NVIDIA/cccl#7189) Related local port commit: bd2d9c02b2d The port replaced _THRUST_STD::max/_THRUST_STD::bit_width in feistel_bijection with a hand-written bit-count loop because bit_width is C++20 and unavailable without libhipcxx. libhipcxx is now mandatory, so random_bijection.h follows upstream: max_index/total_bits use _THRUST_STD::max and _THRUST_STD::bit_width, the raw includes and ::cuda::std:: spellings become _THRUST_STD_INCLUDE / _THRUST_STD::, and the upstream granular includes are taken (__type_traits/{is_convertible,is_integral}.h, __utility/forward.h, bit, cstdint). __algorithm/max.h is included explicitly (upstream gets it transitively). Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../thrust/detail/random_bijection.h | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/random_bijection.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/random_bijection.h index 45566c85dc4e..28aee2b88998 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/random_bijection.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/random_bijection.h @@ -23,8 +23,12 @@ #include -#include -#include +#include _THRUST_STD_INCLUDE(__algorithm/max.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_convertible.h) +#include _THRUST_STD_INCLUDE(__type_traits/is_integral.h) +#include _THRUST_STD_INCLUDE(__utility/forward.h) +#include _THRUST_STD_INCLUDE(bit) +#include _THRUST_STD_INCLUDE(cstdint) THRUST_NAMESPACE_BEGIN namespace detail @@ -40,14 +44,8 @@ class feistel_bijection { // Calculate number of bits needed to represent num_elements - 1 // Prevent zero - const uint64_t max_index = (m > 1 ? m : 1) - 1; - // Portable bit_width(max_index): std::bit_width is C++20 and unavailable without libhipcxx - uint64_t index_bits = 0; - for (uint64_t v = max_index; v != 0; v >>= 1) - { - ++index_bits; - } - const uint64_t total_bits = index_bits > 8 ? index_bits : 8; + const uint64_t max_index = _THRUST_STD::max(static_cast(1), m) - 1; + const uint64_t total_bits = static_cast(_THRUST_STD::max(8, _THRUST_STD::bit_width(max_index))); // Half bits rounded down L_bits = total_bits / 2; L_mask = (1ull << L_bits) - 1; @@ -110,8 +108,8 @@ template class random_bijection { private: - static_assert(::cuda::std::is_integral_v, "IndexType must be an integral type"); - static_assert(::cuda::std::is_convertible_v, + static_assert(_THRUST_STD::is_integral_v, "IndexType must be an integral type"); + static_assert(_THRUST_STD::is_convertible_v, "IndexType must be convertible to Bijection::index_type"); Bijection bijection; @@ -122,7 +120,7 @@ class random_bijection template THRUST_HOST_DEVICE random_bijection(IndexType n, URBG&& g) - : bijection(n, ::cuda::std::forward(g)) + : bijection(n, _THRUST_STD::forward(g)) , n(n) {} From d6d1c528cf901a94bccb12116cecc788b0f6bff7 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:47:02 -0400 Subject: [PATCH 27/48] refactor(rocthrust): CCCL 8ca3dc31e90/1c3c7ddee12 parity - cuda iterators in hip find/mismatch Related upstream commit: 8ca3dc31e90 Refactor thrust::mismatch to use CUDA iterators (NVIDIA/cccl#6018) Related upstream commit: 1c3c7ddee12 Refactor iterator usage in thrust/cuda find() (NVIDIA/cccl#6019) Related local port commit: e46dc36b2f1 e46dc36b2f1 brought the upstream find/mismatch rewrite to system/hip using thrust:: iterators, plus a local transform_input_iterator_t because thrust::transform_iterator materializes the value_type before calling the predicate (NVIDIA/cccl#3591). libhipcxx is now mandatory, so hip now uses the same libcu++ iterators as upstream's system/cuda: - find.h: find_if_n zips _THRUST_LIBCXX::make_transform_iterator( try_unwrap_contiguous_iterator(first), predicate) with _THRUST_LIBCXX::counting_iterator(0) and uses a _THRUST_STD::tuple result type; __find_if:: transform_input_iterator_t and the dead !_THRUST_HAS_DEVICE_SYSTEM_STD include block are removed; upstream granular includes are taken ( kept explicitly for the placeholders in find). - mismatch.h: _THRUST_LIBCXX::make_zip_iterator and _THRUST_LIBCXX::zip_function(binary_pred), with upstream's granular includes instead of thrust/{distance,pair,zip_function}.h and thrust/iterator/zip_iterator.h. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../rocthrust/thrust/system/hip/detail/find.h | 126 ++---------------- .../thrust/system/hip/detail/mismatch.h | 16 ++- 2 files changed, 22 insertions(+), 120 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/find.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/find.h index 2364f6802ebb..b8fd3cd79f0a 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/find.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/find.h @@ -40,16 +40,17 @@ #if THRUST_HAS_HIP_COMPILER() # include -# include -# include -# include +# include # include # include -# if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -# endif +# include _THRUST_LIBCXX_INCLUDE(__iterator/counting_iterator.h) +# include _THRUST_LIBCXX_INCLUDE(__iterator/transform_iterator.h) +# include _THRUST_LIBCXX_INCLUDE(__iterator/zip_iterator.h) +# include _THRUST_STD_INCLUDE(__algorithm/min.h) +# include _THRUST_STD_INCLUDE(__functional/not_fn.h) +# include _THRUST_STD_INCLUDE(__iterator/distance.h) +# include _THRUST_STD_INCLUDE(tuple) THRUST_NAMESPACE_BEGIN namespace hip_rocprim @@ -69,7 +70,6 @@ InputIt THRUST_HOST_DEVICE find(execution_policy& policy, InputIt first }; // namespace hip_rocprim THRUST_NAMESPACE_END -# include # include THRUST_NAMESPACE_BEGIN @@ -99,110 +99,13 @@ struct functor } } }; - -template -struct transform_input_iterator_t -{ - using self_t = transform_input_iterator_t; - using difference_type = thrust::detail::it_difference_t; - using value_type = ValueType; - using pointer = void; - using reference = value_type; - using iterator_category = _THRUST_STD::random_access_iterator_tag; - - InputIt input; - mutable UnaryOp op; - - THRUST_HOST_DEVICE THRUST_FORCEINLINE transform_input_iterator_t(InputIt input, UnaryOp op) - : input(input) - , op(op) - {} - - transform_input_iterator_t(const self_t&) = default; - - // UnaryOp might not be copy assignable, such as when it is a lambda. Define - // an explicit copy assignment operator that doesn't try to assign it. - THRUST_HOST_DEVICE self_t& operator=(const self_t& o) - { - input = o.input; - return *this; - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t operator++(int) - { - self_t retval = *this; - ++input; - return retval; - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t& operator++() - { - ++input; - return *this; - } - - // Pass the dereferenced value straight to op (like ::cuda::transform_iterator) instead of materializing the - // value_type first, so value types need not be constructible on the device. See: - // https://github.com/NVIDIA/cccl/issues/3591 - THRUST_HOST_DEVICE THRUST_FORCEINLINE reference operator*() const - { - return op(*input); - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE reference operator*() - { - return op(*input); - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t operator+(difference_type n) const - { - return self_t(input + n, op); - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t& operator+=(difference_type n) - { - input += n; - return *this; - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t operator-(difference_type n) const - { - return self_t(input - n, op); - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE self_t& operator-=(difference_type n) - { - input -= n; - return *this; - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE difference_type operator-(self_t other) const - { - return input - other.input; - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE reference operator[](difference_type n) const - { - return op(input[n]); - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE bool operator==(const self_t& rhs) const - { - return (input == rhs.input); - } - - THRUST_HOST_DEVICE THRUST_FORCEINLINE bool operator!=(const self_t& rhs) const - { - return (input != rhs.input); - } -}; } // namespace __find_if template InputIt THRUST_HOST_DEVICE find_if_n(execution_policy& policy, InputIt first, Size num_items, Predicate predicate) { - using result_type = typename thrust::tuple; + using result_type = _THRUST_STD::tuple; // empty sequence if (num_items == 0) @@ -220,12 +123,9 @@ find_if_n(execution_policy& policy, InputIt first, Size num_items, Pred const Size interval_threshold = 1 << 20; const Size interval_size = (_THRUST_STD::min)(interval_threshold, num_items); - // Upstream uses ::cuda::make_transform_iterator here. thrust::transform_iterator converts to the value_type before - // calling the functor (https://github.com/NVIDIA/cccl/issues/3591), so keep a dedicated iterator that does not. - auto unwrapped_first = thrust::try_unwrap_contiguous_iterator(first); - using XfrmIterator = __find_if::transform_input_iterator_t; - - const auto begin = thrust::make_zip_iterator(XfrmIterator(unwrapped_first, predicate), counting_iterator(0)); + const auto begin = _THRUST_LIBCXX::make_zip_iterator( + _THRUST_LIBCXX::make_transform_iterator(thrust::try_unwrap_contiguous_iterator(first), predicate), + _THRUST_LIBCXX::counting_iterator(0)); const auto end = begin + num_items; for (auto interval_begin = begin; interval_begin < end; interval_begin += interval_size) @@ -236,7 +136,7 @@ find_if_n(execution_policy& policy, InputIt first, Size num_items, Pred interval_end = end; } // end if - result_type result = reduce( + const result_type result = reduce( policy, interval_begin, interval_end, result_type(false, interval_end - begin), __find_if::functor()); // see if we found something diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h index a499108d9ec0..c46371cbfeed 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/system/hip/detail/mismatch.h @@ -40,11 +40,13 @@ #if THRUST_HAS_HIP_COMPILER() # include -# include -# include -# include # include -# include + +# include _THRUST_LIBCXX_INCLUDE(__iterator/zip_function.h) +# include _THRUST_LIBCXX_INCLUDE(__iterator/zip_iterator.h) +# include _THRUST_STD_INCLUDE(__functional/operations.h) +# include _THRUST_STD_INCLUDE(__iterator/distance.h) +# include _THRUST_STD_INCLUDE(__utility/pair.h) THRUST_NAMESPACE_BEGIN namespace hip_rocprim @@ -69,9 +71,9 @@ _THRUST_STD::pair THRUST_HOST_DEVICE mismatch(execution_policy& policy, InputIt1 first1, InputIt1 last1, InputIt2 first2, BinaryPred binary_pred) { const auto n = _THRUST_STD::distance(first1, last1); - const auto first = thrust::make_zip_iterator(first1, first2); - const auto last = thrust::make_zip_iterator(last1, first2 + n); - const auto mismatch_pos = hip_rocprim::find_if_not(policy, first, last, thrust::make_zip_function(binary_pred)); + const auto first = _THRUST_LIBCXX::make_zip_iterator(first1, first2); + const auto last = _THRUST_LIBCXX::make_zip_iterator(last1, first2 + n); + const auto mismatch_pos = hip_rocprim::find_if_not(policy, first, last, _THRUST_LIBCXX::zip_function(binary_pred)); const auto dist = _THRUST_STD::distance(first, mismatch_pos); return _THRUST_STD::make_pair(first1 + dist, first2 + dist); } From 73bfcd793dd1ddba7833cb3d48ead180c5079af1 Mon Sep 17 00:00:00 2001 From: Mahovsky Date: Wed, 28 Oct 2026 15:49:06 -0400 Subject: [PATCH 28/48] refactor(rocthrust): CCCL 8b68d958473 parity - drop dead libhipcxx fallbacks in zip_iterator and iterator tests Related upstream commit: 7b52284299d Rename our namespace macros (NVIDIA/cccl#5538) Related upstream commit: 8b68d958473 Drop internal uses of `thrust::reverse_iterator` (NVIDIA/cccl#5616) Related local port commit: 148b6e82c1f libhipcxx is now mandatory, so every !_THRUST_HAS_DEVICE_SYSTEM_STD branch in the files these upstream commits touched is dead code. Upstream has no such fallbacks; remove them to match: - thrust/iterator/zip_iterator.h: remove the fallback zip_iterator machinery (advance_iterator, tuple_impl_specific, tuple_of_value_types, tuple_of_iterator_references helpers, ...) and the associated TODO; includes are now unconditional _THRUST_STD_INCLUDE(...). - thrust/iterator/detail/tuple_of_iterator_references.h: drop fallback branches. - thrust/detail/vector_base.h: drop fallback include. - testing/{copy,scan}.cu, testing/unittest/testframework.h: unconditionally specialize _THRUST_STD traits and drop fallback includes. - testing/{reverse,transform,transform_input_output,transform_output, tabulate_output,zip}_iterator.cu: iterator concept static_asserts are now unconditional, as upstream. The namespace macro rename from 7b52284299d needs no further change; the local _THRUST_STD_NAMESPACE_BEGIN/_THRUST_LIBCXX_NAMESPACE_BEGIN spellings are already the equivalents. Not compiled, tests not run (per human) Co-Authored-By: Claude --- .../hipccl/hipccl3/rocthrust/testing/copy.cu | 6 - .../rocthrust/testing/reverse_iterator.cu | 6 - .../hipccl/hipccl3/rocthrust/testing/scan.cu | 10 +- .../testing/tabulate_output_iterator.cu | 6 - .../transform_input_output_iterator.cu | 7 - .../rocthrust/testing/transform_iterator.cu | 8 - .../testing/transform_output_iterator.cu | 7 - .../testing/unittest/testframework.h | 6 +- .../hipccl3/rocthrust/testing/zip_iterator.cu | 10 - .../rocthrust/thrust/detail/vector_base.h | 3 - .../detail/tuple_of_iterator_references.h | 32 +- .../rocthrust/thrust/iterator/zip_iterator.h | 331 +----------------- 12 files changed, 8 insertions(+), 424 deletions(-) diff --git a/projects/hipccl/hipccl3/rocthrust/testing/copy.cu b/projects/hipccl/hipccl3/rocthrust/testing/copy.cu index ea7dbd2cd8d7..b504905fd509 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/copy.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/copy.cu @@ -34,10 +34,6 @@ #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - #if _CCCL_COMPILER(GCC, >=, 11) # define THRUST_DISABLE_BROKEN_GCC_VECTORIZER __attribute__((optimize("no-tree-vectorize"))) #else @@ -755,7 +751,6 @@ struct iterator_traits }; } // namespace std -# if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_STD_NAMESPACE_BEGIN template <> struct iterator_traits @@ -766,7 +761,6 @@ struct iterator_traits using difference_type = _THRUST_STD::ptrdiff_t; }; _THRUST_STD_NAMESPACE_END -# endif void TestCopyWithBigIndexesHelper(int magnitude) { diff --git a/projects/hipccl/hipccl3/rocthrust/testing/reverse_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/reverse_iterator.cu index 6e4715898a5f..9b5ad3c9f4d4 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/reverse_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/reverse_iterator.cu @@ -25,10 +25,6 @@ #include _THRUST_STD_INCLUDE(iterator) #include _THRUST_STD_INCLUDE(type_traits) -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - // ensure that we properly support thrust::reverse_iterator from _THRUST_STD void TestReverseIteratorTraits() { @@ -48,14 +44,12 @@ void TestReverseIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(_THRUST_STD::output_iterator); static_assert(_THRUST_STD::input_iterator); static_assert(_THRUST_STD::forward_iterator); static_assert(_THRUST_STD::bidirectional_iterator); static_assert(_THRUST_STD::random_access_iterator); static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestReverseIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/scan.cu b/projects/hipccl/hipccl3/rocthrust/testing/scan.cu index 6967f26b9775..4ae51b6fbcbd 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/scan.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/scan.cu @@ -29,15 +29,9 @@ #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_LIBCXX_INCLUDE(functional) -#endif +#include _THRUST_LIBCXX_INCLUDE(functional) #include _THRUST_STD_INCLUDE(array) -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - #include template @@ -613,7 +607,6 @@ struct iterator_traits }; } // namespace std -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_STD_NAMESPACE_BEGIN template <> struct iterator_traits @@ -624,7 +617,6 @@ struct iterator_traits using difference_type = _THRUST_STD::ptrdiff_t; }; _THRUST_STD_NAMESPACE_END -#endif void TestInclusiveScanWithBigIndexesHelper(int magnitude) { diff --git a/projects/hipccl/hipccl3/rocthrust/testing/tabulate_output_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/tabulate_output_iterator.cu index 4649d8134984..e7ca2f6c8104 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/tabulate_output_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/tabulate_output_iterator.cu @@ -34,10 +34,6 @@ #include _THRUST_STD_INCLUDE(type_traits) -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - template struct host_write_op { @@ -124,14 +120,12 @@ void TestTabulateOutputIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); // FIXME(bgruber): all up to and including random access should be true -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::output_iterator); static_assert(!_THRUST_STD::input_iterator); static_assert(!_THRUST_STD::forward_iterator); static_assert(!_THRUST_STD::bidirectional_iterator); static_assert(!_THRUST_STD::random_access_iterator); static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestTabulateOutputIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/transform_input_output_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/transform_input_output_iterator.cu index 3551fa8e6426..fac96ee32d97 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/transform_input_output_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/transform_input_output_iterator.cu @@ -25,11 +25,6 @@ #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -#endif - // There is an unfortunate miscompilation of the gcc-12/gcc-13 vectorizer leading to OOB writes // Adding this attribute suffices that this miscompilation does not appear anymore #if THRUST_COMPILER(GCC, >=, 12) @@ -59,14 +54,12 @@ void TestTransformInputOutputIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::output_iterator); static_assert(_THRUST_STD::input_iterator); static_assert(_THRUST_STD::forward_iterator); static_assert(_THRUST_STD::bidirectional_iterator); static_assert(_THRUST_STD::random_access_iterator); static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestTransformInputOutputIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/transform_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/transform_iterator.cu index 50baf05b18fe..0e5df73211ab 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/transform_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/transform_iterator.cu @@ -29,12 +29,6 @@ #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -# include -#endif - // ensure that we properly support thrust::transform_iterator from _THRUST_STD void TestTransformIteratorTraits() { @@ -54,14 +48,12 @@ void TestTransformIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::output_iterator); static_assert(_THRUST_STD::input_iterator); static_assert(_THRUST_STD::forward_iterator); static_assert(_THRUST_STD::bidirectional_iterator); static_assert(_THRUST_STD::random_access_iterator); static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestTransformIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/transform_output_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/transform_output_iterator.cu index 271316abac77..4843c4ca26cc 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/transform_output_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/transform_output_iterator.cu @@ -27,11 +27,6 @@ #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -#endif - // ensure that we properly support thrust::transform_output_iterator from _THRUST_STD void TestTransformOutputIteratorTraits() { @@ -52,7 +47,6 @@ void TestTransformOutputIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::output_iterator); // FIXME(bgruber): all up to and including random access should be true static_assert(!_THRUST_STD::input_iterator); @@ -60,7 +54,6 @@ void TestTransformOutputIteratorTraits() static_assert(!_THRUST_STD::bidirectional_iterator); static_assert(!_THRUST_STD::random_access_iterator); static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestTransformOutputIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/testing/unittest/testframework.h b/projects/hipccl/hipccl3/rocthrust/testing/unittest/testframework.h index 8a2042fe37e9..97d2970d87b8 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/unittest/testframework.h +++ b/projects/hipccl/hipccl3/rocthrust/testing/unittest/testframework.h @@ -28,14 +28,12 @@ #include #include +#include #include #include #include #include #include -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif #include "meta.h" #include "util.h" @@ -226,13 +224,11 @@ struct numeric_limits : numeric_limits {}; } // namespace std -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_STD_NAMESPACE_BEGIN template <> struct numeric_limits : numeric_limits {}; _THRUST_STD_NAMESPACE_END -#endif using NumericTypes = unittest::type_list< char, diff --git a/projects/hipccl/hipccl3/rocthrust/testing/zip_iterator.cu b/projects/hipccl/hipccl3/rocthrust/testing/zip_iterator.cu index 7b6527a703b8..072e9829b369 100644 --- a/projects/hipccl/hipccl3/rocthrust/testing/zip_iterator.cu +++ b/projects/hipccl/hipccl3/rocthrust/testing/zip_iterator.cu @@ -26,10 +26,6 @@ #include _THRUST_STD_INCLUDE(type_traits) -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif - using namespace unittest; // ensure that we properly support thrust::zip_iterator from _THRUST_STD @@ -52,18 +48,12 @@ void TestZipIteratorTraits() static_assert(_THRUST_STD::__has_random_access_traversal); -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::output_iterator); -#endif -#if _THRUST_HAS_DEVICE_SYSTEM_STD // The fallback version of zip_iterator lacks these iterator concepts. static_assert(_THRUST_STD::input_iterator); static_assert(_THRUST_STD::forward_iterator); static_assert(_THRUST_STD::bidirectional_iterator); static_assert(_THRUST_STD::random_access_iterator); -#endif -#if _THRUST_HAS_DEVICE_SYSTEM_STD || THRUST_STD_VER >= 2020 static_assert(!_THRUST_STD::contiguous_iterator); -#endif } DECLARE_UNITTEST(TestZipIteratorTraits); diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.h b/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.h index 8e353e87bd76..b0ed2c2bd86e 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/detail/vector_base.h @@ -44,9 +44,6 @@ #include _THRUST_STD_INCLUDE(utility) #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -#endif #include _THRUST_STD_INCLUDE(initializer_list) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h index e3db3101dcde..f771b29f4ef1 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/detail/tuple_of_iterator_references.h @@ -33,12 +33,8 @@ #include _THRUST_STD_INCLUDE(__utility/pair.h) -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(tuple) -# include _THRUST_STD_INCLUDE(type_traits) -#else -# include -#endif +#include _THRUST_STD_INCLUDE(tuple) +#include _THRUST_STD_INCLUDE(type_traits) THRUST_NAMESPACE_BEGIN @@ -56,7 +52,6 @@ struct maybe_unwrap_nested } }; -#if _THRUST_HAS_DEVICE_SYSTEM_STD template struct maybe_unwrap_nested, tuple_of_iterator_references> { @@ -65,7 +60,6 @@ struct maybe_unwrap_nested, tuple_of_iterator_references> return t.template __to_tuple(typename _THRUST_STD::__make_tuple_indices::type{}); } }; -#endif template class tuple_of_iterator_references : public tuple @@ -118,13 +112,11 @@ class tuple_of_iterator_references : public tuple return *this; } -#if _THRUST_HAS_DEVICE_SYSTEM_STD template = 0> THRUST_HOST_DEVICE constexpr operator tuple() const { return __to_tuple(typename _THRUST_STD::__make_tuple_indices::type{}); } -#endif // this overload of swap() permits swapping tuple_of_iterator_references returned as temporaries from // iterator dereferences @@ -134,29 +126,21 @@ class tuple_of_iterator_references : public tuple x.swap(y); } -#if _THRUST_HAS_DEVICE_SYSTEM_STD template THRUST_HOST_DEVICE constexpr tuple __to_tuple(_THRUST_STD::__tuple_indices) const { return {maybe_unwrap_nested{}(get(*this))...}; } -#endif }; } // namespace detail THRUST_NAMESPACE_END -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_STD_NAMESPACE_BEGIN -#else -THRUST_NAMESPACE_BEGIN -#endif -#if _THRUST_HAS_DEVICE_SYSTEM_STD template inline constexpr bool __is_tuple_of_iterator_references_v> = true; -#endif // define tuple_size, tuple_element, etc. template @@ -166,18 +150,10 @@ struct tuple_size struct tuple_element> -#if _THRUST_HAS_DEVICE_SYSTEM_STD : _THRUST_STD::tuple_element> -#else - : THRUST_NS_QUALIFIER::tuple_element> -#endif {}; -#if _THRUST_HAS_DEVICE_SYSTEM_STD _THRUST_STD_NAMESPACE_END -#else -THRUST_NAMESPACE_END -#endif // structured bindings support #if !THRUST_COMPILER(NVRTC) @@ -190,11 +166,7 @@ struct tuple_size struct tuple_element> -# if _THRUST_HAS_DEVICE_SYSTEM_STD : _THRUST_STD::tuple_element> -# else - : THRUST_NS_QUALIFIER::tuple_element> -# endif {}; } // namespace std #endif // !THRUST_COMPILER(NVRTC) diff --git a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/zip_iterator.h b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/zip_iterator.h index f5911d369c05..401f3bd236da 100644 --- a/projects/hipccl/hipccl3/rocthrust/thrust/iterator/zip_iterator.h +++ b/projects/hipccl/hipccl3/rocthrust/thrust/iterator/zip_iterator.h @@ -28,9 +28,6 @@ #pragma once -// TODO(libhipcxx): remove all the code in the path of !_THRUST_HAS_DEVICE_SYSTEM_STD -// once libhipcxx gets ready - #include #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) @@ -48,17 +45,10 @@ #include #include #include -#if !_THRUST_HAS_DEVICE_SYSTEM_STD -# include -# include -# include -#endif - -#if _THRUST_HAS_DEVICE_SYSTEM_STD -# include _THRUST_STD_INCLUDE(tuple) -# include _THRUST_STD_INCLUDE(type_traits) -# include _THRUST_STD_INCLUDE(utility) -#endif + +#include _THRUST_STD_INCLUDE(tuple) +#include _THRUST_STD_INCLUDE(type_traits) +#include _THRUST_STD_INCLUDE(utility) THRUST_NAMESPACE_BEGIN @@ -67,7 +57,6 @@ class zip_iterator; namespace detail { -#if _THRUST_HAS_DEVICE_SYSTEM_STD template struct make_zip_iterator_base { @@ -108,288 +97,6 @@ struct make_zip_iterator_base<_THRUST_STD::tuple> reference, difference_type>; }; -#else -// Functors to be used with tuple algorithms -// -template -class advance_iterator -{ -public: - inline THRUST_HOST_DEVICE advance_iterator(DiffType step) - : m_step(step) - {} - - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE void operator()(Iterator& it) const - { - _THRUST_STD::advance(it, m_step); - } - -private: - DiffType m_step; -}; // end advance_iterator - -struct increment_iterator -{ - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE void operator()(Iterator& it) - { - ++it; - } -}; // end increment_iterator - -struct decrement_iterator -{ - THRUST_EXEC_CHECK_DISABLE - template - inline THRUST_HOST_DEVICE void operator()(Iterator& it) - { - --it; - } -}; // end decrement_iterator - -struct dereference_iterator -{ - template - struct apply - { - using type = thrust::detail::it_reference_t; - }; // end apply - - // XXX silence warnings of the form "calling a __host__ function from a __host__ __device__ function is not allowed - THRUST_EXEC_CHECK_DISABLE - template - THRUST_HOST_DEVICE typename apply::type operator()(Iterator const& it) - { - return *it; - } -}; // end dereference_iterator - -// The namespace tuple_impl_specific provides two meta- -// algorithms and two algorithms for tuples. -namespace tuple_impl_specific -{ - -// define apply1 for tuple_meta_transform_impl -template -struct apply1 : UnaryMetaFunctionClass::template apply -{}; // end apply1 - -// define apply2 for tuple_meta_accumulate_impl -template -struct apply2 : UnaryMetaFunctionClass::template apply -{}; // end apply2 - -// Meta-accumulate algorithm for tuples. Note: The template -// parameter StartType corresponds to the initial value in -// ordinary accumulation. -// -template -struct tuple_meta_accumulate; - -template -struct tuple_meta_accumulate, BinaryMetaFun, StartType> -{ - using type = typename _THRUST_STD::type_identity::type; -}; - -template -struct tuple_meta_accumulate, BinaryMetaFun, StartType> -{ - using type = - typename apply2, BinaryMetaFun, StartType>::type>::type; -}; - -template -inline THRUST_HOST_DEVICE Fun tuple_for_each_helper(Fun f) -{ - return f; -} - -template -inline THRUST_HOST_DEVICE Fun tuple_for_each_helper(Fun f, T& t, Ts&... ts) -{ - f(t); - return tuple_for_each_helper(f, ts...); -} - -// for_each algorithm for tuples. - -template -inline THRUST_HOST_DEVICE Fun tuple_for_each(thrust::tuple& t, Fun f, thrust::index_sequence) -{ - return tuple_for_each_helper(f, thrust::get(t)...); -} // end tuple_for_each() - -// for_each algorithm for tuples. -template -inline THRUST_HOST_DEVICE Fun tuple_for_each(thrust::tuple& t, Fun f) -{ - return tuple_for_each(t, f, thrust::make_index_sequence>::value>{}); -} - -} // namespace tuple_impl_specific - -namespace internal -{ - -template -struct iterator_value -{ - using type = thrust::detail::it_value_t; -}; - -} // namespace internal - -// Metafunction to obtain the type of the tuple whose element types -// are the value_types of an iterator tuple. -// -template -struct tuple_of_value_types : tuple_meta_transform -{}; // end tuple_of_value_types - -struct minimum_category_lambda -{ - template - struct apply : minimum_category - {}; -}; - -// Metafunction to obtain the minimal traversal tag in a tuple -// of iterators. -// -template -struct minimum_traversal_category_in_iterator_tuple -{ - using tuple_of_traversal_tags = typename tuple_meta_transform::type; - - using type = typename tuple_impl_specific:: - tuple_meta_accumulate::type; -}; - -struct minimum_system_lambda -{ - template - struct apply : minimum_system - {}; -}; - -// Metafunction to obtain the minimal system tag in a tuple -// of iterators. -template -struct minimum_system_in_iterator_tuple -{ - using tuple_of_system_tags = - typename thrust::detail::tuple_meta_transform::type; - - using type = typename tuple_impl_specific:: - tuple_meta_accumulate::type; -}; - -namespace zip_iterator_base_ns -{ - -template -struct tuple_of_iterator_references_helper; - -template -struct tuple_of_iterator_references_helper> -{ - using type = thrust::detail::tuple_of_iterator_references::type...>; -}; - -template -struct iterator_reference -{ - using type = typename ::std::iterator_traits::reference; -}; - -template -struct tuple_of_iterator_references -{ - // get a thrust::tuple of the iterators' references - using tuple_of_references = typename tuple_meta_transform::type; - - // map thrust::tuple to tuple_of_iterator_references - using type = typename tuple_of_iterator_references_helper< - tuple_of_references, - thrust::make_index_sequence::value>>::type; -}; - -} // namespace zip_iterator_base_ns - -/////////////////////////////////////////////////////////////////// -// -// Class make_zip_iterator_base -// -// Builds and exposes the iterator facade type from which the zip -// iterator will be derived. -// -template -struct make_zip_iterator_base -{ - // private: - // reference type is the type of the tuple obtained from the - // iterators' reference types. - using reference = typename zip_iterator_base_ns::tuple_of_iterator_references::type; - - // Boost's Value type is the same as reference type. - // using value_type = reference; - using value_type = typename tuple_of_value_types::type; - - // Difference type is the first iterator's difference type - using difference_type = thrust::detail::it_difference_t::type>; - - // Iterator system is the minimum system tag in the - // iterator tuple - using system = typename minimum_system_in_iterator_tuple::type; - - // Traversal category is the minimum traversal category in the - // iterator tuple - using traversal_category = typename minimum_traversal_category_in_iterator_tuple::type; - -public: - // The iterator facade type from which the zip iterator will - // be derived. - using type = thrust:: - iterator_facade, value_type, system, traversal_category, reference, difference_type>; -}; // end make_zip_iterator_base - -namespace internal -{ - -template - class UnaryMetaFunction, - typename UnaryFunction, - typename IndexSequence = thrust::make_index_sequence::value>> -struct tuple_transform_functor; - -template class UnaryMetaFunction, typename UnaryFunction, size_t... Is> -struct tuple_transform_functor> -{ - static THRUST_HOST_DEVICE typename tuple_meta_transform::type - do_it_on_the_host_or_device(const Tuple& t, UnaryFunction f) - { - using XfrmTuple = typename tuple_meta_transform::type; - - return XfrmTuple(f(thrust::get(t))...); - } -}; - -template