Skip to content

Commit feecbe2

Browse files
committed
Fix raw CUDA stream boundaries in benchmarks and tests
Signed-off-by: Bradley Dice <bdice@bradleydice.com>
1 parent 10cec5f commit feecbe2

16 files changed

Lines changed: 93 additions & 20 deletions

cpp/bench/ann/src/common/util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ inline auto get_stream_from_global_pool() -> cudaStream_t
171171
detail::global_stream_pool.emplace_back(rmm::cuda_stream::flags::non_blocking);
172172
}
173173
}
174-
return detail::global_stream_pool[benchmark_thread_id].view();
174+
return detail::global_stream_pool[benchmark_thread_id].value();
175175
#else
176176
return nullptr;
177177
#endif

cpp/bench/ann/src/cuvs/cuvs_brute_force_knn.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55
#include <cuvs/distance/distance.hpp>
@@ -72,7 +72,7 @@ template <typename T, typename DistT = T>
7272
class BruteForceKNNBenchmark {
7373
public:
7474
BruteForceKNNBenchmark(const RandomKNNInputs& params, const std::string& type_str)
75-
: stream_(raft::resource::get_cuda_stream(handle_)),
75+
: stream_(raft::resource::get_cuda_stream(handle_).get()),
7676
params_(params),
7777
type_str_(type_str),
7878
database(params_.num_db_vecs * params_.dim, stream_),

cpp/bench/ann/src/cuvs/cuvs_cagra_hnswlib_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class cuvs_cagra_hnswlib : public algo<T>, public algo_gpu {
4545

4646
[[nodiscard]] auto get_sync_stream() const noexcept -> cudaStream_t override
4747
{
48-
return handle_.get_sync_stream();
48+
return handle_.get_sync_stream().get();
4949
}
5050

5151
[[nodiscard]] auto uses_stream() const noexcept -> bool override

cpp/bench/ann/src/cuvs/cuvs_cagra_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class cuvs_cagra : public algo<T>, public algo_gpu {
205205

206206
[[nodiscard]] auto get_sync_stream() const noexcept -> cudaStream_t override
207207
{
208-
return handle_.get_sync_stream();
208+
return handle_.get_sync_stream().get();
209209
}
210210

211211
[[nodiscard]] auto uses_stream() const noexcept -> bool override

cpp/bench/ann/src/cuvs/cuvs_ivf_flat_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class cuvs_ivf_flat : public algo<T>, public algo_gpu {
5757

5858
[[nodiscard]] auto get_sync_stream() const noexcept -> cudaStream_t override
5959
{
60-
return handle_.get_sync_stream();
60+
return handle_.get_sync_stream().get();
6161
}
6262

6363
// to enable dataset access from GPU memory

cpp/bench/ann/src/cuvs/cuvs_ivf_pq_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class cuvs_ivf_pq : public algo<T>, public algo_gpu {
7070

7171
[[nodiscard]] auto get_sync_stream() const noexcept -> cudaStream_t override
7272
{
73-
return handle_.get_sync_stream();
73+
return handle_.get_sync_stream().get();
7474
}
7575

7676
// to enable dataset access from GPU memory

cpp/bench/ann/src/cuvs/cuvs_ivf_rabitq_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class cuvs_ivf_rabitq : public algo<T>, public algo_gpu {
5555

5656
[[nodiscard]] auto get_sync_stream() const noexcept -> cudaStream_t override
5757
{
58-
return handle_.get_sync_stream();
58+
return handle_.get_sync_stream().get();
5959
}
6060

6161
// to enable dataset access from GPU memory

cpp/bench/ann/src/cuvs/cuvs_ivf_sq_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class cuvs_ivf_sq : public algo<T>, public algo_gpu {
5252

5353
[[nodiscard]] auto get_sync_stream() const noexcept -> cudaStream_t override
5454
{
55-
return handle_.get_sync_stream();
55+
return handle_.get_sync_stream().get();
5656
}
5757

5858
[[nodiscard]] auto get_preference() const -> algo_property override

cpp/bench/ann/src/cuvs/cuvs_mg_cagra_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class cuvs_mg_cagra : public algo<T>, public algo_gpu {
5656
[[nodiscard]] auto get_sync_stream() const noexcept -> cudaStream_t override
5757
{
5858
auto stream = raft::resource::get_cuda_stream(clique_);
59-
return stream;
59+
return stream.get();
6060
}
6161

6262
// to enable dataset access from GPU memory

cpp/bench/ann/src/cuvs/cuvs_mg_ivf_flat_wrapper.h

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

@@ -52,7 +52,7 @@ class cuvs_mg_ivf_flat : public algo<T>, public algo_gpu {
5252
[[nodiscard]] auto get_sync_stream() const noexcept -> cudaStream_t override
5353
{
5454
auto stream = raft::resource::get_cuda_stream(clique_);
55-
return stream;
55+
return stream.get();
5656
}
5757

5858
[[nodiscard]] auto uses_stream() const noexcept -> bool override { return false; }

0 commit comments

Comments
 (0)