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