From cd81d8c0148157c20fea7062a19d92eda8cbedfc Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Wed, 15 Jan 2025 12:19:03 +0100 Subject: [PATCH 1/2] Default transform_iterator's copy ctor Fixes: #2393 --- thrust/thrust/iterator/transform_iterator.h | 35 +-------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/thrust/thrust/iterator/transform_iterator.h b/thrust/thrust/iterator/transform_iterator.h index 0fd040685c6..736678bce12 100644 --- a/thrust/thrust/iterator/transform_iterator.h +++ b/thrust/thrust/iterator/transform_iterator.h @@ -198,7 +198,6 @@ class transform_iterator /*! \endcond */ -public: /*! Null constructor does nothing. */ transform_iterator() = default; @@ -239,20 +238,7 @@ class transform_iterator , m_f(other.functor()) {} - /*! Copy assignment operator copies from another \p transform_iterator. - * \p other The other \p transform_iterator to copy - * \return *this - * - * \note If the type of this \p transform_iterator's functor is not copy assignable - * (for example, if it is a lambda) it is not an error to call this function. - * In this case, however, the functor will not be modified. - * - * In any case, this \p transform_iterator's underlying iterator will be copy assigned. - */ - _CCCL_HOST_DEVICE transform_iterator& operator=(const transform_iterator& other) - { - return do_assign(other, ::cuda::std::is_copy_assignable()); - } + transform_iterator& operator=(const transform_iterator&) = default; /*! This method returns a copy of this \p transform_iterator's \c AdaptableUnaryFunction. * \return A copy of this \p transform_iterator's \c AdaptableUnaryFunction. @@ -266,25 +252,6 @@ class transform_iterator */ private: - _CCCL_HOST_DEVICE transform_iterator& do_assign(const transform_iterator& other, thrust::detail::true_type) - { - super_t::operator=(other); - - // do assign to m_f - m_f = other.functor(); - - return *this; - } - - _CCCL_HOST_DEVICE transform_iterator& do_assign(const transform_iterator& other, thrust::detail::false_type) - { - super_t::operator=(other); - - // don't assign to m_f - - return *this; - } - // MSVC 2013 and 2015 incorrectly warning about returning a reference to // a local/temporary here. // See goo.gl/LELTNp From 3d5c55b00b0110f9ebc29136ebc48fe1761eacf9 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Thu, 16 Jan 2025 15:11:20 +0100 Subject: [PATCH 2/2] Make function object copyable --- cub/test/catch2_large_array_sort_helper.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cub/test/catch2_large_array_sort_helper.cuh b/cub/test/catch2_large_array_sort_helper.cuh index e5c095c93dd..4f80a2cd595 100644 --- a/cub/test/catch2_large_array_sort_helper.cuh +++ b/cub/test/catch2_large_array_sort_helper.cuh @@ -67,7 +67,7 @@ template class key_sort_ref_key_transform { static constexpr double max_key = static_cast(::cuda::std::numeric_limits::max()); - const double m_conversion; + double m_conversion; std::size_t m_num_items; bool m_is_descending;