cuda-cccl 0.3.1__cp312-cp312-manylinux_2_24_aarch64.whl → 0.3.2__cp312-cp312-manylinux_2_24_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cuda-cccl might be problematic. Click here for more details.
- cuda/cccl/headers/include/cub/agent/agent_histogram.cuh +354 -572
- cuda/cccl/headers/include/cub/block/block_adjacent_difference.cuh +6 -8
- cuda/cccl/headers/include/cub/block/block_discontinuity.cuh +24 -14
- cuda/cccl/headers/include/cub/block/block_exchange.cuh +5 -0
- cuda/cccl/headers/include/cub/block/block_histogram.cuh +4 -0
- cuda/cccl/headers/include/cub/block/block_load.cuh +4 -0
- cuda/cccl/headers/include/cub/block/block_radix_rank.cuh +1 -0
- cuda/cccl/headers/include/cub/block/block_reduce.cuh +1 -0
- cuda/cccl/headers/include/cub/block/block_scan.cuh +12 -2
- cuda/cccl/headers/include/cub/block/block_store.cuh +3 -2
- cuda/cccl/headers/include/cub/detail/mdspan_utils.cuh +34 -30
- cuda/cccl/headers/include/cub/detail/ptx-json-parser.h +1 -1
- cuda/cccl/headers/include/cub/device/device_for.cuh +118 -40
- cuda/cccl/headers/include/cub/device/device_reduce.cuh +6 -7
- cuda/cccl/headers/include/cub/device/device_segmented_reduce.cuh +12 -13
- cuda/cccl/headers/include/cub/device/device_transform.cuh +122 -91
- cuda/cccl/headers/include/cub/device/dispatch/dispatch_merge.cuh +2 -3
- cuda/cccl/headers/include/cub/device/dispatch/dispatch_reduce.cuh +4 -3
- cuda/cccl/headers/include/cub/device/dispatch/dispatch_reduce_deterministic.cuh +1 -1
- cuda/cccl/headers/include/cub/device/dispatch/dispatch_streaming_reduce.cuh +4 -5
- cuda/cccl/headers/include/cub/device/dispatch/dispatch_streaming_reduce_by_key.cuh +0 -1
- cuda/cccl/headers/include/cub/device/dispatch/dispatch_topk.cuh +3 -5
- cuda/cccl/headers/include/cub/device/dispatch/dispatch_transform.cuh +13 -5
- cuda/cccl/headers/include/cub/device/dispatch/kernels/for_each.cuh +72 -37
- cuda/cccl/headers/include/cub/device/dispatch/kernels/transform.cuh +22 -27
- cuda/cccl/headers/include/cub/device/dispatch/tuning/tuning_transform.cuh +61 -70
- cuda/cccl/headers/include/cub/thread/thread_reduce.cuh +24 -17
- cuda/cccl/headers/include/cub/warp/warp_load.cuh +6 -6
- cuda/cccl/headers/include/cub/warp/warp_reduce.cuh +7 -2
- cuda/cccl/headers/include/cub/warp/warp_scan.cuh +7 -3
- cuda/cccl/headers/include/cub/warp/warp_store.cuh +1 -0
- cuda/cccl/headers/include/cuda/__barrier/barrier_block_scope.h +19 -0
- cuda/cccl/headers/include/cuda/__cccl_config +1 -0
- cuda/cccl/headers/include/cuda/__cmath/fast_modulo_division.h +3 -74
- cuda/cccl/headers/include/cuda/__cmath/mul_hi.h +146 -0
- cuda/cccl/headers/include/cuda/__complex/get_real_imag.h +0 -4
- cuda/cccl/headers/include/cuda/__device/arch_id.h +176 -0
- cuda/cccl/headers/include/cuda/__device/arch_traits.h +239 -317
- cuda/cccl/headers/include/cuda/__device/attributes.h +4 -3
- cuda/cccl/headers/include/cuda/__device/compute_capability.h +171 -0
- cuda/cccl/headers/include/cuda/__device/device_ref.h +0 -10
- cuda/cccl/headers/include/cuda/__device/physical_device.h +1 -26
- cuda/cccl/headers/include/cuda/__event/event.h +26 -26
- cuda/cccl/headers/include/cuda/__event/event_ref.h +5 -5
- cuda/cccl/headers/include/cuda/__event/timed_event.h +9 -7
- cuda/cccl/headers/include/cuda/__fwd/devices.h +4 -4
- cuda/cccl/headers/include/cuda/__iterator/constant_iterator.h +46 -31
- cuda/cccl/headers/include/cuda/__iterator/strided_iterator.h +79 -47
- cuda/cccl/headers/include/cuda/__iterator/tabulate_output_iterator.h +59 -36
- cuda/cccl/headers/include/cuda/__iterator/transform_input_output_iterator.h +79 -49
- cuda/cccl/headers/include/cuda/__iterator/transform_iterator.h +74 -48
- cuda/cccl/headers/include/cuda/__iterator/transform_output_iterator.h +80 -55
- cuda/cccl/headers/include/cuda/__iterator/zip_common.h +2 -12
- cuda/cccl/headers/include/cuda/__iterator/zip_iterator.h +15 -19
- cuda/cccl/headers/include/cuda/__iterator/zip_transform_iterator.h +59 -60
- cuda/cccl/headers/include/cuda/__mdspan/host_device_accessor.h +127 -60
- cuda/cccl/headers/include/cuda/__mdspan/host_device_mdspan.h +178 -3
- cuda/cccl/headers/include/cuda/__mdspan/restrict_accessor.h +38 -8
- cuda/cccl/headers/include/cuda/__mdspan/restrict_mdspan.h +67 -1
- cuda/cccl/headers/include/cuda/__memory/ptr_in_range.h +93 -0
- cuda/cccl/headers/include/cuda/__memory_resource/get_memory_resource.h +4 -4
- cuda/cccl/headers/include/cuda/__memory_resource/properties.h +44 -0
- cuda/cccl/headers/include/cuda/__memory_resource/resource.h +1 -1
- cuda/cccl/headers/include/cuda/__memory_resource/resource_ref.h +4 -6
- cuda/cccl/headers/include/cuda/__nvtx/nvtx3.h +2 -1
- cuda/cccl/headers/include/cuda/__runtime/ensure_current_context.h +5 -4
- cuda/cccl/headers/include/cuda/__stream/stream.h +8 -8
- cuda/cccl/headers/include/cuda/__stream/stream_ref.h +17 -16
- cuda/cccl/headers/include/cuda/__utility/in_range.h +65 -0
- cuda/cccl/headers/include/cuda/cmath +1 -0
- cuda/cccl/headers/include/cuda/devices +3 -0
- cuda/cccl/headers/include/cuda/memory +1 -0
- cuda/cccl/headers/include/cuda/std/__algorithm/equal_range.h +2 -2
- cuda/cccl/headers/include/cuda/std/__algorithm/find.h +1 -1
- cuda/cccl/headers/include/cuda/std/__algorithm/includes.h +2 -4
- cuda/cccl/headers/include/cuda/std/__algorithm/lower_bound.h +1 -1
- cuda/cccl/headers/include/cuda/std/__algorithm/make_projected.h +7 -15
- cuda/cccl/headers/include/cuda/std/__algorithm/min_element.h +1 -1
- cuda/cccl/headers/include/cuda/std/__algorithm/minmax_element.h +1 -2
- cuda/cccl/headers/include/cuda/std/__algorithm/partial_sort_copy.h +2 -2
- cuda/cccl/headers/include/cuda/std/__algorithm/upper_bound.h +1 -1
- cuda/cccl/headers/include/cuda/std/__cccl/algorithm_wrapper.h +36 -0
- cuda/cccl/headers/include/cuda/std/__cccl/builtin.h +46 -49
- cuda/cccl/headers/include/cuda/std/__cccl/execution_space.h +6 -0
- cuda/cccl/headers/include/cuda/std/__cccl/host_std_lib.h +52 -0
- cuda/cccl/headers/include/cuda/std/__cccl/memory_wrapper.h +36 -0
- cuda/cccl/headers/include/cuda/std/__cccl/numeric_wrapper.h +36 -0
- cuda/cccl/headers/include/cuda/std/__cmath/isnan.h +3 -2
- cuda/cccl/headers/include/cuda/std/__complex/complex.h +3 -2
- cuda/cccl/headers/include/cuda/std/__complex/literals.h +14 -34
- cuda/cccl/headers/include/cuda/std/__complex/nvbf16.h +2 -1
- cuda/cccl/headers/include/cuda/std/__complex/nvfp16.h +4 -3
- cuda/cccl/headers/include/cuda/std/__concepts/invocable.h +2 -2
- cuda/cccl/headers/include/cuda/std/__cstdlib/malloc.h +3 -2
- cuda/cccl/headers/include/cuda/std/__functional/bind.h +10 -13
- cuda/cccl/headers/include/cuda/std/__functional/function.h +5 -8
- cuda/cccl/headers/include/cuda/std/__functional/invoke.h +71 -335
- cuda/cccl/headers/include/cuda/std/__functional/mem_fn.h +1 -2
- cuda/cccl/headers/include/cuda/std/__functional/reference_wrapper.h +3 -3
- cuda/cccl/headers/include/cuda/std/__functional/weak_result_type.h +0 -6
- cuda/cccl/headers/include/cuda/std/__fwd/allocator.h +13 -0
- cuda/cccl/headers/include/cuda/std/__fwd/char_traits.h +13 -0
- cuda/cccl/headers/include/cuda/std/__fwd/complex.h +13 -4
- cuda/cccl/headers/include/cuda/std/__fwd/mdspan.h +23 -0
- cuda/cccl/headers/include/cuda/std/__fwd/pair.h +13 -0
- cuda/cccl/headers/include/cuda/std/__fwd/string.h +22 -0
- cuda/cccl/headers/include/cuda/std/__fwd/string_view.h +14 -0
- cuda/cccl/headers/include/cuda/std/__internal/features.h +0 -5
- cuda/cccl/headers/include/cuda/std/__internal/namespaces.h +21 -0
- cuda/cccl/headers/include/cuda/std/__iterator/iterator_traits.h +5 -5
- cuda/cccl/headers/include/cuda/std/__mdspan/extents.h +7 -1
- cuda/cccl/headers/include/cuda/std/__mdspan/mdspan.h +53 -39
- cuda/cccl/headers/include/cuda/std/__memory/allocator.h +3 -3
- cuda/cccl/headers/include/cuda/std/__memory/construct_at.h +1 -3
- cuda/cccl/headers/include/cuda/std/__optional/optional_base.h +1 -0
- cuda/cccl/headers/include/cuda/std/__ranges/compressed_movable_box.h +892 -0
- cuda/cccl/headers/include/cuda/std/__ranges/movable_box.h +2 -2
- cuda/cccl/headers/include/cuda/std/__type_traits/is_primary_template.h +7 -5
- cuda/cccl/headers/include/cuda/std/__type_traits/result_of.h +1 -1
- cuda/cccl/headers/include/cuda/std/__utility/pair.h +0 -5
- cuda/cccl/headers/include/cuda/std/bitset +1 -1
- cuda/cccl/headers/include/cuda/std/detail/libcxx/include/__config +15 -12
- cuda/cccl/headers/include/cuda/std/detail/libcxx/include/variant +11 -9
- cuda/cccl/headers/include/cuda/std/inplace_vector +4 -4
- cuda/cccl/headers/include/cuda/std/numbers +5 -0
- cuda/cccl/headers/include/cuda/std/string_view +146 -11
- cuda/cccl/headers/include/cuda/stream_ref +5 -0
- cuda/cccl/headers/include/cuda/utility +1 -0
- cuda/cccl/headers/include/nv/target +7 -2
- cuda/cccl/headers/include/thrust/allocate_unique.h +1 -1
- cuda/cccl/headers/include/thrust/detail/allocator/allocator_traits.h +309 -33
- cuda/cccl/headers/include/thrust/detail/allocator/copy_construct_range.h +151 -4
- cuda/cccl/headers/include/thrust/detail/allocator/destroy_range.h +60 -3
- cuda/cccl/headers/include/thrust/detail/allocator/fill_construct_range.h +45 -3
- cuda/cccl/headers/include/thrust/detail/allocator/malloc_allocator.h +31 -6
- cuda/cccl/headers/include/thrust/detail/allocator/tagged_allocator.h +29 -16
- cuda/cccl/headers/include/thrust/detail/allocator/temporary_allocator.h +41 -4
- cuda/cccl/headers/include/thrust/detail/allocator/value_initialize_range.h +42 -4
- cuda/cccl/headers/include/thrust/detail/complex/ccosh.h +3 -3
- cuda/cccl/headers/include/thrust/detail/internal_functional.h +1 -1
- cuda/cccl/headers/include/thrust/detail/memory_algorithms.h +1 -1
- cuda/cccl/headers/include/thrust/detail/temporary_array.h +1 -1
- cuda/cccl/headers/include/thrust/detail/type_traits.h +1 -1
- cuda/cccl/headers/include/thrust/device_delete.h +18 -3
- cuda/cccl/headers/include/thrust/device_free.h +16 -3
- cuda/cccl/headers/include/thrust/device_new.h +29 -8
- cuda/cccl/headers/include/thrust/host_vector.h +1 -1
- cuda/cccl/headers/include/thrust/iterator/tabulate_output_iterator.h +5 -2
- cuda/cccl/headers/include/thrust/mr/disjoint_pool.h +1 -1
- cuda/cccl/headers/include/thrust/mr/pool.h +1 -1
- cuda/cccl/headers/include/thrust/system/cuda/detail/find.h +13 -115
- cuda/cccl/headers/include/thrust/system/cuda/detail/mismatch.h +8 -2
- cuda/cccl/headers/include/thrust/type_traits/is_contiguous_iterator.h +7 -7
- cuda/compute/__init__.py +2 -0
- cuda/compute/_bindings.pyi +43 -1
- cuda/compute/_bindings_impl.pyx +156 -7
- cuda/compute/algorithms/_scan.py +108 -36
- cuda/compute/algorithms/_transform.py +32 -11
- cuda/compute/cu12/_bindings_impl.cpython-312-aarch64-linux-gnu.so +0 -0
- cuda/compute/cu12/cccl/libcccl.c.parallel.so +0 -0
- cuda/compute/cu13/_bindings_impl.cpython-312-aarch64-linux-gnu.so +0 -0
- cuda/compute/cu13/cccl/libcccl.c.parallel.so +0 -0
- cuda/compute/iterators/__init__.py +2 -0
- cuda/compute/iterators/_factories.py +28 -0
- cuda/compute/iterators/_iterators.py +206 -1
- cuda/compute/numba_utils.py +2 -2
- cuda/compute/typing.py +2 -0
- {cuda_cccl-0.3.1.dist-info → cuda_cccl-0.3.2.dist-info}/METADATA +1 -1
- {cuda_cccl-0.3.1.dist-info → cuda_cccl-0.3.2.dist-info}/RECORD +171 -175
- cuda/cccl/headers/include/thrust/detail/algorithm_wrapper.h +0 -37
- cuda/cccl/headers/include/thrust/detail/allocator/allocator_traits.inl +0 -371
- cuda/cccl/headers/include/thrust/detail/allocator/copy_construct_range.inl +0 -242
- cuda/cccl/headers/include/thrust/detail/allocator/destroy_range.inl +0 -137
- cuda/cccl/headers/include/thrust/detail/allocator/fill_construct_range.inl +0 -99
- cuda/cccl/headers/include/thrust/detail/allocator/malloc_allocator.inl +0 -68
- cuda/cccl/headers/include/thrust/detail/allocator/tagged_allocator.inl +0 -86
- cuda/cccl/headers/include/thrust/detail/allocator/temporary_allocator.inl +0 -79
- cuda/cccl/headers/include/thrust/detail/allocator/value_initialize_range.inl +0 -98
- cuda/cccl/headers/include/thrust/detail/device_delete.inl +0 -52
- cuda/cccl/headers/include/thrust/detail/device_free.inl +0 -47
- cuda/cccl/headers/include/thrust/detail/device_new.inl +0 -61
- cuda/cccl/headers/include/thrust/detail/memory_wrapper.h +0 -40
- cuda/cccl/headers/include/thrust/detail/numeric_wrapper.h +0 -37
- {cuda_cccl-0.3.1.dist-info → cuda_cccl-0.3.2.dist-info}/WHEEL +0 -0
- {cuda_cccl-0.3.1.dist-info → cuda_cccl-0.3.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
#include <cuda/std/__functional/invoke.h>
|
|
32
32
|
#include <cuda/std/__iterator/concepts.h>
|
|
33
33
|
#include <cuda/std/__iterator/iterator_traits.h>
|
|
34
|
+
#include <cuda/std/__ranges/compressed_movable_box.h>
|
|
34
35
|
#include <cuda/std/__ranges/concepts.h>
|
|
35
36
|
#include <cuda/std/__ranges/movable_box.h>
|
|
36
37
|
#include <cuda/std/__type_traits/conditional.h>
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
#include <cuda/std/__type_traits/is_object.h>
|
|
41
42
|
#include <cuda/std/__type_traits/is_reference.h>
|
|
42
43
|
#include <cuda/std/__type_traits/remove_cvref.h>
|
|
44
|
+
#include <cuda/std/__utility/declval.h>
|
|
43
45
|
#include <cuda/std/__utility/forward.h>
|
|
44
46
|
#include <cuda/std/__utility/move.h>
|
|
45
47
|
|
|
@@ -159,10 +161,30 @@ class transform_iterator : public __transform_iterator_category_base<_Fn, _Iter>
|
|
|
159
161
|
static_assert(::cuda::std::__can_reference<::cuda::std::invoke_result_t<_Fn&, ::cuda::std::iter_reference_t<_Iter>>>,
|
|
160
162
|
"cuda::transform_iterator requires that the return type of _Fn is referenceable");
|
|
161
163
|
|
|
162
|
-
|
|
163
|
-
_Iter
|
|
164
|
-
|
|
164
|
+
// Not a base because then the friend operators would be ambiguous
|
|
165
|
+
::cuda::std::__compressed_movable_box<_Iter, _Fn> __store_;
|
|
166
|
+
|
|
167
|
+
[[nodiscard]] _CCCL_API constexpr _Iter& __iter() noexcept
|
|
168
|
+
{
|
|
169
|
+
return __store_.template __get<0>();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
[[nodiscard]] _CCCL_API constexpr const _Iter& __iter() const noexcept
|
|
173
|
+
{
|
|
174
|
+
return __store_.template __get<0>();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
[[nodiscard]] _CCCL_API constexpr _Fn& __func() noexcept
|
|
178
|
+
{
|
|
179
|
+
return __store_.template __get<1>();
|
|
180
|
+
}
|
|
165
181
|
|
|
182
|
+
[[nodiscard]] _CCCL_API constexpr const _Fn& __func() const noexcept
|
|
183
|
+
{
|
|
184
|
+
return __store_.template __get<1>();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
public:
|
|
166
188
|
using iterator_concept = ::cuda::std::conditional_t<
|
|
167
189
|
::cuda::std::__has_random_access_traversal<_Iter>,
|
|
168
190
|
::cuda::std::random_access_iterator_tag,
|
|
@@ -181,19 +203,13 @@ public:
|
|
|
181
203
|
using pointer = void;
|
|
182
204
|
|
|
183
205
|
//! @brief Default constructs a @c transform_iterator with a value initialized iterator and functor
|
|
184
|
-
#if _CCCL_HAS_CONCEPTS()
|
|
185
|
-
_CCCL_EXEC_CHECK_DISABLE
|
|
186
|
-
_CCCL_HIDE_FROM_ABI transform_iterator()
|
|
187
|
-
requires ::cuda::std::default_initializable<_Iter> && ::cuda::std::default_initializable<_Fn>
|
|
188
|
-
= default;
|
|
189
|
-
#else // ^^^ _CCCL_HAS_CONCEPTS() ^^^ / vvv !_CCCL_HAS_CONCEPTS() vvv
|
|
190
206
|
_CCCL_EXEC_CHECK_DISABLE
|
|
191
207
|
_CCCL_TEMPLATE(class _Iter2 = _Iter, class _Fn2 = _Fn)
|
|
192
208
|
_CCCL_REQUIRES(::cuda::std::default_initializable<_Iter2> _CCCL_AND ::cuda::std::default_initializable<_Fn2>)
|
|
193
209
|
_CCCL_API constexpr transform_iterator() noexcept(
|
|
194
210
|
::cuda::std::is_nothrow_default_constructible_v<_Iter2> && ::cuda::std::is_nothrow_default_constructible_v<_Fn2>)
|
|
211
|
+
: __store_()
|
|
195
212
|
{}
|
|
196
|
-
#endif // ^^^ !_CCCL_HAS_CONCEPTS() ^^^
|
|
197
213
|
|
|
198
214
|
//! @brief Constructs a @c transform_iterator with a given iterator and functor
|
|
199
215
|
//! @param __iter The iterator to transform
|
|
@@ -201,21 +217,20 @@ public:
|
|
|
201
217
|
_CCCL_EXEC_CHECK_DISABLE
|
|
202
218
|
_CCCL_API constexpr transform_iterator(_Iter __iter, _Fn __func) noexcept(
|
|
203
219
|
::cuda::std::is_nothrow_move_constructible_v<_Iter> && ::cuda::std::is_nothrow_move_constructible_v<_Fn>)
|
|
204
|
-
:
|
|
205
|
-
, __func_(::cuda::std::in_place, ::cuda::std::move(__func))
|
|
220
|
+
: __store_(::cuda::std::move(__iter), ::cuda::std::move(__func))
|
|
206
221
|
{}
|
|
207
222
|
|
|
208
223
|
//! @brief Returns a const reference to the stored iterator
|
|
209
224
|
[[nodiscard]] _CCCL_API constexpr const _Iter& base() const& noexcept
|
|
210
225
|
{
|
|
211
|
-
return
|
|
226
|
+
return __iter();
|
|
212
227
|
}
|
|
213
228
|
|
|
214
229
|
//! @brief Extracts the stored iterator
|
|
215
230
|
_CCCL_EXEC_CHECK_DISABLE
|
|
216
231
|
[[nodiscard]] _CCCL_API constexpr _Iter base() && noexcept(::cuda::std::is_nothrow_move_constructible_v<_Iter>)
|
|
217
232
|
{
|
|
218
|
-
return ::cuda::std::move(
|
|
233
|
+
return ::cuda::std::move(__iter());
|
|
219
234
|
}
|
|
220
235
|
|
|
221
236
|
//! @brief Dereferences the stored iterator and applies the stored functor to the result
|
|
@@ -223,9 +238,9 @@ public:
|
|
|
223
238
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
224
239
|
_CCCL_REQUIRES(::cuda::std::regular_invocable<const _Fn&, ::cuda::std::iter_reference_t<const _Iter2>>)
|
|
225
240
|
[[nodiscard]] _CCCL_API constexpr reference operator*() const
|
|
226
|
-
noexcept(noexcept(::cuda::std::invoke(
|
|
241
|
+
noexcept(noexcept(::cuda::std::invoke(::cuda::std::declval<const _Fn&>(), *::cuda::std::declval<const _Iter2&>())))
|
|
227
242
|
{
|
|
228
|
-
return ::cuda::std::invoke(
|
|
243
|
+
return ::cuda::std::invoke(__func(), *__iter());
|
|
229
244
|
}
|
|
230
245
|
|
|
231
246
|
//! @cond
|
|
@@ -236,17 +251,18 @@ public:
|
|
|
236
251
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
237
252
|
_CCCL_REQUIRES((!::cuda::std::regular_invocable<const _Fn&, ::cuda::std::iter_reference_t<const _Iter2>>) )
|
|
238
253
|
[[nodiscard]] _CCCL_API constexpr reference operator*() const
|
|
239
|
-
noexcept(noexcept(::cuda::std::invoke(
|
|
254
|
+
noexcept(noexcept(::cuda::std::invoke(::cuda::std::declval<_Fn&>(), *::cuda::std::declval<const _Iter2&>())))
|
|
240
255
|
{
|
|
241
|
-
return ::cuda::std::invoke(const_cast<_Fn&>(
|
|
256
|
+
return ::cuda::std::invoke(const_cast<_Fn&>(__func()), *__iter());
|
|
242
257
|
}
|
|
243
258
|
//! @endcond
|
|
244
259
|
|
|
245
260
|
//! @brief Dereferences the stored iterator and applies the stored functor to the result
|
|
246
261
|
_CCCL_EXEC_CHECK_DISABLE
|
|
247
|
-
[[nodiscard]] _CCCL_API constexpr reference
|
|
262
|
+
[[nodiscard]] _CCCL_API constexpr reference
|
|
263
|
+
operator*() noexcept(noexcept(::cuda::std::invoke(::cuda::std::declval<_Fn&>(), *::cuda::std::declval<_Iter&>())))
|
|
248
264
|
{
|
|
249
|
-
return ::cuda::std::invoke(
|
|
265
|
+
return ::cuda::std::invoke(__func(), *__iter());
|
|
250
266
|
}
|
|
251
267
|
|
|
252
268
|
//! @brief Subscripts the stored iterator by a number of elements and applies the stored functor to the result
|
|
@@ -258,7 +274,7 @@ public:
|
|
|
258
274
|
[[nodiscard]] _CCCL_API constexpr reference operator[](difference_type __n) const
|
|
259
275
|
noexcept(__transform_iterator_nothrow_subscript<const _Fn, _Iter2>)
|
|
260
276
|
{
|
|
261
|
-
return ::cuda::std::invoke(
|
|
277
|
+
return ::cuda::std::invoke(__func(), __iter()[__n]);
|
|
262
278
|
}
|
|
263
279
|
|
|
264
280
|
//! @cond
|
|
@@ -273,7 +289,7 @@ public:
|
|
|
273
289
|
[[nodiscard]] _CCCL_API constexpr reference operator[](difference_type __n) const
|
|
274
290
|
noexcept(__transform_iterator_nothrow_subscript<_Fn, _Iter2>)
|
|
275
291
|
{
|
|
276
|
-
return ::cuda::std::invoke(const_cast<_Fn&>(
|
|
292
|
+
return ::cuda::std::invoke(const_cast<_Fn&>(__func()), __iter()[__n]);
|
|
277
293
|
}
|
|
278
294
|
//! @endcond
|
|
279
295
|
|
|
@@ -285,20 +301,20 @@ public:
|
|
|
285
301
|
[[nodiscard]] _CCCL_API constexpr reference
|
|
286
302
|
operator[](difference_type __n) noexcept(__transform_iterator_nothrow_subscript<_Fn, _Iter2>)
|
|
287
303
|
{
|
|
288
|
-
return ::cuda::std::invoke(
|
|
304
|
+
return ::cuda::std::invoke(__func(), __iter()[__n]);
|
|
289
305
|
}
|
|
290
306
|
|
|
291
307
|
//! @brief Increments the stored iterator
|
|
292
308
|
_CCCL_EXEC_CHECK_DISABLE
|
|
293
|
-
_CCCL_API constexpr transform_iterator& operator++() noexcept(noexcept(
|
|
309
|
+
_CCCL_API constexpr transform_iterator& operator++() noexcept(noexcept(++::cuda::std::declval<_Iter&>()))
|
|
294
310
|
{
|
|
295
|
-
++
|
|
311
|
+
++__iter();
|
|
296
312
|
return *this;
|
|
297
313
|
}
|
|
298
314
|
|
|
299
315
|
//! @brief Increments the stored iterator
|
|
300
316
|
_CCCL_EXEC_CHECK_DISABLE
|
|
301
|
-
_CCCL_API constexpr auto operator++(int) noexcept(noexcept(
|
|
317
|
+
_CCCL_API constexpr auto operator++(int) noexcept(noexcept(++::cuda::std::declval<_Iter&>()))
|
|
302
318
|
{
|
|
303
319
|
if constexpr (::cuda::std::__has_forward_traversal<_Iter>)
|
|
304
320
|
{
|
|
@@ -308,7 +324,7 @@ public:
|
|
|
308
324
|
}
|
|
309
325
|
else
|
|
310
326
|
{
|
|
311
|
-
++
|
|
327
|
+
++__iter();
|
|
312
328
|
}
|
|
313
329
|
}
|
|
314
330
|
|
|
@@ -316,9 +332,9 @@ public:
|
|
|
316
332
|
_CCCL_EXEC_CHECK_DISABLE
|
|
317
333
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
318
334
|
_CCCL_REQUIRES(::cuda::std::__has_bidirectional_traversal<_Iter2>)
|
|
319
|
-
_CCCL_API constexpr transform_iterator& operator--() noexcept(noexcept(
|
|
335
|
+
_CCCL_API constexpr transform_iterator& operator--() noexcept(noexcept(--::cuda::std::declval<_Iter2&>()))
|
|
320
336
|
{
|
|
321
|
-
--
|
|
337
|
+
--__iter();
|
|
322
338
|
return *this;
|
|
323
339
|
}
|
|
324
340
|
|
|
@@ -326,8 +342,8 @@ public:
|
|
|
326
342
|
_CCCL_EXEC_CHECK_DISABLE
|
|
327
343
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
328
344
|
_CCCL_REQUIRES(::cuda::std::__has_bidirectional_traversal<_Iter2>)
|
|
329
|
-
_CCCL_API constexpr transform_iterator
|
|
330
|
-
|
|
345
|
+
_CCCL_API constexpr transform_iterator operator--(int) noexcept(
|
|
346
|
+
::cuda::std::is_nothrow_copy_constructible_v<_Iter> && noexcept(--::cuda::std::declval<_Iter2&>()))
|
|
331
347
|
{
|
|
332
348
|
auto __tmp = *this;
|
|
333
349
|
--*this;
|
|
@@ -339,9 +355,10 @@ public:
|
|
|
339
355
|
_CCCL_EXEC_CHECK_DISABLE
|
|
340
356
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
341
357
|
_CCCL_REQUIRES(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
342
|
-
_CCCL_API constexpr transform_iterator&
|
|
358
|
+
_CCCL_API constexpr transform_iterator&
|
|
359
|
+
operator+=(difference_type __n) noexcept(noexcept(::cuda::std::declval<_Iter2&>() += __n))
|
|
343
360
|
{
|
|
344
|
-
|
|
361
|
+
__iter() += __n;
|
|
345
362
|
return *this;
|
|
346
363
|
}
|
|
347
364
|
|
|
@@ -353,7 +370,7 @@ public:
|
|
|
353
370
|
[[nodiscard]] _CCCL_API friend constexpr auto operator+(const transform_iterator& __iter, difference_type __n)
|
|
354
371
|
_CCCL_TRAILING_REQUIRES(transform_iterator)(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
355
372
|
{
|
|
356
|
-
return transform_iterator{__iter.
|
|
373
|
+
return transform_iterator{__iter.__iter() + __n, __iter.__func()};
|
|
357
374
|
}
|
|
358
375
|
|
|
359
376
|
//! @brief Returns a copy of a @c transform_iterator advanced by a given number of elements
|
|
@@ -364,7 +381,7 @@ public:
|
|
|
364
381
|
[[nodiscard]] _CCCL_API friend constexpr auto operator+(difference_type __n, const transform_iterator& __iter)
|
|
365
382
|
_CCCL_TRAILING_REQUIRES(transform_iterator)(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
366
383
|
{
|
|
367
|
-
return transform_iterator{__iter.
|
|
384
|
+
return transform_iterator{__iter.__iter() + __n, __iter.__func()};
|
|
368
385
|
}
|
|
369
386
|
|
|
370
387
|
//! @brief Decrements the @c transform_iterator by a given number of elements
|
|
@@ -372,9 +389,10 @@ public:
|
|
|
372
389
|
_CCCL_EXEC_CHECK_DISABLE
|
|
373
390
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
374
391
|
_CCCL_REQUIRES(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
375
|
-
_CCCL_API constexpr transform_iterator&
|
|
392
|
+
_CCCL_API constexpr transform_iterator&
|
|
393
|
+
operator-=(difference_type __n) noexcept(noexcept(::cuda::std::declval<_Iter2&>() -= __n))
|
|
376
394
|
{
|
|
377
|
-
|
|
395
|
+
__iter() -= __n;
|
|
378
396
|
return *this;
|
|
379
397
|
}
|
|
380
398
|
|
|
@@ -386,17 +404,25 @@ public:
|
|
|
386
404
|
[[nodiscard]] _CCCL_API friend constexpr auto operator-(const transform_iterator& __iter, difference_type __n)
|
|
387
405
|
_CCCL_TRAILING_REQUIRES(transform_iterator)(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
388
406
|
{
|
|
389
|
-
return transform_iterator{__iter.
|
|
407
|
+
return transform_iterator{__iter.__iter() - __n, __iter.__func()};
|
|
390
408
|
}
|
|
391
409
|
|
|
410
|
+
template <class _Iter2>
|
|
411
|
+
static constexpr bool __can_difference =
|
|
412
|
+
(::cuda::std::__has_random_access_traversal<_Iter2> || ::cuda::std::sized_sentinel_for<_Iter2, _Iter2>);
|
|
413
|
+
|
|
414
|
+
template <class _Iter2>
|
|
415
|
+
static constexpr bool __noexcept_difference =
|
|
416
|
+
noexcept(::cuda::std::declval<const _Iter2&>() - ::cuda::std::declval<const _Iter2&>());
|
|
417
|
+
|
|
392
418
|
//! @brief Returns the distance between two @c transform_iterator
|
|
393
419
|
_CCCL_EXEC_CHECK_DISABLE
|
|
394
420
|
template <class _Iter2 = _Iter>
|
|
395
421
|
[[nodiscard]] _CCCL_API friend constexpr auto
|
|
396
|
-
operator-(const transform_iterator& __lhs, const transform_iterator& __rhs)
|
|
397
|
-
_CCCL_TRAILING_REQUIRES(difference_type)(
|
|
422
|
+
operator-(const transform_iterator& __lhs, const transform_iterator& __rhs) noexcept(__noexcept_difference<_Iter2>)
|
|
423
|
+
_CCCL_TRAILING_REQUIRES(difference_type)(__can_difference<_Iter2>)
|
|
398
424
|
{
|
|
399
|
-
return __lhs.
|
|
425
|
+
return __lhs.__iter() - __rhs.__iter();
|
|
400
426
|
}
|
|
401
427
|
|
|
402
428
|
//! @brief Compares two @c transform_iterator for equality by comparing the stored iterators
|
|
@@ -407,7 +433,7 @@ public:
|
|
|
407
433
|
noexcept(::cuda::std::declval<const _Iter2&>() == ::cuda::std::declval<const _Iter2&>()))
|
|
408
434
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::equality_comparable<_Iter2>)
|
|
409
435
|
{
|
|
410
|
-
return __lhs.
|
|
436
|
+
return __lhs.__iter() == __rhs.__iter();
|
|
411
437
|
}
|
|
412
438
|
|
|
413
439
|
#if _CCCL_STD_VER <= 2017
|
|
@@ -419,7 +445,7 @@ public:
|
|
|
419
445
|
noexcept(::cuda::std::declval<const _Iter2&>() != ::cuda::std::declval<const _Iter2&>()))
|
|
420
446
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::equality_comparable<_Iter2>)
|
|
421
447
|
{
|
|
422
|
-
return __lhs.
|
|
448
|
+
return __lhs.__iter() != __rhs.__iter();
|
|
423
449
|
}
|
|
424
450
|
#endif // _CCCL_STD_VER <= 2017
|
|
425
451
|
|
|
@@ -433,7 +459,7 @@ public:
|
|
|
433
459
|
_CCCL_TRAILING_REQUIRES(bool)(
|
|
434
460
|
::cuda::std::__has_random_access_traversal<_Iter2>&& ::cuda::std::three_way_comparable<_Iter2>)
|
|
435
461
|
{
|
|
436
|
-
return __lhs.
|
|
462
|
+
return __lhs.__iter() <=> __rhs.__iter();
|
|
437
463
|
}
|
|
438
464
|
#else // ^^^ _LIBCUDACXX_HAS_SPACESHIP_OPERATOR() ^^^ / vvv !_LIBCUDACXX_HAS_SPACESHIP_OPERATOR() vvv
|
|
439
465
|
//! @brief Compares two @c transform_iterator for less than by comparing the stored iterators
|
|
@@ -444,7 +470,7 @@ public:
|
|
|
444
470
|
noexcept(::cuda::std::declval<const _Iter2&>() < ::cuda::std::declval<const _Iter2&>()))
|
|
445
471
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
446
472
|
{
|
|
447
|
-
return __lhs.
|
|
473
|
+
return __lhs.__iter() < __rhs.__iter();
|
|
448
474
|
}
|
|
449
475
|
|
|
450
476
|
//! @brief Compares two @c transform_iterator for greater than by comparing the stored iterators
|
|
@@ -455,7 +481,7 @@ public:
|
|
|
455
481
|
noexcept(::cuda::std::declval<const _Iter2&>() < ::cuda::std::declval<const _Iter2&>()))
|
|
456
482
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
457
483
|
{
|
|
458
|
-
return __lhs.
|
|
484
|
+
return __lhs.__iter() > __rhs.__iter();
|
|
459
485
|
}
|
|
460
486
|
|
|
461
487
|
//! @brief Compares two @c transform_iterator for less equal by comparing the stored iterators
|
|
@@ -466,7 +492,7 @@ public:
|
|
|
466
492
|
noexcept(::cuda::std::declval<const _Iter2&>() < ::cuda::std::declval<const _Iter2&>()))
|
|
467
493
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
468
494
|
{
|
|
469
|
-
return __lhs.
|
|
495
|
+
return __lhs.__iter() <= __rhs.__iter();
|
|
470
496
|
}
|
|
471
497
|
|
|
472
498
|
//! @brief Compares two @c transform_iterator for greater equal by comparing the stored iterators
|
|
@@ -477,7 +503,7 @@ public:
|
|
|
477
503
|
noexcept(::cuda::std::declval<const _Iter2&>() < ::cuda::std::declval<const _Iter2&>()))
|
|
478
504
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
479
505
|
{
|
|
480
|
-
return __lhs.
|
|
506
|
+
return __lhs.__iter() >= __rhs.__iter();
|
|
481
507
|
}
|
|
482
508
|
#endif // !_LIBCUDACXX_HAS_SPACESHIP_OPERATOR()
|
|
483
509
|
};
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
#include <cuda/std/__functional/invoke.h>
|
|
31
31
|
#include <cuda/std/__iterator/concepts.h>
|
|
32
32
|
#include <cuda/std/__iterator/iterator_traits.h>
|
|
33
|
+
#include <cuda/std/__ranges/compressed_movable_box.h>
|
|
33
34
|
#include <cuda/std/__ranges/concepts.h>
|
|
34
35
|
#include <cuda/std/__ranges/movable_box.h>
|
|
35
36
|
#include <cuda/std/__type_traits/conditional.h>
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
#include <cuda/std/__type_traits/is_object.h>
|
|
42
43
|
#include <cuda/std/__type_traits/is_reference.h>
|
|
43
44
|
#include <cuda/std/__type_traits/remove_cvref.h>
|
|
45
|
+
#include <cuda/std/__utility/declval.h>
|
|
44
46
|
#include <cuda/std/__utility/forward.h>
|
|
45
47
|
#include <cuda/std/__utility/move.h>
|
|
46
48
|
|
|
@@ -144,10 +146,30 @@ class transform_output_iterator
|
|
|
144
146
|
static_assert(::cuda::std::is_object_v<_Fn>,
|
|
145
147
|
"cuda::transform_output_iterator requires that _Fn is a function object");
|
|
146
148
|
|
|
147
|
-
|
|
148
|
-
_Iter
|
|
149
|
-
|
|
149
|
+
// Not a base because then the friend operators would be ambiguous
|
|
150
|
+
::cuda::std::__compressed_movable_box<_Iter, _Fn> __store_;
|
|
151
|
+
|
|
152
|
+
[[nodiscard]] _CCCL_API constexpr _Iter& __iter() noexcept
|
|
153
|
+
{
|
|
154
|
+
return __store_.template __get<0>();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
[[nodiscard]] _CCCL_API constexpr const _Iter& __iter() const noexcept
|
|
158
|
+
{
|
|
159
|
+
return __store_.template __get<0>();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
[[nodiscard]] _CCCL_API constexpr _Fn& __func() noexcept
|
|
163
|
+
{
|
|
164
|
+
return __store_.template __get<1>();
|
|
165
|
+
}
|
|
150
166
|
|
|
167
|
+
[[nodiscard]] _CCCL_API constexpr const _Fn& __func() const noexcept
|
|
168
|
+
{
|
|
169
|
+
return __store_.template __get<1>();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
public:
|
|
151
173
|
using iterator_concept = ::cuda::std::conditional_t<
|
|
152
174
|
::cuda::std::__has_random_access_traversal<_Iter>,
|
|
153
175
|
::cuda::std::random_access_iterator_tag,
|
|
@@ -163,19 +185,13 @@ public:
|
|
|
163
185
|
using reference = void;
|
|
164
186
|
|
|
165
187
|
//! @brief Default constructs a @c transform_output_iterator with a value initialized iterator and functor
|
|
166
|
-
#if _CCCL_HAS_CONCEPTS()
|
|
167
|
-
_CCCL_EXEC_CHECK_DISABLE
|
|
168
|
-
_CCCL_HIDE_FROM_ABI transform_output_iterator()
|
|
169
|
-
requires ::cuda::std::default_initializable<_Iter> && ::cuda::std::default_initializable<_Fn>
|
|
170
|
-
= default;
|
|
171
|
-
#else // ^^^ _CCCL_HAS_CONCEPTS() ^^^ / vvv !_CCCL_HAS_CONCEPTS() vvv
|
|
172
188
|
_CCCL_EXEC_CHECK_DISABLE
|
|
173
189
|
_CCCL_TEMPLATE(class _Iter2 = _Iter, class _Fn2 = _Fn)
|
|
174
190
|
_CCCL_REQUIRES(::cuda::std::default_initializable<_Iter2> _CCCL_AND ::cuda::std::default_initializable<_Fn2>)
|
|
175
191
|
_CCCL_API constexpr transform_output_iterator() noexcept(
|
|
176
192
|
::cuda::std::is_nothrow_default_constructible_v<_Iter2> && ::cuda::std::is_nothrow_default_constructible_v<_Fn2>)
|
|
193
|
+
: __store_()
|
|
177
194
|
{}
|
|
178
|
-
#endif // ^^^ !_CCCL_HAS_CONCEPTS() ^^^
|
|
179
195
|
|
|
180
196
|
//! @brief Constructs a @c transform_output_iterator with a given iterator and output functor
|
|
181
197
|
//! @param __iter The iterator to transform
|
|
@@ -183,35 +199,34 @@ public:
|
|
|
183
199
|
_CCCL_EXEC_CHECK_DISABLE
|
|
184
200
|
_CCCL_API constexpr transform_output_iterator(_Iter __iter, _Fn __func) noexcept(
|
|
185
201
|
::cuda::std::is_nothrow_move_constructible_v<_Iter> && ::cuda::std::is_nothrow_move_constructible_v<_Fn>)
|
|
186
|
-
:
|
|
187
|
-
, __func_(::cuda::std::in_place, ::cuda::std::move(__func))
|
|
202
|
+
: __store_(::cuda::std::move(__iter), ::cuda::std::move(__func))
|
|
188
203
|
{}
|
|
189
204
|
|
|
190
205
|
//! @brief Returns a const reference to the stored iterator
|
|
191
206
|
[[nodiscard]] _CCCL_API constexpr const _Iter& base() const& noexcept
|
|
192
207
|
{
|
|
193
|
-
return
|
|
208
|
+
return __iter();
|
|
194
209
|
}
|
|
195
210
|
|
|
196
211
|
//! @brief Extracts the stored iterator
|
|
197
212
|
_CCCL_EXEC_CHECK_DISABLE
|
|
198
213
|
[[nodiscard]] _CCCL_API constexpr _Iter base() && noexcept(::cuda::std::is_nothrow_move_constructible_v<_Iter>)
|
|
199
214
|
{
|
|
200
|
-
return ::cuda::std::move(
|
|
215
|
+
return ::cuda::std::move(__iter());
|
|
201
216
|
}
|
|
202
217
|
|
|
203
218
|
//! @brief Returns a proxy that transforms the input upon assignment
|
|
204
219
|
_CCCL_EXEC_CHECK_DISABLE
|
|
205
220
|
[[nodiscard]] _CCCL_API constexpr auto operator*() const noexcept(::cuda::std::is_nothrow_copy_constructible_v<_Iter>)
|
|
206
221
|
{
|
|
207
|
-
return __transform_output_proxy{
|
|
222
|
+
return __transform_output_proxy{__iter(), const_cast<_Fn&>(__func())};
|
|
208
223
|
}
|
|
209
224
|
|
|
210
225
|
//! @brief Returns a proxy that transforms the input upon assignment
|
|
211
226
|
_CCCL_EXEC_CHECK_DISABLE
|
|
212
227
|
[[nodiscard]] _CCCL_API constexpr auto operator*() noexcept(::cuda::std::is_nothrow_copy_constructible_v<_Iter>)
|
|
213
228
|
{
|
|
214
|
-
return __transform_output_proxy{
|
|
229
|
+
return __transform_output_proxy{__iter(), __func()};
|
|
215
230
|
}
|
|
216
231
|
|
|
217
232
|
//! @brief Subscripts the @c transform_output_iterator
|
|
@@ -221,9 +236,10 @@ public:
|
|
|
221
236
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
222
237
|
_CCCL_REQUIRES(::cuda::std::__iter_can_subscript<_Iter2>)
|
|
223
238
|
[[nodiscard]] _CCCL_API constexpr auto operator[](difference_type __n) const
|
|
224
|
-
noexcept(::cuda::std::is_nothrow_copy_constructible_v<_Iter2>
|
|
239
|
+
noexcept(::cuda::std::is_nothrow_copy_constructible_v<_Iter2>
|
|
240
|
+
&& noexcept(::cuda::std::declval<const _Iter2&>() + __n))
|
|
225
241
|
{
|
|
226
|
-
return __transform_output_proxy{
|
|
242
|
+
return __transform_output_proxy{__iter() + __n, const_cast<_Fn&>(__func())};
|
|
227
243
|
}
|
|
228
244
|
|
|
229
245
|
//! @brief Subscripts the @c transform_output_iterator
|
|
@@ -233,22 +249,22 @@ public:
|
|
|
233
249
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
234
250
|
_CCCL_REQUIRES(::cuda::std::__iter_can_subscript<_Iter2>)
|
|
235
251
|
[[nodiscard]] _CCCL_API constexpr auto operator[](difference_type __n) noexcept(
|
|
236
|
-
::cuda::std::is_nothrow_copy_constructible_v<_Iter2> && noexcept(
|
|
252
|
+
::cuda::std::is_nothrow_copy_constructible_v<_Iter2> && noexcept(::cuda::std::declval<_Iter2&>() + __n))
|
|
237
253
|
{
|
|
238
|
-
return __transform_output_proxy{
|
|
254
|
+
return __transform_output_proxy{__iter() + __n, const_cast<_Fn&>(__func())};
|
|
239
255
|
}
|
|
240
256
|
|
|
241
257
|
//! @brief Increments the stored iterator
|
|
242
258
|
_CCCL_EXEC_CHECK_DISABLE
|
|
243
|
-
_CCCL_API constexpr transform_output_iterator& operator++() noexcept(noexcept(
|
|
259
|
+
_CCCL_API constexpr transform_output_iterator& operator++() noexcept(noexcept(++::cuda::std::declval<_Iter&>()))
|
|
244
260
|
{
|
|
245
|
-
++
|
|
261
|
+
++__iter();
|
|
246
262
|
return *this;
|
|
247
263
|
}
|
|
248
264
|
|
|
249
265
|
//! @brief Increments the stored iterator
|
|
250
266
|
_CCCL_EXEC_CHECK_DISABLE
|
|
251
|
-
_CCCL_API constexpr auto operator++(int) noexcept(noexcept(
|
|
267
|
+
_CCCL_API constexpr auto operator++(int) noexcept(noexcept(++::cuda::std::declval<_Iter&>()))
|
|
252
268
|
{
|
|
253
269
|
if constexpr (::cuda::std::__has_forward_traversal<_Iter> || ::cuda::std::output_iterator<_Iter, value_type>)
|
|
254
270
|
{
|
|
@@ -258,7 +274,7 @@ public:
|
|
|
258
274
|
}
|
|
259
275
|
else
|
|
260
276
|
{
|
|
261
|
-
++
|
|
277
|
+
++__iter();
|
|
262
278
|
}
|
|
263
279
|
}
|
|
264
280
|
|
|
@@ -266,9 +282,9 @@ public:
|
|
|
266
282
|
_CCCL_EXEC_CHECK_DISABLE
|
|
267
283
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
268
284
|
_CCCL_REQUIRES(::cuda::std::__iter_can_decrement<_Iter2>)
|
|
269
|
-
_CCCL_API constexpr transform_output_iterator& operator--() noexcept(noexcept(
|
|
285
|
+
_CCCL_API constexpr transform_output_iterator& operator--() noexcept(noexcept(--::cuda::std::declval<_Iter2&>()))
|
|
270
286
|
{
|
|
271
|
-
--
|
|
287
|
+
--__iter();
|
|
272
288
|
return *this;
|
|
273
289
|
}
|
|
274
290
|
|
|
@@ -276,8 +292,8 @@ public:
|
|
|
276
292
|
_CCCL_EXEC_CHECK_DISABLE
|
|
277
293
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
278
294
|
_CCCL_REQUIRES(::cuda::std::__iter_can_decrement<_Iter2>)
|
|
279
|
-
_CCCL_API constexpr transform_output_iterator
|
|
280
|
-
|
|
295
|
+
_CCCL_API constexpr transform_output_iterator operator--(int) noexcept(
|
|
296
|
+
::cuda::std::is_nothrow_copy_constructible_v<_Iter> && noexcept(--::cuda::std::declval<_Iter2&>()))
|
|
281
297
|
{
|
|
282
298
|
auto __tmp = *this;
|
|
283
299
|
--*this;
|
|
@@ -289,9 +305,10 @@ public:
|
|
|
289
305
|
_CCCL_EXEC_CHECK_DISABLE
|
|
290
306
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
291
307
|
_CCCL_REQUIRES(::cuda::std::__iter_can_plus_equal<_Iter2>)
|
|
292
|
-
_CCCL_API constexpr transform_output_iterator&
|
|
308
|
+
_CCCL_API constexpr transform_output_iterator&
|
|
309
|
+
operator+=(difference_type __n) noexcept(noexcept(::cuda::std::declval<_Iter2&>() += __n))
|
|
293
310
|
{
|
|
294
|
-
|
|
311
|
+
__iter() += __n;
|
|
295
312
|
return *this;
|
|
296
313
|
}
|
|
297
314
|
|
|
@@ -301,12 +318,12 @@ public:
|
|
|
301
318
|
_CCCL_EXEC_CHECK_DISABLE
|
|
302
319
|
template <class _Iter2 = _Iter>
|
|
303
320
|
[[nodiscard]] _CCCL_API friend constexpr auto
|
|
304
|
-
operator+(const transform_output_iterator& __iter,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
321
|
+
operator+(const transform_output_iterator& __iter, difference_type __n) //
|
|
322
|
+
noexcept(::cuda::std::is_nothrow_copy_constructible_v<_Iter2>
|
|
323
|
+
&& noexcept(::cuda::std::declval<const _Iter2&>() + difference_type{}))
|
|
324
|
+
_CCCL_TRAILING_REQUIRES(transform_output_iterator)(::cuda::std::__iter_can_plus<_Iter2>)
|
|
308
325
|
{
|
|
309
|
-
return transform_output_iterator{__iter.
|
|
326
|
+
return transform_output_iterator{__iter.__iter() + __n, __iter.__func()};
|
|
310
327
|
}
|
|
311
328
|
|
|
312
329
|
//! @brief Returns a copy of a @c transform_output_iterator incremented by a given number of elements
|
|
@@ -320,7 +337,7 @@ public:
|
|
|
320
337
|
&& noexcept(::cuda::std::declval<const _Iter2&>() + difference_type{}))
|
|
321
338
|
_CCCL_TRAILING_REQUIRES(transform_output_iterator)(::cuda::std::__iter_can_plus<_Iter2>)
|
|
322
339
|
{
|
|
323
|
-
return transform_output_iterator{__iter.
|
|
340
|
+
return transform_output_iterator{__iter.__iter() + __n, __iter.__func()};
|
|
324
341
|
}
|
|
325
342
|
|
|
326
343
|
//! @brief Decrements the @c transform_output_iterator by a given number of elements
|
|
@@ -328,9 +345,10 @@ public:
|
|
|
328
345
|
_CCCL_EXEC_CHECK_DISABLE
|
|
329
346
|
_CCCL_TEMPLATE(class _Iter2 = _Iter)
|
|
330
347
|
_CCCL_REQUIRES(::cuda::std::__iter_can_minus_equal<_Iter2>)
|
|
331
|
-
_CCCL_API constexpr transform_output_iterator&
|
|
348
|
+
_CCCL_API constexpr transform_output_iterator&
|
|
349
|
+
operator-=(difference_type __n) noexcept(noexcept(::cuda::std::declval<_Iter2&>() -= __n))
|
|
332
350
|
{
|
|
333
|
-
|
|
351
|
+
__iter() -= __n;
|
|
334
352
|
return *this;
|
|
335
353
|
}
|
|
336
354
|
|
|
@@ -340,23 +358,30 @@ public:
|
|
|
340
358
|
_CCCL_EXEC_CHECK_DISABLE
|
|
341
359
|
template <class _Iter2 = _Iter>
|
|
342
360
|
[[nodiscard]] _CCCL_API friend constexpr auto
|
|
343
|
-
operator-(const transform_output_iterator& __iter,
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
361
|
+
operator-(const transform_output_iterator& __iter, difference_type __n) //
|
|
362
|
+
noexcept(::cuda::std::is_nothrow_copy_constructible_v<_Iter2>
|
|
363
|
+
&& noexcept(::cuda::std::declval<const _Iter2&>() - difference_type{}))
|
|
364
|
+
_CCCL_TRAILING_REQUIRES(transform_output_iterator)(::cuda::std::__iter_can_minus<_Iter2>)
|
|
347
365
|
{
|
|
348
|
-
return transform_output_iterator{__iter.
|
|
366
|
+
return transform_output_iterator{__iter.__iter() - __n, __iter.__func()};
|
|
349
367
|
}
|
|
350
368
|
|
|
369
|
+
template <class _Iter2>
|
|
370
|
+
static constexpr bool __can_difference =
|
|
371
|
+
(::cuda::std::__has_random_access_traversal<_Iter2> || ::cuda::std::sized_sentinel_for<_Iter2, _Iter2>);
|
|
372
|
+
|
|
373
|
+
template <class _Iter2>
|
|
374
|
+
static constexpr bool __noexcept_difference =
|
|
375
|
+
noexcept(::cuda::std::declval<const _Iter2&>() - ::cuda::std::declval<const _Iter2&>());
|
|
376
|
+
|
|
351
377
|
//! @brief Returns the distance between two @c transform_output_iterator
|
|
352
378
|
_CCCL_EXEC_CHECK_DISABLE
|
|
353
379
|
template <class _Iter2 = _Iter>
|
|
354
|
-
[[nodiscard]] _CCCL_API friend constexpr auto
|
|
355
|
-
|
|
356
|
-
noexcept(
|
|
357
|
-
_CCCL_TRAILING_REQUIRES(difference_type)(::cuda::std::sized_sentinel_for<_Iter2, _Iter2>)
|
|
380
|
+
[[nodiscard]] _CCCL_API friend constexpr auto operator-(const transform_output_iterator& __lhs,
|
|
381
|
+
const transform_output_iterator& __rhs) //
|
|
382
|
+
noexcept(__noexcept_difference<_Iter2>) _CCCL_TRAILING_REQUIRES(difference_type)(__can_difference<_Iter2>)
|
|
358
383
|
{
|
|
359
|
-
return __lhs.
|
|
384
|
+
return __lhs.__iter() - __rhs.__iter();
|
|
360
385
|
}
|
|
361
386
|
|
|
362
387
|
//! @brief Compares two @c transform_output_iterator for equality by comparing the stored iterators
|
|
@@ -367,7 +392,7 @@ public:
|
|
|
367
392
|
noexcept(::cuda::std::declval<const _Iter2&>() == ::cuda::std::declval<const _Iter2&>()))
|
|
368
393
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::equality_comparable<_Iter2>)
|
|
369
394
|
{
|
|
370
|
-
return __lhs.
|
|
395
|
+
return __lhs.__iter() == __rhs.__iter();
|
|
371
396
|
}
|
|
372
397
|
|
|
373
398
|
#if _CCCL_STD_VER <= 2017
|
|
@@ -379,7 +404,7 @@ public:
|
|
|
379
404
|
noexcept(::cuda::std::declval<const _Iter2&>() != ::cuda::std::declval<const _Iter2&>()))
|
|
380
405
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::equality_comparable<_Iter2>)
|
|
381
406
|
{
|
|
382
|
-
return __lhs.
|
|
407
|
+
return __lhs.__iter() != __rhs.__iter();
|
|
383
408
|
}
|
|
384
409
|
#endif // _CCCL_STD_VER <= 2017
|
|
385
410
|
|
|
@@ -393,7 +418,7 @@ public:
|
|
|
393
418
|
_CCCL_TRAILING_REQUIRES(bool)(
|
|
394
419
|
::cuda::std::__has_random_access_traversal<_Iter2>&& ::cuda::std::three_way_comparable<_Iter2>)
|
|
395
420
|
{
|
|
396
|
-
return __lhs.
|
|
421
|
+
return __lhs.__iter() <=> __rhs.__iter();
|
|
397
422
|
}
|
|
398
423
|
#else // ^^^ _LIBCUDACXX_HAS_SPACESHIP_OPERATOR() ^^^ / vvv !_LIBCUDACXX_HAS_SPACESHIP_OPERATOR() vvv
|
|
399
424
|
//! @brief Compares two @c transform_output_iterator for less than by comparing the stored iterators
|
|
@@ -404,7 +429,7 @@ public:
|
|
|
404
429
|
noexcept(::cuda::std::declval<const _Iter2&>() < ::cuda::std::declval<const _Iter2&>()))
|
|
405
430
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
406
431
|
{
|
|
407
|
-
return __lhs.
|
|
432
|
+
return __lhs.__iter() < __rhs.__iter();
|
|
408
433
|
}
|
|
409
434
|
|
|
410
435
|
//! @brief Compares two @c transform_output_iterator for greater than by comparing the stored iterators
|
|
@@ -415,7 +440,7 @@ public:
|
|
|
415
440
|
noexcept(::cuda::std::declval<const _Iter2&>() < ::cuda::std::declval<const _Iter2&>()))
|
|
416
441
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
417
442
|
{
|
|
418
|
-
return __lhs.
|
|
443
|
+
return __lhs.__iter() > __rhs.__iter();
|
|
419
444
|
}
|
|
420
445
|
|
|
421
446
|
//! @brief Compares two @c transform_output_iterator for less equal by comparing the stored iterators
|
|
@@ -426,7 +451,7 @@ public:
|
|
|
426
451
|
noexcept(::cuda::std::declval<const _Iter2&>() < ::cuda::std::declval<const _Iter2&>()))
|
|
427
452
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
428
453
|
{
|
|
429
|
-
return __lhs.
|
|
454
|
+
return __lhs.__iter() <= __rhs.__iter();
|
|
430
455
|
}
|
|
431
456
|
|
|
432
457
|
//! @brief Compares two @c transform_output_iterator for greater equal by comparing the stored iterators
|
|
@@ -437,7 +462,7 @@ public:
|
|
|
437
462
|
noexcept(::cuda::std::declval<const _Iter2&>() < ::cuda::std::declval<const _Iter2&>()))
|
|
438
463
|
_CCCL_TRAILING_REQUIRES(bool)(::cuda::std::__has_random_access_traversal<_Iter2>)
|
|
439
464
|
{
|
|
440
|
-
return __lhs.
|
|
465
|
+
return __lhs.__iter() >= __rhs.__iter();
|
|
441
466
|
}
|
|
442
467
|
#endif // !_LIBCUDACXX_HAS_SPACESHIP_OPERATOR()
|
|
443
468
|
};
|