11/*
2- * SPDX-FileCopyrightText: Copyright (c) 2020-2025 , NVIDIA CORPORATION.
2+ * SPDX-FileCopyrightText: Copyright (c) 2020-2026 , NVIDIA CORPORATION.
33 * SPDX-License-Identifier: Apache-2.0
44 */
55
1818
1919#include < rmm/cuda_stream_view.hpp>
2020
21- #include < thrust /iterator/counting_iterator.h >
21+ #include < cuda /iterator>
2222
2323#include < nvbench/nvbench.cuh>
2424#include < nvbench/types.cuh>
@@ -70,9 +70,9 @@ static void BM_ast_transform(nvbench::state& state)
7070
7171 // Create column references
7272 std::for_each (
73- thrust::make_counting_iterator ( 0 ),
74- thrust::make_counting_iterator (num_columns),
75- [&]( int column_id) { tree. push ( cudf::ast::column_reference (reuse_columns ? 0 : column_id)); });
73+ cuda::counting_iterator< int >{ 0 }, cuda::counting_iterator{num_columns}, [&]( int column_id) {
74+ tree. push ( cudf::ast::column_reference (reuse_columns ? 0 : column_id));
75+ });
7676
7777 // Create expression trees
7878
@@ -86,9 +86,9 @@ static void BM_ast_transform(nvbench::state& state)
8686 } else {
8787 tree.push (cudf::ast::operation (op, tree.at (0 ), tree.at (1 )));
8888 std::for_each (
89- thrust::make_counting_iterator ( 2 ),
90- thrust::make_counting_iterator (num_columns),
91- [&]( int col_id) { tree. push ( cudf::ast::operation (op, tree. back (), tree. at (col_id))); });
89+ cuda::counting_iterator< int >{ 2 }, cuda::counting_iterator{num_columns}, [&]( int col_id) {
90+ tree. push ( cudf::ast::operation (op, tree. back (), tree. at (col_id)));
91+ });
9292 }
9393
9494 auto const & root_expression = tree.back ();
@@ -126,10 +126,9 @@ static void BM_string_compare_ast_transform(nvbench::state& state)
126126 // Create table data
127127 auto const num_columns = tree_levels * 2 ;
128128 std::vector<std::unique_ptr<cudf::column>> columns;
129- std::for_each (
130- thrust::make_counting_iterator (0 ), thrust::make_counting_iterator (num_columns), [&](size_t ) {
131- columns.emplace_back (create_string_column (num_rows, string_width, hit_rate));
132- });
129+ std::for_each (cuda::counting_iterator<int >{0 }, cuda::counting_iterator{num_columns}, [&](size_t ) {
130+ columns.emplace_back (create_string_column (num_rows, string_width, hit_rate));
131+ });
133132
134133 cudf::table table{std::move (columns)};
135134 cudf::table_view const table_view = table.view ();
@@ -146,22 +145,20 @@ static void BM_string_compare_ast_transform(nvbench::state& state)
146145 cudf::ast::tree tree;
147146
148147 // Create column references
149- std::for_each (thrust::make_counting_iterator ( 0 ) ,
150- thrust::make_counting_iterator ( num_columns) ,
148+ std::for_each (cuda::counting_iterator< int >{ 0 } ,
149+ cuda::counting_iterator{ num_columns} ,
151150 [&](int column_id) { tree.push (cudf::ast::column_reference{column_id}); });
152151
153152 // Construct AST tree (a == b && c == d && e == f && ...)
154153
155154 tree.push (cudf::ast::operation (cmp_op, tree[0 ], tree[1 ]));
156155
157- std::for_each (thrust::make_counting_iterator (1 ),
158- thrust::make_counting_iterator (tree_levels),
159- [&](size_t idx) {
160- auto const & lhs = tree.back ();
161- auto const & rhs =
162- tree.push (cudf::ast::operation (cmp_op, tree[idx * 2 ], tree[idx * 2 + 1 ]));
163- tree.push (cudf::ast::operation (reduce_op, lhs, rhs));
164- });
156+ std::for_each (
157+ cuda::counting_iterator<int >{1 }, cuda::counting_iterator{tree_levels}, [&](size_t idx) {
158+ auto const & lhs = tree.back ();
159+ auto const & rhs = tree.push (cudf::ast::operation (cmp_op, tree[idx * 2 ], tree[idx * 2 + 1 ]));
160+ tree.push (cudf::ast::operation (reduce_op, lhs, rhs));
161+ });
165162
166163 // Use the number of bytes read from global memory
167164 state.add_element_count (chars_size, " chars_size" );
0 commit comments