Skip to content

Commit aef94f5

Browse files
committed
Merge remote-tracking branch 'upstream' into worktree-fix-docs
2 parents 9ecfebc + f517bbb commit aef94f5

76 files changed

Lines changed: 454 additions & 494 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.

README.md

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

benchmarks/benchmark_utils.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
2+
* Copyright (c) 2023-2026, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,8 +21,7 @@
2121

2222
#include <nvbench/nvbench.cuh>
2323

24-
#include <thrust/iterator/iterator_traits.h>
25-
#include <thrust/iterator/tabulate_output_iterator.h>
24+
#include <cuda/iterator>
2625

2726
#include <nv/target>
2827

@@ -75,13 +74,13 @@ struct lazy_discard {
7574
};
7675

7776
/**
78-
* @brief An output iterator similar to `thrust::discard_iterator` but prevents the write from being
77+
* @brief An output iterator similar to `cuda::discard_iterator` but prevents the write from being
7978
* optimized out by the compiler.
8079
*/
8180
template <class OutputIt>
8281
auto make_lazy_discard_iterator(OutputIt it)
8382
{
84-
return thrust::tabulate_output_iterator(lazy_discard<OutputIt>{it});
83+
return cuda::make_tabulate_output_iterator(lazy_discard<OutputIt>{it});
8584
}
8685

8786
} // namespace cuco::benchmark

benchmarks/bloom_filter/add_bench.cu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2026, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,8 +24,8 @@
2424

2525
#include <nvbench/nvbench.cuh>
2626

27+
#include <cuda/iterator>
2728
#include <cuda/std/limits>
28-
#include <thrust/iterator/counting_iterator.h>
2929

3030
#include <cstdint>
3131
#include <exception>
@@ -67,7 +67,7 @@ void bloom_filter_add(nvbench::state& state,
6767
state.skip("num_sub_filters too large for size_type"); // skip invalid configurations
6868
}
6969

70-
thrust::counting_iterator<Key> keys(0);
70+
cuda::counting_iterator<Key> keys(0);
7171

7272
state.add_element_count(num_keys);
7373

@@ -108,7 +108,7 @@ void arrow_bloom_filter_add(nvbench::state& state, nvbench::type_list<Key, Dist>
108108
// configurations
109109
}
110110

111-
thrust::counting_iterator<Key> keys(0);
111+
cuda::counting_iterator<Key> keys(0);
112112

113113
state.add_element_count(num_keys);
114114

benchmarks/bloom_filter/contains_bench.cu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2026, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@
2424

2525
#include <nvbench/nvbench.cuh>
2626

27+
#include <cuda/iterator>
2728
#include <cuda/std/limits>
2829
#include <thrust/device_vector.h>
29-
#include <thrust/iterator/counting_iterator.h>
3030

3131
#include <exception>
3232
#include <limits>
@@ -73,7 +73,7 @@ void bloom_filter_contains(
7373
state.skip("num_sub_filters too large for size_type"); // skip invalid configurations
7474
}
7575

76-
thrust::counting_iterator<Key> keys(0);
76+
cuda::counting_iterator<Key> keys(0);
7777
thrust::device_vector<bool> result(num_keys, false);
7878

7979
state.add_element_count(num_keys);
@@ -119,7 +119,7 @@ void arrow_bloom_filter_contains(nvbench::state& state, nvbench::type_list<Key,
119119
// configurations
120120
}
121121

122-
thrust::counting_iterator<Key> keys(0);
122+
cuda::counting_iterator<Key> keys(0);
123123
thrust::device_vector<bool> result(num_keys, false);
124124

125125
state.add_element_count(num_keys);

benchmarks/hyperloglog/hyperloglog_bench.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2026, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,8 +24,8 @@
2424
#include <nvbench/nvbench.cuh>
2525

2626
#include <cuda/functional>
27+
#include <cuda/iterator>
2728
#include <thrust/device_vector.h>
28-
#include <thrust/iterator/transform_iterator.h>
2929

3030
#include <cmath>
3131
#include <cstddef>
@@ -40,7 +40,7 @@ template <typename InputIt>
4040
// Casting is valid since the keys generated are representable in int64_t.
4141
using T = std::int64_t;
4242

43-
auto cast_iter = thrust::make_transform_iterator(
43+
auto cast_iter = cuda::make_transform_iterator(
4444
first, cuda::proclaim_return_type<T>([] __device__(auto i) { return static_cast<T>(i); }));
4545

4646
auto set = cuco::static_set{n, 0.8, cuco::empty_key<T>{-1}};

benchmarks/static_multiset/retrieve_bench.cu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2026, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
2222

2323
#include <nvbench/nvbench.cuh>
2424

25+
#include <cuda/iterator>
2526
#include <thrust/device_vector.h>
2627
#include <thrust/transform.h>
2728

@@ -54,7 +55,7 @@ void static_multiset_retrieve(nvbench::state& state, nvbench::type_list<Key, Dis
5455

5556
auto const output_size = set.count(keys.begin(), keys.end());
5657
thrust::device_vector<Key> output_match(output_size);
57-
auto output_probe_begin = thrust::discard_iterator{};
58+
auto output_probe_begin = cuda::discard_iterator{};
5859

5960
state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) {
6061
set.retrieve(

benchmarks/static_set/retrieve_bench.cu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2026, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
2222

2323
#include <nvbench/nvbench.cuh>
2424

25+
#include <cuda/iterator>
2526
#include <thrust/device_vector.h>
2627
#include <thrust/transform.h>
2728

@@ -54,7 +55,7 @@ void static_set_retrieve(nvbench::state& state, nvbench::type_list<Key, Dist>)
5455

5556
auto const output_size = set.count(keys.begin(), keys.end());
5657
thrust::device_vector<Key> output_match(output_size);
57-
auto output_probe_begin = thrust::discard_iterator{};
58+
auto output_probe_begin = cuda::discard_iterator{};
5859

5960
state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) {
6061
set.retrieve(

examples/static_map/count_by_key_example.cu

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
2+
* Copyright (c) 2023-2026, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
1717
#include <cuco/static_map.cuh>
1818

1919
#include <cub/block/block_reduce.cuh>
20+
#include <cuda/iterator>
2021
#include <cuda/std/atomic>
2122
#include <cuda/std/functional>
2223
#include <thrust/device_vector.h>
@@ -113,8 +114,8 @@ int main(void)
113114
thrust::device_vector<Key> insert_keys(num_keys);
114115
// Create a sequence of keys. Eeach distinct key has key_duplicates many matches.
115116
thrust::transform(
116-
thrust::make_counting_iterator<Key>(0),
117-
thrust::make_counting_iterator<Key>(insert_keys.size()),
117+
cuda::make_counting_iterator<Key>(0),
118+
cuda::make_counting_iterator<Key>(insert_keys.size()),
118119
insert_keys.begin(),
119120
[] __device__(auto i) -> Key { return static_cast<Key>(i % (num_keys / key_duplicates)); });
120121

examples/static_map/custom_type_example.cu

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2021-2026, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,9 +17,8 @@
1717
#include <cuco/static_map.cuh>
1818

1919
#include <cuda/functional>
20+
#include <cuda/iterator>
2021
#include <thrust/device_vector.h>
21-
#include <thrust/iterator/counting_iterator.h>
22-
#include <thrust/iterator/transform_iterator.h>
2322
#include <thrust/logical.h>
2423
#include <thrust/transform.h>
2524

@@ -63,8 +62,8 @@ int main(void)
6362
auto const empty_value_sentinel = custom_value_type{-1};
6463

6564
// Create an iterator of input key/value pairs
66-
auto pairs_begin = thrust::make_transform_iterator(
67-
thrust::make_counting_iterator<int32_t>(0),
65+
auto pairs_begin = cuda::make_transform_iterator(
66+
cuda::make_counting_iterator<int32_t>(0),
6867
cuda::proclaim_return_type<cuco::pair<custom_key_type, custom_value_type>>(
6968
[] __device__(auto i) { return cuco::pair{custom_key_type{i}, custom_value_type{i}}; }));
7069

@@ -81,9 +80,9 @@ int main(void)
8180

8281
// Reproduce inserted keys
8382
auto insert_keys =
84-
thrust::make_transform_iterator(thrust::make_counting_iterator<int32_t>(0),
85-
cuda::proclaim_return_type<custom_key_type>(
86-
[] __device__(auto i) { return custom_key_type{i}; }));
83+
cuda::make_transform_iterator(cuda::make_counting_iterator<int32_t>(0),
84+
cuda::proclaim_return_type<custom_key_type>(
85+
[] __device__(auto i) { return custom_key_type{i}; }));
8786

8887
thrust::device_vector<bool> contained(num_pairs);
8988

examples/static_map/heterogeneous_lookup_example.cu

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025, NVIDIA CORPORATION.
2+
* Copyright (c) 2025-2026, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,12 +17,11 @@
1717
#include <cuco/static_map.cuh>
1818

1919
#include <cuda/functional>
20+
#include <cuda/iterator>
2021
#include <cuda/std/tuple>
2122
#include <thrust/detail/raw_reference_cast.h>
2223
#include <thrust/device_vector.h>
2324
#include <thrust/host_vector.h>
24-
#include <thrust/iterator/counting_iterator.h>
25-
#include <thrust/iterator/transform_iterator.h>
2625

2726
#include <iostream>
2827

@@ -103,8 +102,8 @@ int main()
103102
};
104103
thrust::device_vector<value_type> d_values = {36.5f, 41.2f, 27.1f, 33.8f};
105104

106-
auto pairs_begin = thrust::make_transform_iterator(
107-
thrust::counting_iterator{0},
105+
auto pairs_begin = cuda::make_transform_iterator(
106+
cuda::counting_iterator{0},
108107
cuda::proclaim_return_type<cuco::pair<stored_key, value_type>>(
109108
[keys = d_keys.begin(), values = d_values.begin()] __device__(int i) {
110109
return cuco::pair<stored_key, value_type>{keys[i], values[i]};

0 commit comments

Comments
 (0)