2323#include < rmm/device_vector.hpp>
2424#include < rmm/exec_policy.hpp>
2525
26+ #include < cuda/iterator>
2627#include < thrust/device_vector.h>
2728#include < thrust/execution_policy.h>
2829#include < thrust/for_each.h>
29- #include < thrust/iterator/counting_iterator.h>
3030#include < thrust/sequence.h>
3131
3232#include < gtest/gtest.h>
@@ -51,7 +51,7 @@ void test_mdspan()
5151 thrust::device_vector<int32_t > status (1 , 0 );
5252 auto p_status = status.data ().get ();
5353 thrust::for_each_n (
54- rmm::exec_policy (stream), thrust ::make_counting_iterator (0ul ), 4 , [=] __device__ (size_t i) {
54+ rmm::exec_policy (stream), cuda ::make_counting_iterator (0ul ), 4 , [=] __device__ (size_t i) {
5555 auto v = span (0 , i);
5656 if (v != i) { raft::myAtomicAdd (p_status, 1 ); }
5757 auto k = cuda::std::submdspan (span, 0 , cuda::std::full_extent);
@@ -101,7 +101,7 @@ void test_mdarray_basic()
101101 thrust::device_vector<int32_t > status (1 , 0 );
102102 auto p_status = status.data ().get ();
103103 thrust::for_each_n (rmm::exec_policy (s),
104- thrust ::make_counting_iterator (0ul ),
104+ cuda ::make_counting_iterator (0ul ),
105105 1 ,
106106 [d_view, p_status] __device__ (auto i) {
107107 if (d_view (0 , 3 ) != 1 ) { myAtomicAdd (p_status, 1 ); }
@@ -115,7 +115,7 @@ void test_mdarray_basic()
115115 ASSERT_EQ (arr (0 , 3 ), 1 );
116116 auto const_d_view = arr.view ();
117117 thrust::for_each_n (rmm::exec_policy (s),
118- thrust ::make_counting_iterator (0ul ),
118+ cuda ::make_counting_iterator (0ul ),
119119 1 ,
120120 [const_d_view, p_status] __device__ (auto i) {
121121 if (const_d_view (0 , 3 ) != 1 ) { myAtomicAdd (p_status, 1 ); }
@@ -162,7 +162,7 @@ void test_mdarray_basic()
162162 ASSERT_EQ (array (0 , 3 ), 1 );
163163 auto h_view = array.view ();
164164 static_assert (decltype (h_view)::accessor_type::is_host_type::value);
165- thrust::for_each_n (thrust::host, thrust ::make_counting_iterator (0ul ), 1 , [h_view](auto i) {
165+ thrust::for_each_n (thrust::host, cuda ::make_counting_iterator (0ul ), 1 , [h_view](auto i) {
166166 ASSERT_EQ (h_view (0 , 3 ), 1 );
167167 });
168168 }
@@ -359,7 +359,7 @@ void test_factory_methods()
359359 thrust::device_vector<int32_t > status (1 , 0 );
360360 auto p_status = status.data ().get ();
361361 thrust::for_each_n (rmm::exec_policy (resource::get_cuda_stream (handle)),
362- thrust ::make_counting_iterator (0 ),
362+ cuda ::make_counting_iterator (0 ),
363363 1 ,
364364 [=] __device__ (auto i) {
365365 if (view (i) != 17.0 ) { myAtomicAdd (p_status, 1 ); }
@@ -518,7 +518,7 @@ void test_mdarray_padding()
518518 thrust::device_vector<int32_t > status (1 , 0 );
519519 auto p_status = status.data ().get ();
520520 thrust::for_each_n (rmm::exec_policy (),
521- thrust ::make_counting_iterator (0ul ),
521+ cuda ::make_counting_iterator (0ul ),
522522 1 ,
523523 [d_view, p_status] __device__ (size_t i) {
524524 if (d_view (0 , 3 ) != 1 ) { myAtomicAdd (p_status, 1 ); }
@@ -532,7 +532,7 @@ void test_mdarray_padding()
532532 ASSERT_EQ (arr (0 , 3 ), 1 );
533533 auto const_d_view = arr.view ();
534534 thrust::for_each_n (rmm::exec_policy (s),
535- thrust ::make_counting_iterator (0ul ),
535+ cuda ::make_counting_iterator (0ul ),
536536 1 ,
537537 [const_d_view, p_status] __device__ (size_t i) {
538538 if (const_d_view (0 , 3 ) != 1 ) { myAtomicAdd (p_status, 1 ); }
@@ -542,7 +542,7 @@ void test_mdarray_padding()
542542 // initialize with sequence
543543 thrust::for_each_n (
544544 rmm::exec_policy (s),
545- thrust ::make_counting_iterator (0ul ),
545+ cuda ::make_counting_iterator (0ul ),
546546 rows * cols,
547547 [d_view, rows, cols] __device__ (size_t i) { d_view (i / cols, i % cols) = i; });
548548
@@ -552,7 +552,7 @@ void test_mdarray_padding()
552552 using padded_mdspan_type = device_mdspan<float , extents_type, padded_layout_row_major>;
553553 auto padded_span = padded_mdspan_type (data_padded, layout);
554554 thrust::for_each_n (rmm::exec_policy (s),
555- thrust ::make_counting_iterator (0ul ),
555+ cuda ::make_counting_iterator (0ul ),
556556 rows * cols,
557557 [padded_span, rows, cols, p_status] __device__ (size_t i) {
558558 if (padded_span (i / cols, i % cols) != i) myAtomicAdd (p_status, 1 );
@@ -608,7 +608,7 @@ TEST(MDArray, Padding) { test_mdarray_padding(); }
608608 static_assert(std::is_same_v<typename decltype(d_view)::layout_type, layout_padded_general>);
609609 thrust::for_each_n(
610610 rmm::exec_policy(s),
611- thrust ::make_counting_iterator(0ul),
611+ cuda ::make_counting_iterator(0ul),
612612 rows * cols,
613613 [d_view, rows, cols] __device__(size_t i) { d_view(i / cols, i % cols) = i; });
614614 }
@@ -618,7 +618,7 @@ TEST(MDArray, Padding) { test_mdarray_padding(); }
618618 auto data_padded = padded_device_array.data();
619619 auto padded_span = padded_mdspan_type(data_padded, layout);
620620 thrust::for_each_n(rmm::exec_policy(s),
621- thrust ::make_counting_iterator(0ul),
621+ cuda ::make_counting_iterator(0ul),
622622 rows * cols,
623623 [padded_span, rows, cols, p_status] __device__(size_t i) {
624624 if (padded_span(i / cols, i % cols) != i) myAtomicAdd(p_status, 1);
@@ -631,7 +631,7 @@ TEST(MDArray, Padding) { test_mdarray_padding(); }
631631 auto padded_span = padded_device_array.view();
632632 auto subspan_full = stdex::submdspan(padded_span, stdex::full_extent, stdex::full_extent);
633633 thrust::for_each_n(rmm::exec_policy(s),
634- thrust ::make_counting_iterator(0ul),
634+ cuda ::make_counting_iterator(0ul),
635635 cols * rows,
636636 [subspan_full, padded_span, rows, cols, p_status] __device__(size_t i) {
637637 if (subspan_full(i / cols, i % cols) != padded_span(i / cols, i % cols))
@@ -649,7 +649,7 @@ TEST(MDArray, Padding) { test_mdarray_padding(); }
649649 auto padded_span = padded_device_array.view();
650650 auto row3 = stdex::submdspan(padded_span, 3, stdex::full_extent);
651651 thrust::for_each_n(rmm::exec_policy(s),
652- thrust ::make_counting_iterator(0ul),
652+ cuda ::make_counting_iterator(0ul),
653653 cols,
654654 [row3, padded_span, p_status] __device__(size_t i) {
655655 if (row3(i) != padded_span(3, i)) myAtomicAdd(p_status, 1);
@@ -665,7 +665,7 @@ TEST(MDArray, Padding) { test_mdarray_padding(); }
665665 auto padded_span = padded_device_array.view();
666666 auto col1 = stdex::submdspan(padded_span, stdex::full_extent, 1);
667667 thrust::for_each_n(rmm::exec_policy(s),
668- thrust ::make_counting_iterator(0ul),
668+ cuda ::make_counting_iterator(0ul),
669669 rows,
670670 [col1, padded_span, p_status] __device__(size_t i) {
671671 if (col1(i) != padded_span(i, 1)) myAtomicAdd(p_status, 1);
@@ -682,7 +682,7 @@ TEST(MDArray, Padding) { test_mdarray_padding(); }
682682 auto subspan =
683683 stdex::submdspan(padded_span, std::make_tuple(1ul, 4ul), std::make_tuple(2ul, 5ul));
684684 thrust::for_each_n(rmm::exec_policy(s),
685- thrust ::make_counting_iterator(0ul),
685+ cuda ::make_counting_iterator(0ul),
686686 (rows - 1) * (cols - 2),
687687 [subspan, rows, cols, padded_span, p_status] __device__(size_t i) {
688688 size_t idx = i / (cols - 2);
@@ -703,7 +703,7 @@ TEST(MDArray, Padding) { test_mdarray_padding(); }
703703 auto subspan =
704704 stdex::submdspan(padded_span, std::make_tuple(1ul, 4ul), std::make_tuple(2ul, 5ul));
705705 thrust::for_each_n(rmm::exec_policy(s),
706- thrust ::make_counting_iterator(0ul),
706+ cuda ::make_counting_iterator(0ul),
707707 (rows - 1) * (cols - 2),
708708 [subspan, rows, cols, padded_span, p_status] __device__(size_t i) {
709709 size_t idx = i / (cols - 2);
@@ -756,7 +756,7 @@ void test_mdspan_padding_by_type()
756756 auto padded_span = padded_device_array.view ();
757757 thrust::for_each_n (
758758 rmm::exec_policy (s),
759- thrust ::make_counting_iterator (0ul ),
759+ cuda ::make_counting_iterator (0ul ),
760760 rows * cols,
761761 [rows, cols, padded_span, alignment_elements, p_status] __device__ (size_t i) {
762762 size_t idx = i / cols;
@@ -783,7 +783,7 @@ void test_mdspan_padding_by_type()
783783 auto padded_span = padded_device_array.view ();
784784 thrust::for_each_n (
785785 rmm::exec_policy (s),
786- thrust ::make_counting_iterator (0ul ),
786+ cuda ::make_counting_iterator (0ul ),
787787 rows * cols,
788788 [rows, cols, padded_span, alignment_elements, p_status] __device__ (size_t i) {
789789 size_t idx = i / cols;
@@ -843,7 +843,7 @@ void test_mdspan_aligned_matrix()
843843 thrust::device_vector<int32_t > status (1 , 0 );
844844 auto p_status = status.data ().get ();
845845 thrust::for_each_n (rmm::exec_policy (s),
846- thrust ::make_counting_iterator (0ul ),
846+ cuda ::make_counting_iterator (0ul ),
847847 rows * cols,
848848 [rows, cols, my_aligned_device_span, p_status] __device__ (size_t i) {
849849 size_t idx = i / cols;
@@ -922,7 +922,7 @@ void test_mdarray_unravel()
922922 auto m = make_device_matrix<float , size_t >(handle, 7 , 6 );
923923 auto m_v = m.view ();
924924 thrust::for_each_n (resource::get_thrust_policy (handle),
925- thrust ::make_counting_iterator (0ul ),
925+ cuda ::make_counting_iterator (0ul ),
926926 m_v.size (),
927927 [=] HD (size_t i) {
928928 auto coord =
@@ -932,7 +932,7 @@ void test_mdarray_unravel()
932932 thrust::device_vector<int32_t > status (1 , 0 );
933933 auto p_status = status.data ().get ();
934934 thrust::for_each_n (resource::get_thrust_policy (handle),
935- thrust ::make_counting_iterator (0ul ),
935+ cuda ::make_counting_iterator (0ul ),
936936 m_v.size (),
937937 [=] __device__ (size_t i) {
938938 auto coord =
0 commit comments