Skip to content

Commit 30b593f

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into cccl-utilities
2 parents 31f56aa + aceb666 commit 30b593f

39 files changed

+90
-78
lines changed

README.md

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

ci/build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,16 @@ while [ "${#args[@]}" -ne 0 ]; do
131131
esac
132132
done
133133

134+
if [ $VERBOSE ]; then
135+
set -x
136+
fi
137+
134138
# Convert to full paths:
135139
HOST_COMPILER=$(which ${HOST_COMPILER})
136140
CUDA_COMPILER=$(which ${CUDA_COMPILER})
137141
# Make CUDA arch list compatible with cmake
138142
CUDA_ARCHS=$(echo "$CUDA_ARCHS" | tr ' ,' ';;')
139143

140-
if [ $VERBOSE ]; then
141-
set -x
142-
fi
143-
144144
# Begin processing unsets after option parsing
145145
set -u
146146

@@ -217,4 +217,4 @@ if command -v sccache >/dev/null; then
217217
source "./sccache_stats.sh" end
218218
else
219219
echo "sccache stats: N/A"
220-
fi
220+
fi

examples/static_map/count_by_key_example.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
#include <cub/block/block_reduce.cuh>
2020
#include <cuda/std/atomic>
21+
#include <cuda/std/functional>
2122
#include <thrust/device_vector.h>
22-
#include <thrust/logical.h>
2323
#include <thrust/transform.h>
2424

2525
#include <cmath>

examples/static_map/device_ref_example.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
#include <cuco/static_map.cuh>
1818

19+
#include <cuda/std/functional>
1920
#include <thrust/device_vector.h>
2021
#include <thrust/execution_policy.h>
2122
#include <thrust/iterator/zip_iterator.h>
22-
#include <thrust/logical.h>
2323
#include <thrust/sequence.h>
2424
#include <thrust/tuple.h>
2525

examples/static_set/device_subsets_example.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <cuco/storage.cuh>
1919

2020
#include <cuda/std/array>
21+
#include <cuda/std/functional>
2122
#include <thrust/device_vector.h>
2223
#include <thrust/reduce.h>
2324
#include <thrust/scan.h>

examples/static_set/shared_memory_example.cu

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

1717
#include <cuco/static_set.cuh>
1818

19+
#include <cuda/std/functional>
20+
1921
#include <cooperative_groups.h>
2022

2123
/**

include/cuco/detail/dynamic_map_kernels.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ CUCO_KERNEL void find(InputIt first,
389389
auto submap_view = submap_views[i];
390390
auto found = submap_view.find(key, hash, key_equal);
391391
if (found != submap_view.end()) {
392-
found_value = found->second;
392+
found_value = found->second.load(cuda::std::memory_order_relaxed);
393393
break;
394394
}
395395
}
@@ -466,7 +466,7 @@ CUCO_KERNEL void find(InputIt first,
466466
auto submap_view = submap_views[i];
467467
auto found = submap_view.find(tile, key, hash, key_equal);
468468
if (found != submap_view.end()) {
469-
found_value = found->second;
469+
found_value = found->second.load(cuda::std::memory_order_relaxed);
470470
break;
471471
}
472472
}

include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <cuda/std/functional>
2828
#include <cuda/std/iterator>
2929
#include <cuda/std/type_traits>
30-
#include <thrust/distance.h>
3130
#include <thrust/execution_policy.h>
3231
#include <thrust/logical.h>
3332
#include <thrust/reduce.h>
@@ -395,7 +394,7 @@ class open_addressing_ref_impl {
395394
if (eq_res == detail::equal_result::EQUAL) { return false; }
396395
}
397396
if (eq_res == detail::equal_result::AVAILABLE) {
398-
auto const intra_bucket_index = thrust::distance(bucket_slots.begin(), &slot_content);
397+
auto const intra_bucket_index = cuda::std::distance(bucket_slots.begin(), &slot_content);
399398
switch (attempt_insert((storage_ref_.data() + *probing_iter)->data() + intra_bucket_index,
400399
slot_content,
401400
val)) {
@@ -701,7 +700,7 @@ class open_addressing_ref_impl {
701700
if (eq_res == detail::equal_result::EMPTY) { return false; }
702701
// Key exists, return true if successfully deleted
703702
if (eq_res == detail::equal_result::EQUAL) {
704-
auto const intra_bucket_index = thrust::distance(bucket_slots.begin(), &slot_content);
703+
auto const intra_bucket_index = cuda::std::distance(bucket_slots.begin(), &slot_content);
705704
switch (attempt_insert_stable(
706705
(storage_ref_.data() + *probing_iter)->data() + intra_bucket_index,
707706
slot_content,

include/cuco/detail/static_map/static_map_ref.inl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <cuco/operator.hpp>
2222

2323
#include <cuda/atomic>
24+
#include <cuda/std/iterator>
2425
#include <cuda/std/type_traits>
2526
#include <cuda/std/utility>
2627

@@ -505,7 +506,7 @@ class operator_impl<
505506
for (auto& slot_content : bucket_slots) {
506507
auto const eq_res =
507508
ref_.impl_.predicate_.operator()<is_insert::YES>(key, slot_content.first);
508-
auto const intra_bucket_index = thrust::distance(bucket_slots.begin(), &slot_content);
509+
auto const intra_bucket_index = cuda::std::distance(bucket_slots.begin(), &slot_content);
509510
auto slot_ptr = (storage_ref.data() + *probing_iter)->data() + intra_bucket_index;
510511

511512
// If the key is already in the container, update the payload and return
@@ -875,7 +876,7 @@ class operator_impl<
875876
for (auto& slot_content : bucket_slots) {
876877
auto const eq_res =
877878
ref_.impl_.predicate_.operator()<is_insert::YES>(key, slot_content.first);
878-
auto const intra_bucket_index = thrust::distance(bucket_slots.begin(), &slot_content);
879+
auto const intra_bucket_index = cuda::std::distance(bucket_slots.begin(), &slot_content);
879880
auto slot_ptr = (storage_ref.data() + *probing_iter)->data() + intra_bucket_index;
880881

881882
// If the key is already in the container, update the payload and return

include/cuco/utility/key_generator.cuh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include <cuda/std/cmath>
2424
#include <cuda/std/functional> // TODO include <cuda/std/algorithm> instead once available
25+
#include <cuda/std/iterator>
2526
#include <cuda/std/limits>
2627
#include <cuda/std/span>
2728
#include <thrust/device_vector.h>
@@ -284,7 +285,7 @@ class key_generator {
284285
thrust::sequence(exec_policy, out_begin, out_end, value_type{0});
285286
thrust::shuffle(exec_policy, out_begin, out_end, this->rng_);
286287
} else if constexpr (std::is_same_v<Dist, distribution::uniform>) {
287-
size_t num_keys = thrust::distance(out_begin, out_end);
288+
size_t num_keys = cuda::std::distance(out_begin, out_end);
288289
size_t seed = this->rng_();
289290

290291
thrust::transform(exec_policy,
@@ -293,7 +294,7 @@ class key_generator {
293294
out_begin,
294295
detail::generate_uniform_fn<value_type, Dist, RNG>{num_keys, dist, seed});
295296
} else if constexpr (std::is_same_v<Dist, distribution::gaussian>) {
296-
size_t num_keys = thrust::distance(out_begin, out_end);
297+
size_t num_keys = cuda::std::distance(out_begin, out_end);
297298

298299
thrust::counting_iterator<size_t> seq(this->rng_());
299300

@@ -369,7 +370,7 @@ class key_generator {
369370
CUCO_EXPECTS(keep_prob >= 0.0 and keep_prob <= 1.0, "Probability needs to be between 0 and 1");
370371

371372
if (keep_prob < 1.0) {
372-
size_t const num_keys = thrust::distance(begin, end);
373+
size_t const num_keys = cuda::std::distance(begin, end);
373374

374375
thrust::counting_iterator<size_t> seeds(rng_());
375376

0 commit comments

Comments
 (0)