Skip to content

Commit 589341d

Browse files
committed
Fix more leftovers
1 parent a5f171b commit 589341d

346 files changed

Lines changed: 1652 additions & 1669 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cpp/benchmarks/ast/polynomials.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -12,7 +12,7 @@
1212
#include <cudf/transform.hpp>
1313
#include <cudf/utilities/error.hpp>
1414

15-
#include <thrust/iterator/counting_iterator.h>
15+
#include <cuda/iterator>
1616

1717
#include <nvbench/nvbench.cuh>
1818
#include <nvbench/types.cuh>
@@ -59,8 +59,8 @@ void BM_ast_polynomials(nvbench::state& state)
5959
std::mt19937 generator;
6060
std::uniform_real_distribution<key_type> distribution{0, 1};
6161

62-
std::transform(thrust::make_counting_iterator(0),
63-
thrust::make_counting_iterator(order + 1),
62+
std::transform(cuda::counting_iterator<int>{0},
63+
cuda::counting_iterator{order + 1},
6464
std::back_inserter(constants),
6565
[&](int) { return distribution(generator); });
6666
}

cpp/benchmarks/ast/transform.cpp

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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

@@ -18,7 +18,7 @@
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");

cpp/benchmarks/binaryop/binaryop.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2020-2024, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -11,7 +11,7 @@
1111
#include <cudf/table/table_view.hpp>
1212
#include <cudf/types.hpp>
1313

14-
#include <thrust/iterator/counting_iterator.h>
14+
#include <cuda/iterator>
1515

1616
#include <nvbench/nvbench.cuh>
1717

@@ -73,10 +73,9 @@ static void BM_string_compare_binaryop_transform(nvbench::state& state)
7373
// Create table data
7474
auto const num_cols = tree_levels * 2;
7575
std::vector<std::unique_ptr<cudf::column>> columns;
76-
std::for_each(
77-
thrust::make_counting_iterator(0), thrust::make_counting_iterator(num_cols), [&](size_t) {
78-
columns.emplace_back(create_string_column(num_rows, string_width, hit_rate));
79-
});
76+
std::for_each(cuda::counting_iterator<int>{0}, cuda::counting_iterator{num_cols}, [&](size_t) {
77+
columns.emplace_back(create_string_column(num_rows, string_width, hit_rate));
78+
});
8079

8180
cudf::table table{std::move(columns)};
8281
cudf::table_view const table_view = table.view();
@@ -101,9 +100,7 @@ static void BM_string_compare_binaryop_transform(nvbench::state& state)
101100
std::unique_ptr<cudf::column> reduction =
102101
cudf::binary_operation(table.get_column(0), table.get_column(1), cmp_op, bool_type, stream);
103102
std::for_each(
104-
thrust::make_counting_iterator(1),
105-
thrust::make_counting_iterator(tree_levels),
106-
[&](size_t idx) {
103+
cuda::counting_iterator<int>{1}, cuda::counting_iterator{tree_levels}, [&](size_t idx) {
107104
std::unique_ptr<cudf::column> comparison = cudf::binary_operation(
108105
table.get_column(idx * 2), table.get_column(idx * 2 + 1), cmp_op, bool_type, stream);
109106
std::unique_ptr<cudf::column> reduced =

cpp/benchmarks/binaryop/polynomials.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -12,7 +12,7 @@
1212
#include <cudf/strings/strings_column_view.hpp>
1313
#include <cudf/types.hpp>
1414

15-
#include <thrust/iterator/counting_iterator.h>
15+
#include <cuda/iterator>
1616

1717
#include <nvbench/nvbench.cuh>
1818

@@ -43,8 +43,8 @@ static void BM_binaryop_polynomials(nvbench::state& state)
4343
std::mt19937 generator;
4444
std::uniform_real_distribution<key_type> distribution{0, 1};
4545

46-
std::transform(thrust::make_counting_iterator(0),
47-
thrust::make_counting_iterator(order + 1),
46+
std::transform(cuda::counting_iterator<int>{0},
47+
cuda::counting_iterator{order + 1},
4848
std::back_inserter(constants),
4949
[&](int) { return cudf::numeric_scalar<key_type>(distribution(generator)); });
5050
}

cpp/benchmarks/common/generate_input.cu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <rmm/device_uvector.hpp>
3535

3636
#include <cuda/functional>
37+
#include <cuda/iterator>
3738
#include <cuda/std/functional>
3839
#include <cuda/std/tuple>
3940
#include <thrust/binary_search.h>
@@ -42,7 +43,6 @@
4243
#include <thrust/fill.h>
4344
#include <thrust/for_each.h>
4445
#include <thrust/gather.h>
45-
#include <thrust/iterator/counting_iterator.h>
4646
#include <thrust/iterator/transform_iterator.h>
4747
#include <thrust/iterator/transform_output_iterator.h>
4848
#include <thrust/iterator/zip_iterator.h>
@@ -418,7 +418,7 @@ rmm::device_uvector<cudf::size_type> sample_indices_with_run_length(cudf::size_t
418418
auto const samples_indices = sample_dist(engine, approx_run_len + 1);
419419
// This is gather.
420420
auto avg_repeated_sample_indices_iterator = thrust::make_transform_iterator(
421-
thrust::make_counting_iterator(0),
421+
cuda::counting_iterator<int>{0},
422422
cuda::proclaim_return_type<cudf::size_type>(
423423
[rb = run_lens.begin(),
424424
re = run_lens.end(),
@@ -1085,8 +1085,8 @@ std::pair<rmm::device_buffer, cudf::size_type> create_random_null_mask(
10851085
} else if (*null_probability == 1.0) {
10861086
return {cudf::create_null_mask(size, cudf::mask_state::ALL_NULL), size};
10871087
} else {
1088-
return cudf::detail::valid_if(thrust::make_counting_iterator<cudf::size_type>(0),
1089-
thrust::make_counting_iterator<cudf::size_type>(size),
1088+
return cudf::detail::valid_if(cuda::counting_iterator<cudf::size_type>{0},
1089+
cuda::counting_iterator<cudf::size_type>{size},
10901090
bool_generator{seed, 1.0 - *null_probability},
10911091
cudf::get_default_stream(),
10921092
cudf::get_current_device_resource_ref());

cpp/benchmarks/common/ndsh_data_generator/random_column_generator.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
#include <rmm/exec_policy.hpp>
1818

19+
#include <cuda/iterator>
1920
#include <cuda/std/tuple>
20-
#include <thrust/iterator/counting_iterator.h>
2121
#include <thrust/random.h>
2222
#include <thrust/transform.h>
2323

@@ -116,8 +116,8 @@ std::unique_ptr<cudf::column> generate_random_numeric_column(T lower,
116116
cudf::size_type begin = 0;
117117
cudf::size_type end = num_rows;
118118
thrust::transform(rmm::exec_policy_nosync(stream),
119-
thrust::make_counting_iterator(begin),
120-
thrust::make_counting_iterator(end),
119+
cuda::counting_iterator{begin},
120+
cuda::counting_iterator{end},
121121
col->mutable_view().begin<T>(),
122122
random_number_generator<T>(lower, upper));
123123
return col;

cpp/benchmarks/contiguous_split/contiguous_split.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -10,7 +10,7 @@
1010
#include <cudf/column/column.hpp>
1111
#include <cudf/contiguous_split.hpp>
1212

13-
#include <thrust/iterator/counting_iterator.h>
13+
#include <cuda/iterator>
1414

1515
#include <nvbench/nvbench.cuh>
1616

@@ -44,7 +44,7 @@ void contiguous_split_common(nvbench::state& state,
4444
if (num_splits > 0) {
4545
cudf::size_type const split_stride = num_rows / num_splits;
4646
// start after the first element.
47-
auto iter = thrust::make_counting_iterator(1);
47+
auto iter = cuda::counting_iterator<int>{1};
4848
splits.reserve(num_splits);
4949
std::transform(iter,
5050
iter + num_splits,

cpp/benchmarks/filter/minmax_filter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#include <rmm/cuda_stream_view.hpp>
1717

18+
#include <cuda/iterator>
19+
1820
#include <nvbench/nvbench.cuh>
1921
#include <nvbench/types.cuh>
2022

@@ -69,8 +71,8 @@ void BM_filter_min_max(nvbench::state& state)
6971
profile.set_null_probability(nullable ? std::optional{0.3} : std::nullopt);
7072

7173
std::vector<std::unique_ptr<cudf::column>> filter_columns;
72-
std::transform(thrust::make_counting_iterator(0),
73-
thrust::make_counting_iterator(num_filter_columns),
74+
std::transform(cuda::counting_iterator<int>{0},
75+
cuda::counting_iterator{num_filter_columns},
7476
std::back_inserter(filter_columns),
7577
[&](auto) {
7678
return create_random_column(

cpp/benchmarks/interop/interop.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -10,7 +10,7 @@
1010

1111
#include <cudf/interop.hpp>
1212

13-
#include <thrust/iterator/counting_iterator.h>
13+
#include <cuda/iterator>
1414

1515
#include <nanoarrow/nanoarrow.hpp>
1616
#include <nanoarrow/nanoarrow_device.h>
@@ -81,8 +81,8 @@ void BM_from_arrow_device(nvbench::state& state, nvbench::type_list<nvbench::enu
8181

8282
std::vector<cudf::column_metadata> table_metadata;
8383

84-
std::transform(thrust::make_counting_iterator(0),
85-
thrust::make_counting_iterator(num_columns),
84+
std::transform(cuda::counting_iterator<int>{0},
85+
cuda::counting_iterator{num_columns},
8686
std::back_inserter(table_metadata),
8787
[&](auto const column) {
8888
cudf::column_metadata column_metadata{""};
@@ -123,8 +123,8 @@ void BM_from_arrow_host(nvbench::state& state, nvbench::type_list<nvbench::enum_
123123

124124
std::vector<cudf::column_metadata> table_metadata;
125125

126-
std::transform(thrust::make_counting_iterator(0),
127-
thrust::make_counting_iterator(num_columns),
126+
std::transform(cuda::counting_iterator<int>{0},
127+
cuda::counting_iterator{num_columns},
128128
std::back_inserter(table_metadata),
129129
[&](auto const column) {
130130
cudf::column_metadata column_metadata{""};

cpp/benchmarks/io/parquet/experimental/deletion_vectors/parquet_deletion_vectors.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <cudf/io/experimental/deletion_vectors.hpp>
1212
#include <cudf/utilities/default_stream.hpp>
1313

14+
#include <cuda/iterator>
15+
1416
#include <nvbench/nvbench.cuh>
1517
#include <roaring/roaring64.h>
1618

@@ -68,7 +70,7 @@ auto build_row_indices(cudf::host_span<size_t const> row_group_offsets,
6870

6971
// Inclusive scan to compute the rest of the expected row indices
7072
std::for_each(
71-
thrust::counting_iterator(0), thrust::counting_iterator(num_row_groups), [&](auto i) {
73+
cuda::counting_iterator<int>{0}, cuda::counting_iterator{num_row_groups}, [&](auto i) {
7274
auto start_row_index = row_group_span_offsets[i];
7375
auto end_row_index = row_group_span_offsets[i + 1];
7476
thrust::inclusive_scan(expected_row_indices.begin() + start_row_index,
@@ -112,8 +114,8 @@ auto build_deletion_vector(cudf::host_span<size_t const> row_group_offsets,
112114
auto roaring64_context =
113115
roaring64_bulk_context_t{.high_bytes = {0, 0, 0, 0, 0, 0}, .leaf = nullptr};
114116

115-
std::for_each(thrust::counting_iterator<size_t>(0),
116-
thrust::counting_iterator<size_t>(num_rows),
117+
std::for_each(cuda::counting_iterator<size_t>{0},
118+
cuda::counting_iterator<size_t>{num_rows},
117119
[&](auto row_idx) {
118120
// Insert provided host row index if the row is deleted in the row mask
119121
if (not input_row_mask[row_idx]) {
@@ -161,8 +163,8 @@ auto setup_table_and_deletion_vector(nvbench::state& state)
161163
auto row_group_offsets = std::vector<size_t>(num_row_groups);
162164
row_group_offsets[0] = static_cast<size_t>(std::llround(2e9));
163165
std::for_each(
164-
thrust::counting_iterator<size_t>(1),
165-
thrust::counting_iterator<size_t>(num_row_groups),
166+
cuda::counting_iterator<size_t>{1},
167+
cuda::counting_iterator<size_t>{num_row_groups},
166168
[&](auto i) { row_group_offsets[i] = std::llround(row_group_offsets[i - 1] + 0.5e9); });
167169

168170
// Row group splits

0 commit comments

Comments
 (0)