diff --git a/cpp/bench/prims/common/benchmark.hpp b/cpp/bench/prims/common/benchmark.hpp index de2878ec54..a8860f4ad7 100644 --- a/cpp/bench/prims/common/benchmark.hpp +++ b/cpp/bench/prims/common/benchmark.hpp @@ -74,7 +74,7 @@ struct cuda_event_timer { RAFT_CUDA_TRY(cudaEventCreate(&start_)); RAFT_CUDA_TRY(cudaEventCreate(&stop_)); raft::interruptible::synchronize(stream_); - RAFT_CUDA_TRY(cudaEventRecord(start_, stream_)); + RAFT_CUDA_TRY(cudaEventRecord(start_, stream_.get())); } cuda_event_timer() = delete; @@ -85,7 +85,7 @@ struct cuda_event_timer { */ ~cuda_event_timer() { - RAFT_CUDA_TRY_NO_THROW(cudaEventRecord(stop_, stream_)); + RAFT_CUDA_TRY_NO_THROW(cudaEventRecord(stop_, stream_.get())); raft::interruptible::synchronize(stop_); float milliseconds = 0.0f; RAFT_CUDA_TRY_NO_THROW(cudaEventElapsedTime(&milliseconds, start_, stop_)); @@ -137,7 +137,7 @@ class fixture { /** The helper that writes zeroes to some buffer in GPU memory to flush the L2 cache. */ void flush_L2_cache() { - RAFT_CUDA_TRY(cudaMemsetAsync(scratch_buf_.data(), 0, scratch_buf_.size(), stream)); + RAFT_CUDA_TRY(cudaMemsetAsync(scratch_buf_.data(), 0, scratch_buf_.size(), stream.get())); } /** diff --git a/cpp/bench/prims/linalg/add.cu b/cpp/bench/prims/linalg/add.cu index c80d97746c..4cfdf8a5c8 100644 --- a/cpp/bench/prims/linalg/add.cu +++ b/cpp/bench/prims/linalg/add.cu @@ -22,7 +22,7 @@ struct add : public fixture { void run_benchmark(::benchmark::State& state) override { loop_on_state(state, [this]() { - raft::linalg::add(ptr0.data(), ptr0.data(), ptr1.data(), params.len, stream); + raft::linalg::add(ptr0.data(), ptr0.data(), ptr1.data(), params.len, stream.get()); }); } diff --git a/cpp/bench/prims/linalg/map_then_reduce.cu b/cpp/bench/prims/linalg/map_then_reduce.cu index 818e6b75ef..e0ed590e34 100644 --- a/cpp/bench/prims/linalg/map_then_reduce.cu +++ b/cpp/bench/prims/linalg/map_then_reduce.cu @@ -27,7 +27,8 @@ struct map_then_reduce : public fixture { void run_benchmark(::benchmark::State& state) override { loop_on_state(state, [this]() { - raft::linalg::mapThenSumReduce(out.data(), params.len, Identity(), stream, in.data()); + raft::linalg::mapThenSumReduce( + out.data(), params.len, Identity(), stream.get(), in.data()); }); } diff --git a/cpp/bench/prims/linalg/matrix_vector_op.cu b/cpp/bench/prims/linalg/matrix_vector_op.cu index d400793857..718e62810d 100644 --- a/cpp/bench/prims/linalg/matrix_vector_op.cu +++ b/cpp/bench/prims/linalg/matrix_vector_op.cu @@ -54,7 +54,7 @@ struct mat_vec_op : public fixture { params.cols, params.rows, OpT{}, - stream); + stream.get()); } else { raft::linalg::matrixVectorOp(out.data() + params.outAlignOffset, in.data() + params.inAlignOffset, @@ -63,7 +63,7 @@ struct mat_vec_op : public fixture { params.cols, params.rows, OpT{}, - stream); + stream.get()); } } else { if (params.bcastAlongRows) { @@ -74,7 +74,7 @@ struct mat_vec_op : public fixture { params.cols, params.rows, OpT{}, - stream); + stream.get()); } else { raft::linalg::matrixVectorOp(out.data() + params.outAlignOffset, in.data() + params.inAlignOffset, @@ -83,7 +83,7 @@ struct mat_vec_op : public fixture { params.cols, params.rows, OpT{}, - stream); + stream.get()); } } } else { @@ -95,7 +95,7 @@ struct mat_vec_op : public fixture { params.cols, params.rows, OpT{}, - stream); + stream.get()); } else { raft::linalg::matrixVectorOp(out.data() + params.outAlignOffset, in.data() + params.inAlignOffset, @@ -103,7 +103,7 @@ struct mat_vec_op : public fixture { params.cols, params.rows, OpT{}, - stream); + stream.get()); } } else { if (params.bcastAlongRows) { @@ -113,7 +113,7 @@ struct mat_vec_op : public fixture { params.cols, params.rows, OpT{}, - stream); + stream.get()); } else { raft::linalg::matrixVectorOp(out.data() + params.outAlignOffset, in.data() + params.inAlignOffset, @@ -121,7 +121,7 @@ struct mat_vec_op : public fixture { params.cols, params.rows, OpT{}, - stream); + stream.get()); } } } diff --git a/cpp/bench/prims/linalg/reduce.cu b/cpp/bench/prims/linalg/reduce.cu index 2a1e50ef18..807f035890 100644 --- a/cpp/bench/prims/linalg/reduce.cu +++ b/cpp/bench/prims/linalg/reduce.cu @@ -28,10 +28,10 @@ struct reduce : public fixture { loop_on_state(state, [this]() { if (along_rows) { raft::linalg::reduce( - out.data(), in.data(), input_size.cols, input_size.rows, T(0.f), stream); + out.data(), in.data(), input_size.cols, input_size.rows, T(0.f), stream.get()); } else { raft::linalg::reduce( - out.data(), in.data(), input_size.cols, input_size.rows, T(0.f), stream); + out.data(), in.data(), input_size.cols, input_size.rows, T(0.f), stream.get()); } }); } diff --git a/cpp/bench/prims/linalg/reduce_cols_by_key.cu b/cpp/bench/prims/linalg/reduce_cols_by_key.cu index 1202ee68af..1dc90e334f 100644 --- a/cpp/bench/prims/linalg/reduce_cols_by_key.cu +++ b/cpp/bench/prims/linalg/reduce_cols_by_key.cu @@ -42,8 +42,14 @@ struct reduce_cols_by_key : public fixture { state.SetLabel(label_stream.str()); loop_on_state(state, [this]() { - raft::linalg::reduce_cols_by_key( - in.data(), keys.data(), out.data(), params.rows, params.cols, params.keys, stream, false); + raft::linalg::reduce_cols_by_key(in.data(), + keys.data(), + out.data(), + params.rows, + params.cols, + params.keys, + stream.get(), + false); }); } diff --git a/cpp/bench/prims/linalg/reduce_rows_by_key.cu b/cpp/bench/prims/linalg/reduce_rows_by_key.cu index 28e19919ee..e4a9f31c9c 100644 --- a/cpp/bench/prims/linalg/reduce_rows_by_key.cu +++ b/cpp/bench/prims/linalg/reduce_rows_by_key.cu @@ -41,7 +41,7 @@ struct reduce_rows_by_key : public fixture { params.cols, params.keys, out.data(), - stream, + stream.get(), false); }); } diff --git a/cpp/bench/prims/linalg/transpose.cu b/cpp/bench/prims/linalg/transpose.cu index 3c7046c87e..dea76248c6 100644 --- a/cpp/bench/prims/linalg/transpose.cu +++ b/cpp/bench/prims/linalg/transpose.cu @@ -52,7 +52,7 @@ struct TransposeBench : public fixture { output_view.data_handle(), params.rows, params.cols, - handle.get_stream()); + handle.get_stream().get()); }); } diff --git a/cpp/bench/prims/matrix/select_k.cu b/cpp/bench/prims/matrix/select_k.cu index 3bf6dc2123..c064fa14d8 100644 --- a/cpp/bench/prims/matrix/select_k.cu +++ b/cpp/bench/prims/matrix/select_k.cu @@ -49,7 +49,7 @@ struct selection : public fixture { out_dists_(p.batch_size * p.k, stream), out_ids_(p.batch_size * p.k, stream) { - raft::sparse::iota_fill(in_ids_.data(), IdxT(p.batch_size), IdxT(p.len), stream); + raft::sparse::iota_fill(in_ids_.data(), IdxT(p.batch_size), IdxT(p.len), stream.get()); raft::random::RngState state{42}; KeyT min_value = -1.0; diff --git a/cpp/bench/prims/random/make_blobs.cu b/cpp/bench/prims/random/make_blobs.cu index 6527d967e4..f2dbeae691 100644 --- a/cpp/bench/prims/random/make_blobs.cu +++ b/cpp/bench/prims/random/make_blobs.cu @@ -42,7 +42,7 @@ struct make_blobs : public fixture { params.rows, params.cols, params.clusters, - this->stream, + this->stream.get(), params.row_major); }); } diff --git a/cpp/bench/prims/random/permute.cu b/cpp/bench/prims/random/permute.cu index 2e9ab70b9b..a8ad8fe88b 100644 --- a/cpp/bench/prims/random/permute.cu +++ b/cpp/bench/prims/random/permute.cu @@ -45,7 +45,7 @@ struct permute : public fixture { params.cols, params.rows, params.rowMajor, - stream, + stream.get(), 123456ULL); }); } @@ -97,7 +97,7 @@ struct permute_perms_only : public fixture { IntType(0), IntType(n_rows), true, - stream, + stream.get(), 123456ULL); bytes_processed += size_t(n_rows) * sizeof(IntType); }); diff --git a/cpp/bench/prims/sparse/convert_csr.cu b/cpp/bench/prims/sparse/convert_csr.cu index 953faba26d..95af154a0b 100644 --- a/cpp/bench/prims/sparse/convert_csr.cu +++ b/cpp/bench/prims/sparse/convert_csr.cu @@ -56,7 +56,7 @@ struct bench_base : public fixture { // col_ind is over-dimensioned because nnz is unknown at this point col_ind(p.num_rows * p.num_cols, stream) { - init_adj(adj.data(), p.num_rows, p.num_cols, p.divisor, stream); + init_adj(adj.data(), p.num_rows, p.num_cols, p.divisor, stream.get()); std::vector row_ind_host(p.num_rows); for (size_t i = 0; i < row_ind_host.size(); ++i) { diff --git a/cpp/bench/prims/sparse/select_k_csr.cu b/cpp/bench/prims/sparse/select_k_csr.cu index f674f32c1b..662bad64d3 100644 --- a/cpp/bench/prims/sparse/select_k_csr.cu +++ b/cpp/bench/prims/sparse/select_k_csr.cu @@ -83,7 +83,7 @@ struct SelectKCsrTest : public fixture { 1, nnz, 1, - stream, + stream.get(), false, nullptr, nullptr, diff --git a/cpp/bench/prims/sparse/svds.cu b/cpp/bench/prims/sparse/svds.cu index 19911020ab..232e4723d0 100644 --- a/cpp/bench/prims/sparse/svds.cu +++ b/cpp/bench/prims/sparse/svds.cu @@ -254,7 +254,7 @@ class svds_bench_base : public fixture { CUBLAS_OP_N, one, zero, - stream); + stream.get()); raft::linalg::gemm(handle, Vt.data_handle(), @@ -268,7 +268,7 @@ class svds_bench_base : public fixture { CUBLAS_OP_T, one, zero, - stream); + stream.get()); std::vector h_utu(static_cast(params.k) * params.k); std::vector h_vvt(static_cast(params.k) * params.k); diff --git a/cpp/bench/prims/util/fast_int_div.cu b/cpp/bench/prims/util/fast_int_div.cu index 96f57dfa6d..673043764e 100644 --- a/cpp/bench/prims/util/fast_int_div.cu +++ b/cpp/bench/prims/util/fast_int_div.cu @@ -75,20 +75,20 @@ struct fast_int_div_bench : public fixture { h_numerators.data(), h_numerators.size() * sizeof(IntT), cudaMemcpyHostToDevice, - stream)); + stream.get())); RAFT_CUDA_TRY(cudaMemcpyAsync(d_divisors.data(), h_divisors.data(), h_divisors.size() * sizeof(divisor_t), cudaMemcpyHostToDevice, - stream)); - stream.synchronize(); + stream.get())); + stream.sync(); } void run_benchmark(::benchmark::State& state) override { const auto* divisors = static_cast(d_divisors.data()); loop_on_state(state, [this, divisors]() { - divmod_kernel<<>>( + divmod_kernel<<>>( d_numerators.data(), kNumNumerators, divisors, kNumDivisors, out_d.data()); RAFT_CUDA_TRY(cudaPeekAtLastError()); }); diff --git a/cpp/include/raft/comms/detail/mpi_comms.hpp b/cpp/include/raft/comms/detail/mpi_comms.hpp index f4e393c96a..92e30e6dcb 100644 --- a/cpp/include/raft/comms/detail/mpi_comms.hpp +++ b/cpp/include/raft/comms/detail/mpi_comms.hpp @@ -103,7 +103,7 @@ class mpi_comms : public comms_iface { rank_(1), status_(stream), next_request_id_(0), - stream_(stream) + stream_(stream.get()) { int mpi_is_initialized = 0; RAFT_MPI_TRY(MPI_Initialized(&mpi_is_initialized)); @@ -134,7 +134,7 @@ class mpi_comms : public comms_iface { rank_(1), status_(stream), next_request_id_(0), - stream_(stream) + stream_(stream.get()) { int mpi_is_initialized = 0; RAFT_MPI_TRY(MPI_Initialized(&mpi_is_initialized)); diff --git a/cpp/include/raft/comms/detail/std_comms.hpp b/cpp/include/raft/comms/detail/std_comms.hpp index b01c1d104e..72dafe4cc2 100644 --- a/cpp/include/raft/comms/detail/std_comms.hpp +++ b/cpp/include/raft/comms/detail/std_comms.hpp @@ -72,7 +72,7 @@ class std_comms : public comms_iface { rmm::cuda_stream_view stream, bool subcomms_ucp = true) : nccl_comm_(nccl_comm), - stream_(stream), + stream_(stream.get()), status_(stream), num_ranks_(num_ranks), rank_(rank), @@ -97,7 +97,7 @@ class std_comms : public comms_iface { rmm::cuda_stream_view stream, bool own_nccl_comm = false) : nccl_comm_(nccl_comm), - stream_(stream), + stream_(stream.get()), status_(stream), num_ranks_(num_ranks), rank_(rank), diff --git a/cpp/include/raft/comms/detail/test.hpp b/cpp/include/raft/comms/detail/test.hpp index 5c6250922d..6e1535c994 100644 --- a/cpp/include/raft/comms/detail/test.hpp +++ b/cpp/include/raft/comms/detail/test.hpp @@ -34,7 +34,7 @@ bool test_collective_allreduce(raft::resources const& handle, int root) int const send = 1; - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); rmm::device_scalar temp_d(stream); RAFT_CUDA_TRY(cudaMemcpyAsync(temp_d.data(), &send, 1, cudaMemcpyHostToDevice, stream)); @@ -65,7 +65,7 @@ bool test_collective_broadcast(raft::resources const& handle, int root) int const send = root; - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); rmm::device_scalar temp_d(stream); @@ -100,7 +100,7 @@ bool test_collective_reduce(raft::resources const& handle, int root) int const send = root; - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); rmm::device_scalar temp_d(stream); @@ -136,7 +136,7 @@ bool test_collective_allgather(raft::resources const& handle, int root) int const send = communicator.get_rank(); - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); rmm::device_scalar temp_d(stream); rmm::device_uvector recv_d(communicator.get_size(), stream); @@ -173,7 +173,7 @@ bool test_collective_gather(raft::resources const& handle, int root) int const send = communicator.get_rank(); - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); rmm::device_scalar temp_d(stream); rmm::device_uvector recv_d(communicator.get_rank() == root ? communicator.get_size() : 0, @@ -217,7 +217,7 @@ bool test_collective_gatherv(raft::resources const& handle, int root) displacements[communicator.get_rank() + 1] - displacements[communicator.get_rank()], communicator.get_rank()); - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); rmm::device_uvector temp_d(sends.size(), stream); rmm::device_uvector recv_d(communicator.get_rank() == root ? displacements.back() : 0, @@ -269,7 +269,7 @@ bool test_collective_reducescatter(raft::resources const& handle, int root) std::vector sends(communicator.get_size(), 1); - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); rmm::device_uvector temp_d(sends.size(), stream); rmm::device_scalar recv_d(stream); @@ -367,7 +367,7 @@ bool test_pointToPoint_device_send_or_recv(raft::resources const& h, int numTria { comms_t const& communicator = resource::get_comms(h); int const rank = communicator.get_rank(); - cudaStream_t stream = resource::get_cuda_stream(h); + cudaStream_t stream = resource::get_cuda_stream(h).get(); bool ret = true; for (int i = 0; i < numTrials; i++) { @@ -410,7 +410,7 @@ bool test_pointToPoint_device_sendrecv(raft::resources const& h, int numTrials) { comms_t const& communicator = resource::get_comms(h); int const rank = communicator.get_rank(); - cudaStream_t stream = resource::get_cuda_stream(h); + cudaStream_t stream = resource::get_cuda_stream(h).get(); bool ret = true; for (int i = 0; i < numTrials; i++) { @@ -457,7 +457,7 @@ bool test_pointToPoint_device_multicast_sendrecv(raft::resources const& h, int n { comms_t const& communicator = resource::get_comms(h); int const rank = communicator.get_rank(); - cudaStream_t stream = resource::get_cuda_stream(h); + cudaStream_t stream = resource::get_cuda_stream(h).get(); bool ret = true; for (int i = 0; i < numTrials; i++) { diff --git a/cpp/include/raft/comms/std_comms.hpp b/cpp/include/raft/comms/std_comms.hpp index cf63215fd3..716a06b7ad 100644 --- a/cpp/include/raft/comms/std_comms.hpp +++ b/cpp/include/raft/comms/std_comms.hpp @@ -59,7 +59,7 @@ using std_comms = detail::std_comms; */ void build_comms_nccl_only(resources* handle, ncclComm_t nccl_comm, int num_ranks, int rank) { - cudaStream_t stream = resource::get_cuda_stream(*handle); + cudaStream_t stream = resource::get_cuda_stream(*handle).get(); auto communicator = std::make_shared( std::unique_ptr(new raft::comms::std_comms(nccl_comm, num_ranks, rank, stream))); @@ -150,7 +150,7 @@ void build_comms_nccl_ucx(resources* handle, } } - cudaStream_t stream = resource::get_cuda_stream(*handle); + cudaStream_t stream = resource::get_cuda_stream(*handle).get(); auto communicator = std::make_shared(std::unique_ptr( new raft::comms::std_comms(nccl_comm, ucx_objects, num_ranks, rank, stream))); diff --git a/cpp/include/raft/core/detail/copy.hpp b/cpp/include/raft/core/detail/copy.hpp index ebe9376f20..ffd14bbe66 100644 --- a/cpp/include/raft/core/detail/copy.hpp +++ b/cpp/include/raft/core/detail/copy.hpp @@ -466,7 +466,7 @@ mdspan_copyable_t copy(resources const& res, DstType&& dst, Sr dst.extent(1), dst.data_handle(), dst.extent(1), - resource::get_cuda_stream(res))); + resource::get_cuda_stream(res).get())); } else { CUBLAS_TRY(linalg::detail::cublasgeam(resource::get_cublas_handle(res), CUBLAS_OP_T, @@ -481,7 +481,7 @@ mdspan_copyable_t copy(resources const& res, DstType&& dst, Sr dst.extent(0), dst.data_handle(), dst.extent(0), - resource::get_cuda_stream(res))); + resource::get_cuda_stream(res).get())); } } else { #ifdef __CUDACC__ diff --git a/cpp/include/raft/core/dry_run_resources.hpp b/cpp/include/raft/core/dry_run_resources.hpp index 2e7a84cb85..66f3642d65 100644 --- a/cpp/include/raft/core/dry_run_resources.hpp +++ b/cpp/include/raft/core/dry_run_resources.hpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/include/raft/core/interruptible.hpp b/cpp/include/raft/core/interruptible.hpp index 0ce89b8238..de2eaa850d 100644 --- a/cpp/include/raft/core/interruptible.hpp +++ b/cpp/include/raft/core/interruptible.hpp @@ -79,7 +79,7 @@ class interruptible { static inline void synchronize(rmm::cuda_stream_view stream, std::source_location location = std::source_location::current()) { - get_token()->synchronize_impl(cudaStreamQuery, stream, "cudaStreamQuery", location); + get_token()->synchronize_impl(cudaStreamQuery, stream.get(), "cudaStreamQuery", location); } /** diff --git a/cpp/include/raft/core/memory_stats_resources.hpp b/cpp/include/raft/core/memory_stats_resources.hpp index 7e2dd7c166..47dbc6039e 100644 --- a/cpp/include/raft/core/memory_stats_resources.hpp +++ b/cpp/include/raft/core/memory_stats_resources.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/include/raft/core/memory_tracking_resources.hpp b/cpp/include/raft/core/memory_tracking_resources.hpp index 60121ed9fe..d6314377b7 100644 --- a/cpp/include/raft/core/memory_tracking_resources.hpp +++ b/cpp/include/raft/core/memory_tracking_resources.hpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/include/raft/core/resource/cublas_handle.hpp b/cpp/include/raft/core/resource/cublas_handle.hpp index 06a6930575..bd63bf1d60 100644 --- a/cpp/include/raft/core/resource/cublas_handle.hpp +++ b/cpp/include/raft/core/resource/cublas_handle.hpp @@ -20,7 +20,7 @@ class cublas_resource : public resource { cublas_resource(rmm::cuda_stream_view stream) { RAFT_CUBLAS_TRY_NO_THROW(cublasCreate(&cublas_res)); - RAFT_CUBLAS_TRY_NO_THROW(cublasSetStream(cublas_res, stream)); + RAFT_CUBLAS_TRY_NO_THROW(cublasSetStream(cublas_res, stream.get())); } ~cublas_resource() override { RAFT_CUBLAS_TRY_NO_THROW(cublasDestroy(cublas_res)); } @@ -60,10 +60,10 @@ class cublas_resource_factory : public resource_factory { inline cublasHandle_t get_cublas_handle(resources const& res) { if (!res.has_resource_factory(resource_type::CUBLAS_HANDLE)) { - res.ensure_default_factory(std::make_shared(get_cuda_stream(res))); + res.ensure_default_factory(std::make_shared(get_cuda_stream(res).get())); } auto ret = *res.get_resource(resource_type::CUBLAS_HANDLE); - RAFT_CUBLAS_TRY(cublasSetStream(ret, get_cuda_stream(res))); + RAFT_CUBLAS_TRY(cublasSetStream(ret, get_cuda_stream(res).get())); return ret; }; diff --git a/cpp/include/raft/core/resource/cuda_stream_pool.hpp b/cpp/include/raft/core/resource/cuda_stream_pool.hpp index afdf55bbf8..373dcbcc8a 100644 --- a/cpp/include/raft/core/resource/cuda_stream_pool.hpp +++ b/cpp/include/raft/core/resource/cuda_stream_pool.hpp @@ -169,9 +169,9 @@ inline void wait_stream_pool_on_stream(const resources& res) } cudaEvent_t event = detail::get_cuda_stream_sync_event(res); - RAFT_CUDA_TRY(cudaEventRecord(event, get_cuda_stream(res))); + RAFT_CUDA_TRY(cudaEventRecord(event, get_cuda_stream(res).get())); for (std::size_t i = 0; i < get_stream_pool_size(res); i++) { - RAFT_CUDA_TRY(cudaStreamWaitEvent(get_cuda_stream_pool(res).get_stream(i), event, 0)); + RAFT_CUDA_TRY(cudaStreamWaitEvent(get_cuda_stream_pool(res).get_stream(i).get(), event, 0)); } } diff --git a/cpp/include/raft/core/resource/cusolver_dn_handle.hpp b/cpp/include/raft/core/resource/cusolver_dn_handle.hpp index 498d5629cb..21db867b3b 100644 --- a/cpp/include/raft/core/resource/cusolver_dn_handle.hpp +++ b/cpp/include/raft/core/resource/cusolver_dn_handle.hpp @@ -26,7 +26,7 @@ class cusolver_dn_resource : public resource { cusolver_dn_resource(rmm::cuda_stream_view stream) { RAFT_CUSOLVER_TRY_NO_THROW(cusolverDnCreate(&cusolver_res)); - RAFT_CUSOLVER_TRY_NO_THROW(cusolverDnSetStream(cusolver_res, stream)); + RAFT_CUSOLVER_TRY_NO_THROW(cusolverDnSetStream(cusolver_res, stream.get())); } void* get_resource() override { return &cusolver_res; } diff --git a/cpp/include/raft/core/resource/cusolver_sp_handle.hpp b/cpp/include/raft/core/resource/cusolver_sp_handle.hpp index 09e5914b49..d848cc0fb0 100644 --- a/cpp/include/raft/core/resource/cusolver_sp_handle.hpp +++ b/cpp/include/raft/core/resource/cusolver_sp_handle.hpp @@ -23,7 +23,7 @@ class cusolver_sp_resource : public resource { cusolver_sp_resource(rmm::cuda_stream_view stream) { RAFT_CUSOLVER_TRY_NO_THROW(cusolverSpCreate(&cusolver_res)); - RAFT_CUSOLVER_TRY_NO_THROW(cusolverSpSetStream(cusolver_res, stream)); + RAFT_CUSOLVER_TRY_NO_THROW(cusolverSpSetStream(cusolver_res, stream.get())); } void* get_resource() override { return &cusolver_res; } diff --git a/cpp/include/raft/core/resource/cusparse_handle.hpp b/cpp/include/raft/core/resource/cusparse_handle.hpp index 0cec04eb70..e79a8f4b36 100644 --- a/cpp/include/raft/core/resource/cusparse_handle.hpp +++ b/cpp/include/raft/core/resource/cusparse_handle.hpp @@ -19,7 +19,7 @@ class cusparse_resource : public resource { cusparse_resource(rmm::cuda_stream_view stream) { RAFT_CUSPARSE_TRY_NO_THROW(cusparseCreate(&cusparse_res)); - RAFT_CUSPARSE_TRY_NO_THROW(cusparseSetStream(cusparse_res, stream)); + RAFT_CUSPARSE_TRY_NO_THROW(cusparseSetStream(cusparse_res, stream.get())); } ~cusparse_resource() { RAFT_CUSPARSE_TRY_NO_THROW(cusparseDestroy(cusparse_res)); } diff --git a/cpp/include/raft/core/serialize.hpp b/cpp/include/raft/core/serialize.hpp index 410faaeef0..0e920afe3b 100644 --- a/cpp/include/raft/core/serialize.hpp +++ b/cpp/include/raft/core/serialize.hpp @@ -45,7 +45,7 @@ inline void serialize_mdspan( // Copy to host before serializing // For contiguous layouts, size() == product of dimensions std::vector tmp(obj.size()); - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); raft::update_host(tmp.data(), obj.data_handle(), obj.size(), stream); resource::sync_stream(handle); using inner_accessor_type = typename obj_t::accessor_type::accessor_type; @@ -98,7 +98,7 @@ inline void deserialize_mdspan( tmp.data(), obj.extents()); detail::numpy_serializer::deserialize_host_mdspan(is, tmp_mdspan); - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); raft::update_device(obj.data_handle(), tmp.data(), obj.size(), stream); resource::sync_stream(handle); } diff --git a/cpp/include/raft/label/classlabels.cuh b/cpp/include/raft/label/classlabels.cuh index 63b1293e0f..bb78654cd4 100644 --- a/cpp/include/raft/label/classlabels.cuh +++ b/cpp/include/raft/label/classlabels.cuh @@ -36,7 +36,7 @@ int getUniquelabels(raft::resources const& handle, size_t n) { return detail::getUniquelabels( - resource::get_dry_run_flag(handle), unique, y, n, resource::get_cuda_stream(handle)); + resource::get_dry_run_flag(handle), unique, y, n, resource::get_cuda_stream(handle).get()); } /** diff --git a/cpp/include/raft/linalg/add.cuh b/cpp/include/raft/linalg/add.cuh index 46716e8268..32f9740bb5 100644 --- a/cpp/include/raft/linalg/add.cuh +++ b/cpp/include/raft/linalg/add.cuh @@ -119,7 +119,7 @@ void add(raft::resources const& handle, InType in1, InType in2, OutType out) in1.data_handle(), in2.data_handle(), static_cast(out.size()), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** diff --git a/cpp/include/raft/linalg/axpy.cuh b/cpp/include/raft/linalg/axpy.cuh index 83a045bda7..3da73e8074 100644 --- a/cpp/include/raft/linalg/axpy.cuh +++ b/cpp/include/raft/linalg/axpy.cuh @@ -78,7 +78,7 @@ void axpy(raft::resources const& handle, x.stride(0), y.data_handle(), y.stride(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -108,7 +108,7 @@ void axpy(raft::resources const& handle, x.stride(0), y.data_handle(), y.stride(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end of group axpy diff --git a/cpp/include/raft/linalg/coalesced_reduction.cuh b/cpp/include/raft/linalg/coalesced_reduction.cuh index c87f75eb4a..22f23fc5e0 100644 --- a/cpp/include/raft/linalg/coalesced_reduction.cuh +++ b/cpp/include/raft/linalg/coalesced_reduction.cuh @@ -128,7 +128,7 @@ void coalesced_reduction(raft::resources const& handle, data.extent(1), data.extent(0), init, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), inplace, main_op, reduce_op, @@ -143,7 +143,7 @@ void coalesced_reduction(raft::resources const& handle, data.extent(0), data.extent(1), init, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), inplace, main_op, reduce_op, diff --git a/cpp/include/raft/linalg/detail/cublaslt_wrappers.hpp b/cpp/include/raft/linalg/detail/cublaslt_wrappers.hpp index 90cb595faf..59d1ce8054 100644 --- a/cpp/include/raft/linalg/detail/cublaslt_wrappers.hpp +++ b/cpp/include/raft/linalg/detail/cublaslt_wrappers.hpp @@ -358,14 +358,14 @@ struct coef_wrapper { { if (alpha != nullptr && beta != nullptr) { return; } S defaults[2] = {1, 0}; - RAFT_CUDA_TRY(cudaMallocAsync(&store, 2 * sizeof(S), stream)); - RAFT_CUDA_TRY(cudaMemcpyAsync(store, defaults, 2 * sizeof(S), cudaMemcpyHostToDevice, stream)); + RAFT_CUDA_TRY(cudaMallocAsync(&store, 2 * sizeof(S), stream.get())); + RAFT_CUDA_TRY(cudaMemcpyAsync(store, defaults, 2 * sizeof(S), cudaMemcpyHostToDevice, stream.get())); if (alpha == nullptr) { alpha = &store[0]; } if (beta == nullptr) { beta = &store[1]; } } ~coef_wrapper() noexcept { - if (store != nullptr) { RAFT_CUDA_TRY_NO_THROW(cudaFreeAsync(store, stream)); } + if (store != nullptr) { RAFT_CUDA_TRY_NO_THROW(cudaFreeAsync(store, stream.get())); } } }; @@ -431,7 +431,7 @@ void matmul_strided_batched(raft::resources const& res, nullptr, nullptr, 0, - stream)); + stream.get())); } /** @@ -547,7 +547,7 @@ void matmul(raft::resources const& res, beta, c_ptr, ldc, - resource::get_cuda_stream(res)); + resource::get_cuda_stream(res).get()); } } // namespace linalg::detail diff --git a/cpp/include/raft/linalg/detail/lstsq.cuh b/cpp/include/raft/linalg/detail/lstsq.cuh index 724558910c..e3171a2430 100644 --- a/cpp/include/raft/linalg/detail/lstsq.cuh +++ b/cpp/include/raft/linalg/detail/lstsq.cuh @@ -74,15 +74,15 @@ struct DeviceEvent { bool are_implicitly_synchronized(rmm::cuda_stream_view a, rmm::cuda_stream_view b) { // any stream is "synchronized" with itself - if (a.value() == b.value()) return true; + if (a.get() == b.get()) return true; // legacy + blocking streams unsigned int flags = 0; if (a.is_default()) { - RAFT_CUDA_TRY(cudaStreamGetFlags(b.value(), &flags)); + RAFT_CUDA_TRY(cudaStreamGetFlags(b.get(), &flags)); if ((flags & cudaStreamNonBlocking) == 0) return true; } if (b.is_default()) { - RAFT_CUDA_TRY(cudaStreamGetFlags(a.value(), &flags)); + RAFT_CUDA_TRY(cudaStreamGetFlags(a.get(), &flags)); if ((flags & cudaStreamNonBlocking) == 0) return true; } return false; @@ -283,7 +283,7 @@ void lstsqEig(raft::resources const& handle, // the event is created only if the given raft handle is capable of running // at least two CUDA streams without implicit synchronization. DeviceEvent worksetDone(concurrent); - worksetDone.record(mainStream); + worksetDone.record(mainStream.get()); math_t* Q = workset.data(); math_t* QS = Q + n_cols * n_cols; math_t* covA = QS + n_cols * n_cols; @@ -305,22 +305,22 @@ void lstsqEig(raft::resources const& handle, CUBLAS_OP_N, alpha, beta, - mainStream); + mainStream.get()); // Ab <- A* b - worksetDone.wait_by(multAbStream); - raft::linalg::gemv(handle, A, n_rows, n_cols, b, Ab, true, multAbStream); + worksetDone.wait_by(multAbStream.get()); + raft::linalg::gemv(handle, A, n_rows, n_cols, b, Ab, true, multAbStream.get()); DeviceEvent multAbDone(concurrent); - multAbDone.record(multAbStream); + multAbDone.record(multAbStream.get()); // Q S Q* <- covA raft::common::nvtx::push_range("raft::linalg::eigDC"); - raft::linalg::eigDC(handle, covA, n_cols, n_cols, Q, S, mainStream); + raft::linalg::eigDC(handle, covA, n_cols, n_cols, Q, S, mainStream.get()); raft::common::nvtx::pop_range(); // QS <- Q invS raft::linalg::detail::matrixVectorOp( - dry_run, QS, Q, S, n_cols, n_cols, DivideByNonZero(), mainStream); + dry_run, QS, Q, S, n_cols, n_cols, DivideByNonZero(), mainStream.get()); // covA <- QS Q* == Q invS Q* == inv(A* A) raft::linalg::gemm(handle, QS, @@ -334,18 +334,18 @@ void lstsqEig(raft::resources const& handle, CUBLAS_OP_T, alpha, beta, - mainStream); + mainStream.get()); - multAbDone.wait_by(mainStream); + multAbDone.wait_by(mainStream.get()); // w <- covA Ab == Q invS Q* A b == inv(A* A) A b - raft::linalg::gemv(handle, covA, n_cols, n_cols, Ab, w, false, mainStream); + raft::linalg::gemv(handle, covA, n_cols, n_cols, Ab, w, false, mainStream.get()); // This event is created only if we use two worker streams, and `stream` is not the legacy stream, // and `mainStream` is not a non-blocking stream. In fact, with the current logic these conditions // are impossible together, but it still makes sense to put this construct here to emphasize that // `stream` must wait till the work here is done (for future refactorings). DeviceEvent mainDone(!are_implicitly_synchronized(mainStream, stream)); - mainDone.record(mainStream); + mainDone.record(mainStream.get()); mainDone.wait_by(stream); } diff --git a/cpp/include/raft/linalg/detail/rsvd.cuh b/cpp/include/raft/linalg/detail/rsvd.cuh index 47f803d9b4..c54c5e8727 100644 --- a/cpp/include/raft/linalg/detail/rsvd.cuh +++ b/cpp/include/raft/linalg/detail/rsvd.cuh @@ -51,7 +51,7 @@ void randomized_svd(const raft::resources& handle, RAFT_EXPECTS((k + p) < std::min(n_rows, n_cols), "k + p must be < min(n_rows, n_cols)"); RAFT_EXPECTS(!gen_U || (U != nullptr), "computation of U vector requested but found nullptr"); RAFT_EXPECTS(!gen_V || (V != nullptr), "computation of V vector requested but found nullptr"); - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); cusolverDnHandle_t cusolverH = resource::get_cusolver_dn_handle(handle); char jobu = gen_U ? 'S' : 'N'; diff --git a/cpp/include/raft/linalg/detail/transpose.cuh b/cpp/include/raft/linalg/detail/transpose.cuh index 739a51145d..e9c4b6fc5e 100644 --- a/cpp/include/raft/linalg/detail/transpose.cuh +++ b/cpp/include/raft/linalg/detail/transpose.cuh @@ -224,7 +224,7 @@ void transpose_row_major_impl( out.stride(0), out.data_handle(), out.stride(0), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } template @@ -267,7 +267,7 @@ void transpose_col_major_impl( out.stride(1), out.data_handle(), out.stride(1), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } template diff --git a/cpp/include/raft/linalg/detail/tsvd.cuh b/cpp/include/raft/linalg/detail/tsvd.cuh index 5d46675861..a68318b598 100644 --- a/cpp/include/raft/linalg/detail/tsvd.cuh +++ b/cpp/include/raft/linalg/detail/tsvd.cuh @@ -54,7 +54,7 @@ void cal_comp_exp_vars_svd(raft::resources const& handle, raft::device_vector_view explained_vars, raft::device_vector_view explained_var_ratio) { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto cusolver_handle = raft::resource::get_cusolver_dn_handle(handle); auto cublas_handle = raft::resource::get_cublas_handle(handle); @@ -121,7 +121,7 @@ void cal_eig(raft::resources const& handle, constexpr bool is_row_major = std::is_same_v; - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto cusolver_handle = raft::resource::get_cusolver_dn_handle(handle); auto n_cols = in.extent(0); @@ -183,7 +183,7 @@ void sign_flip_components(raft::resources const& handle, "sign_flip_components: layout must be raft::row_major or raft::col_major"); constexpr bool is_row_major = std::is_same_v; - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto n_samples = input.extent(0); auto n_features = input.extent(1); auto n_components = components.extent(0); @@ -270,7 +270,7 @@ void sign_flip(raft::resources const& handle, raft::device_matrix_view input, raft::device_matrix_view components) { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto n_rows = input.extent(0); auto n_cols = input.extent(1); auto n_cols_comp = components.extent(1); @@ -328,7 +328,7 @@ void tsvd_fit(raft::resources const& handle, raft::device_vector_view singular_vals, bool flip_signs_based_on_U = false) { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto cublas_handle = raft::resource::get_cublas_handle(handle); auto n_rows = input.extent(0); @@ -485,7 +485,7 @@ void tsvd_fit_transform(raft::resources const& handle, raft::device_vector_view singular_vals, bool flip_signs_based_on_U = false) { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto n_cols = input.extent(1); auto n_components = components.extent(0); diff --git a/cpp/include/raft/linalg/divide.cuh b/cpp/include/raft/linalg/divide.cuh index e1f9d45c1c..7a5f47385b 100644 --- a/cpp/include/raft/linalg/divide.cuh +++ b/cpp/include/raft/linalg/divide.cuh @@ -76,7 +76,7 @@ void divide_scalar(raft::resources const& handle, in.data_handle(), *scalar.data_handle(), static_cast(out.size()), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end of group add diff --git a/cpp/include/raft/linalg/dot.cuh b/cpp/include/raft/linalg/dot.cuh index 6b854065e1..4a40e22db3 100644 --- a/cpp/include/raft/linalg/dot.cuh +++ b/cpp/include/raft/linalg/dot.cuh @@ -53,7 +53,7 @@ void dot(raft::resources const& handle, y.data_handle(), y.stride(0), out.data_handle(), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } /** @@ -84,7 +84,7 @@ void dot(raft::resources const& handle, y.data_handle(), y.stride(0), out.data_handle(), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } /** @} */ // end of group dot diff --git a/cpp/include/raft/linalg/eig.cuh b/cpp/include/raft/linalg/eig.cuh index 109316c23c..519d451cca 100644 --- a/cpp/include/raft/linalg/eig.cuh +++ b/cpp/include/raft/linalg/eig.cuh @@ -132,7 +132,7 @@ void eig_dc(raft::resources const& handle, in.extent(1), eig_vectors.data_handle(), eig_vals.data_handle(), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -168,7 +168,7 @@ void eig_dc_selective(raft::resources const& handle, eig_vectors.data_handle(), eig_vals.data_handle(), memUsage, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -203,7 +203,7 @@ void eig_jacobi(raft::resources const& handle, in.extent(1), eig_vectors.data_handle(), eig_vals.data_handle(), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), tol, sweeps); } diff --git a/cpp/include/raft/linalg/gemv.cuh b/cpp/include/raft/linalg/gemv.cuh index c4e73a72bc..782a04898f 100644 --- a/cpp/include/raft/linalg/gemv.cuh +++ b/cpp/include/raft/linalg/gemv.cuh @@ -291,7 +291,7 @@ void gemv(raft::resources const& handle, beta.value().data_handle(), y.data_handle(), 1, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end of gemv diff --git a/cpp/include/raft/linalg/map_reduce.cuh b/cpp/include/raft/linalg/map_reduce.cuh index 81670d0cef..e0684e8911 100644 --- a/cpp/include/raft/linalg/map_reduce.cuh +++ b/cpp/include/raft/linalg/map_reduce.cuh @@ -99,7 +99,7 @@ void map_reduce(raft::resources const& handle, neutral, map, op, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), in.data_handle(), args...); } diff --git a/cpp/include/raft/linalg/matrix_vector.cuh b/cpp/include/raft/linalg/matrix_vector.cuh index 69e57b3db8..61ae44b666 100644 --- a/cpp/include/raft/linalg/matrix_vector.cuh +++ b/cpp/include/raft/linalg/matrix_vector.cuh @@ -46,7 +46,7 @@ void binary_mult(raft::resources const& handle, vec.data_handle(), data.extent(0), data.extent(1), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -75,7 +75,7 @@ void binary_mult_skip_zero(raft::resources const& handle, vec.data_handle(), data.extent(0), data.extent(1), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -104,7 +104,7 @@ void binary_div(raft::resources const& handle, vec.data_handle(), data.extent(0), data.extent(1), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -136,7 +136,7 @@ void binary_div_skip_zero(raft::resources const& handle, vec.data_handle(), data.extent(0), data.extent(1), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), return_zero); } @@ -166,7 +166,7 @@ void binary_add(raft::resources const& handle, vec.data_handle(), data.extent(0), data.extent(1), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -195,7 +195,7 @@ void binary_sub(raft::resources const& handle, vec.data_handle(), data.extent(0), data.extent(1), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end of matrix_vector diff --git a/cpp/include/raft/linalg/matrix_vector_op.cuh b/cpp/include/raft/linalg/matrix_vector_op.cuh index 15f796f77c..8d2755e3ff 100644 --- a/cpp/include/raft/linalg/matrix_vector_op.cuh +++ b/cpp/include/raft/linalg/matrix_vector_op.cuh @@ -166,7 +166,7 @@ void matrix_vector_op(raft::resources const& handle, out.extent(1), out.extent(0), op, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -233,7 +233,7 @@ void matrix_vector_op(raft::resources const& handle, out.extent(1), out.extent(0), op, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end of group matrix_vector_op diff --git a/cpp/include/raft/linalg/mean_squared_error.cuh b/cpp/include/raft/linalg/mean_squared_error.cuh index 27324618b0..31d9ade0f1 100644 --- a/cpp/include/raft/linalg/mean_squared_error.cuh +++ b/cpp/include/raft/linalg/mean_squared_error.cuh @@ -67,7 +67,7 @@ void mean_squared_error(raft::resources const& handle, B.data_handle(), A.extent(0), weight, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end of group mean_squared_error diff --git a/cpp/include/raft/linalg/multiply.cuh b/cpp/include/raft/linalg/multiply.cuh index b478332f47..ebcc185d6c 100644 --- a/cpp/include/raft/linalg/multiply.cuh +++ b/cpp/include/raft/linalg/multiply.cuh @@ -78,7 +78,7 @@ void multiply_scalar( in.data_handle(), *scalar.data_handle(), static_cast(out.size()), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end of group multiply diff --git a/cpp/include/raft/linalg/norm.cuh b/cpp/include/raft/linalg/norm.cuh index ee4f2b69e8..213d06d2a8 100644 --- a/cpp/include/raft/linalg/norm.cuh +++ b/cpp/include/raft/linalg/norm.cuh @@ -135,7 +135,7 @@ void norm(raft::resources const& handle, in.data_handle(), in.extent(1), in.extent(0), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), fin_op); } else { RAFT_EXPECTS(static_cast(out.size()) == in.extent(1), @@ -145,7 +145,7 @@ void norm(raft::resources const& handle, in.data_handle(), in.extent(1), in.extent(0), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), fin_op); } } diff --git a/cpp/include/raft/linalg/normalize.cuh b/cpp/include/raft/linalg/normalize.cuh index 32674218a3..a6a38a4b3b 100644 --- a/cpp/include/raft/linalg/normalize.cuh +++ b/cpp/include/raft/linalg/normalize.cuh @@ -68,7 +68,7 @@ void row_normalize(raft::resources const& handle, in.extent(1), in.extent(0), init, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), main_op, reduce_op, fin_op, diff --git a/cpp/include/raft/linalg/power.cuh b/cpp/include/raft/linalg/power.cuh index 6ed310dc1b..f92ab44b1a 100644 --- a/cpp/include/raft/linalg/power.cuh +++ b/cpp/include/raft/linalg/power.cuh @@ -91,7 +91,7 @@ void power(raft::resources const& handle, InType in1, InType in2, OutType out) in1.data_handle(), in2.data_handle(), static_cast(out.size()), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -128,7 +128,7 @@ void power_scalar( in.data_handle(), *scalar.data_handle(), static_cast(out.size()), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end of group add diff --git a/cpp/include/raft/linalg/reduce.cuh b/cpp/include/raft/linalg/reduce.cuh index fc935a3bb9..d28732a9bb 100644 --- a/cpp/include/raft/linalg/reduce.cuh +++ b/cpp/include/raft/linalg/reduce.cuh @@ -175,7 +175,7 @@ void reduce(raft::resources const& handle, data.extent(1), data.extent(0), init, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), inplace, main_op, reduce_op, diff --git a/cpp/include/raft/linalg/reduce_cols_by_key.cuh b/cpp/include/raft/linalg/reduce_cols_by_key.cuh index e90155c278..75f2b2054f 100644 --- a/cpp/include/raft/linalg/reduce_cols_by_key.cuh +++ b/cpp/include/raft/linalg/reduce_cols_by_key.cuh @@ -99,7 +99,7 @@ void reduce_cols_by_key( data.extent(0), data.extent(1), nkeys, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), reset_sums); } diff --git a/cpp/include/raft/linalg/reduce_rows_by_key.cuh b/cpp/include/raft/linalg/reduce_rows_by_key.cuh index 3b0cbb2e29..32005b14d1 100644 --- a/cpp/include/raft/linalg/reduce_rows_by_key.cuh +++ b/cpp/include/raft/linalg/reduce_rows_by_key.cuh @@ -166,7 +166,7 @@ void reduce_rows_by_key( d_A.extent(0), n_unique_keys, d_sums.data_handle(), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), reset_sums); } else { reduce_rows_by_key(d_A.data_handle(), @@ -177,7 +177,7 @@ void reduce_rows_by_key( d_A.extent(0), n_unique_keys, d_sums.data_handle(), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), reset_sums); } } diff --git a/cpp/include/raft/linalg/rsvd.cuh b/cpp/include/raft/linalg/rsvd.cuh index 16935af0e7..b9925eba88 100644 --- a/cpp/include/raft/linalg/rsvd.cuh +++ b/cpp/include/raft/linalg/rsvd.cuh @@ -197,7 +197,7 @@ void rsvd_fixed_rank(raft::resources const& handle, false, static_cast(0), 0, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -276,7 +276,7 @@ void rsvd_fixed_rank_symmetric( false, static_cast(0), 0, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -358,7 +358,7 @@ void rsvd_fixed_rank_jacobi(raft::resources const& handle, true, tol, max_sweeps, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -441,7 +441,7 @@ void rsvd_fixed_rank_symmetric_jacobi( true, tol, max_sweeps, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -521,7 +521,7 @@ void rsvd_perc(raft::resources const& handle, false, static_cast(0), 0, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -601,7 +601,7 @@ void rsvd_perc_symmetric(raft::resources const& handle, false, static_cast(0), 0, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -685,7 +685,7 @@ void rsvd_perc_jacobi(raft::resources const& handle, true, tol, max_sweeps, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -770,7 +770,7 @@ void rsvd_perc_symmetric_jacobi( true, tol, max_sweeps, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** diff --git a/cpp/include/raft/linalg/sqrt.cuh b/cpp/include/raft/linalg/sqrt.cuh index bd840e1558..747496f430 100644 --- a/cpp/include/raft/linalg/sqrt.cuh +++ b/cpp/include/raft/linalg/sqrt.cuh @@ -65,7 +65,7 @@ void sqrt(raft::resources const& handle, InType in, OutType out) out.data_handle(), in.data_handle(), static_cast(out.size()), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end of group add diff --git a/cpp/include/raft/linalg/strided_reduction.cuh b/cpp/include/raft/linalg/strided_reduction.cuh index 5d8f942f94..c8238c53b7 100644 --- a/cpp/include/raft/linalg/strided_reduction.cuh +++ b/cpp/include/raft/linalg/strided_reduction.cuh @@ -139,7 +139,7 @@ void strided_reduction(raft::resources const& handle, data.extent(1), data.extent(0), init, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), inplace, main_op, reduce_op, @@ -153,7 +153,7 @@ void strided_reduction(raft::resources const& handle, data.extent(0), data.extent(1), init, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), inplace, main_op, reduce_op, diff --git a/cpp/include/raft/linalg/subtract.cuh b/cpp/include/raft/linalg/subtract.cuh index c67fc1d86d..cb005ca698 100644 --- a/cpp/include/raft/linalg/subtract.cuh +++ b/cpp/include/raft/linalg/subtract.cuh @@ -115,7 +115,7 @@ void subtract(raft::resources const& handle, InType in1, InType in2, OutType out in1.data_handle(), in2.data_handle(), static_cast(out.size()), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -189,7 +189,7 @@ void subtract_scalar( in.data_handle(), *scalar.data_handle(), static_cast(out.size()), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end of group subtract diff --git a/cpp/include/raft/linalg/svd.cuh b/cpp/include/raft/linalg/svd.cuh index 363b75ab15..4091d031e7 100644 --- a/cpp/include/raft/linalg/svd.cuh +++ b/cpp/include/raft/linalg/svd.cuh @@ -222,7 +222,7 @@ void svd_qr( false, U.has_value(), V.has_value(), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -291,7 +291,7 @@ void svd_qr_transpose_right_vec( true, U.has_value(), V.has_value(), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -352,7 +352,7 @@ void svd_eig( left_sing_vecs_ptr, V.data_handle(), U.has_value(), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } template @@ -402,7 +402,7 @@ void svd_reconstruction(raft::resources const& handle, out.extent(0), out.extent(1), S.extent(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end of group svd diff --git a/cpp/include/raft/linalg/unary_op.cuh b/cpp/include/raft/linalg/unary_op.cuh index 1b7164e884..f1e79e4a6b 100644 --- a/cpp/include/raft/linalg/unary_op.cuh +++ b/cpp/include/raft/linalg/unary_op.cuh @@ -112,7 +112,7 @@ template h_matrix = std::vector(n_cols * n_rows); raft::update_host(h_matrix.data(), in, n_cols * n_rows, stream); diff --git a/cpp/include/raft/matrix/detail/select_k-inl.cuh b/cpp/include/raft/matrix/detail/select_k-inl.cuh index cc70d0ac92..bbdbcb886f 100644 --- a/cpp/include/raft/matrix/detail/select_k-inl.cuh +++ b/cpp/include/raft/matrix/detail/select_k-inl.cuh @@ -86,7 +86,7 @@ void segmented_sort_by_key(raft::resources const& handle, const ValT* offsets, bool asc) { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto mr = resource::get_workspace_resource_ref(handle); auto out_inds = raft::make_device_mdarray(handle, mr, raft::make_extents(n_elements)); diff --git a/cpp/include/raft/matrix/detail/select_radix.cuh b/cpp/include/raft/matrix/detail/select_radix.cuh index c4cbd171aa..59bc728e21 100644 --- a/cpp/include/raft/matrix/detail/select_radix.cuh +++ b/cpp/include/raft/matrix/detail/select_radix.cuh @@ -919,8 +919,8 @@ void radix_topk(bool dry_run, for (size_t offset = 0; offset < static_cast(batch_size); offset += max_chunk_size) { int chunk_size = std::min(max_chunk_size, batch_size - offset); RAFT_CUDA_TRY( - cudaMemsetAsync(counters.data(), 0, counters.size() * sizeof(Counter), stream)); - RAFT_CUDA_TRY(cudaMemsetAsync(histograms.data(), 0, histograms.size() * sizeof(IdxT), stream)); + cudaMemsetAsync(counters.data(), 0, counters.size() * sizeof(Counter), stream.get())); + RAFT_CUDA_TRY(cudaMemsetAsync(histograms.data(), 0, histograms.size() * sizeof(IdxT), stream.get())); auto kernel = radix_kernel; T* chunk_out = out + offset * k; @@ -1288,7 +1288,7 @@ void select_k(raft::resources const& res, "CSR layout requires a non-null indptr array (len_i)!"); bool dry_run = resource::get_dry_run_flag(res); - auto stream = resource::get_cuda_stream(res); + auto stream = resource::get_cuda_stream(res).get(); auto mr = resource::get_workspace_resource_ref(res); if (k == len && RowLayout::is_uniform) { if (dry_run) { return; } diff --git a/cpp/include/raft/matrix/diagonal.cuh b/cpp/include/raft/matrix/diagonal.cuh index 67992bce6e..aa32323bcb 100644 --- a/cpp/include/raft/matrix/diagonal.cuh +++ b/cpp/include/raft/matrix/diagonal.cuh @@ -42,7 +42,7 @@ void set_diagonal(raft::resources const& handle, matrix.extent(0), matrix.extent(1), is_row_major, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -65,7 +65,7 @@ void get_diagonal(raft::resources const& handle, matrix.extent(0), matrix.extent(1), is_row_major, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -81,7 +81,7 @@ void invert_diagonal(raft::resources const& handle, // TODO: Use get_diagonal for this to support rectangular RAFT_EXPECTS(inout.extent(0) == inout.extent(1), "Matrix must be square."); detail::getDiagonalInverseMatrix( - inout.data_handle(), inout.extent(0), resource::get_cuda_stream(handle)); + inout.data_handle(), inout.extent(0), resource::get_cuda_stream(handle).get()); } /** @@ -100,7 +100,7 @@ void eye(const raft::resources& handle, raft::device_matrix_view(handle, min(out.extent(0), out.extent(1))); if (resource::get_dry_run_flag(handle)) { return; } RAFT_CUDA_TRY(cudaMemsetAsync( - out.data_handle(), 0, out.size() * sizeof(math_t), resource::get_cuda_stream(handle))); + out.data_handle(), 0, out.size() * sizeof(math_t), resource::get_cuda_stream(handle).get())); raft::matrix::fill(handle, diag.view(), math_t(1)); set_diagonal(handle, raft::make_const_mdspan(diag.view()), out); } diff --git a/cpp/include/raft/matrix/gather.cuh b/cpp/include/raft/matrix/gather.cuh index fac067fb34..7e259fca96 100644 --- a/cpp/include/raft/matrix/gather.cuh +++ b/cpp/include/raft/matrix/gather.cuh @@ -224,7 +224,7 @@ void gather(const raft::resources& handle, map.extent(0), out.data_handle(), transform_op, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -271,7 +271,7 @@ void gather( map.extent(0), out.data_handle(), transform_op, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -329,7 +329,7 @@ void gather_if(const raft::resources& handle, out.data_handle(), pred_op, transform_op, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -386,7 +386,7 @@ void gather_if(const raft::resources& handle, out.data_handle(), pred_op, transform_op, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** diff --git a/cpp/include/raft/matrix/init.cuh b/cpp/include/raft/matrix/init.cuh index 59ead74c71..53532de7fa 100644 --- a/cpp/include/raft/matrix/init.cuh +++ b/cpp/include/raft/matrix/init.cuh @@ -45,7 +45,7 @@ void fill(raft::resources const& handle, in.data_handle(), *(scalar.data_handle()), in.size(), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** diff --git a/cpp/include/raft/matrix/linewise_op.cuh b/cpp/include/raft/matrix/linewise_op.cuh index 519798ceca..6e34b0fae6 100644 --- a/cpp/include/raft/matrix/linewise_op.cuh +++ b/cpp/include/raft/matrix/linewise_op.cuh @@ -82,7 +82,7 @@ void linewise_op(raft::resources const& handle, lineLen, nLines, op, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), vecs.data_handle()...); } @@ -113,7 +113,7 @@ void linewise_op(raft::resources const& handle, "Input and output must have the same shape."); detail::MatrixLinewiseOp<16, 256>::runPadded( - out, in, lineLen, nLines, op, resource::get_cuda_stream(handle), vecs.data_handle()...); + out, in, lineLen, nLines, op, resource::get_cuda_stream(handle).get(), vecs.data_handle()...); } /** @} */ // end of group linewise_op diff --git a/cpp/include/raft/matrix/norm.cuh b/cpp/include/raft/matrix/norm.cuh index 16a98c28b6..412033900c 100644 --- a/cpp/include/raft/matrix/norm.cuh +++ b/cpp/include/raft/matrix/norm.cuh @@ -29,7 +29,7 @@ template m_t l2_norm(raft::resources const& handle, raft::device_mdspan in) { if (resource::get_dry_run_flag(handle)) { return {}; } - return detail::getL2Norm(handle, in.data_handle(), in.size(), resource::get_cuda_stream(handle)); + return detail::getL2Norm(handle, in.data_handle(), in.size(), resource::get_cuda_stream(handle).get()); } /** @} */ // end of group matrix_norm diff --git a/cpp/include/raft/matrix/power.cuh b/cpp/include/raft/matrix/power.cuh index bf6b9f9e0a..c933682fd4 100644 --- a/cpp/include/raft/matrix/power.cuh +++ b/cpp/include/raft/matrix/power.cuh @@ -71,7 +71,7 @@ template void power(raft::resources const& handle, raft::device_matrix_view inout) { if (resource::get_dry_run_flag(handle)) { return; } - detail::power(inout.data_handle(), inout.size(), resource::get_cuda_stream(handle)); + detail::power(inout.data_handle(), inout.size(), resource::get_cuda_stream(handle).get()); } /** diff --git a/cpp/include/raft/matrix/ratio.cuh b/cpp/include/raft/matrix/ratio.cuh index 043affc8f7..0a872ff2bd 100644 --- a/cpp/include/raft/matrix/ratio.cuh +++ b/cpp/include/raft/matrix/ratio.cuh @@ -34,7 +34,7 @@ void ratio(raft::resources const& handle, { RAFT_EXPECTS(src.size() == dest.size(), "Input and output matrices must be the same size."); detail::ratio( - handle, src.data_handle(), dest.data_handle(), src.size(), resource::get_cuda_stream(handle)); + handle, src.data_handle(), dest.data_handle(), src.size(), resource::get_cuda_stream(handle).get()); } /** @@ -52,7 +52,7 @@ void ratio(raft::resources const& handle, raft::device_matrix_view(inout.data_handle(), *(scalar.data_handle()), inout.size(), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), setzero, thres); } diff --git a/cpp/include/raft/matrix/reverse.cuh b/cpp/include/raft/matrix/reverse.cuh index 43df8ccc0d..a06558fd7a 100644 --- a/cpp/include/raft/matrix/reverse.cuh +++ b/cpp/include/raft/matrix/reverse.cuh @@ -34,10 +34,10 @@ void col_reverse(raft::resources const& handle, RAFT_EXPECTS(raft::is_row_or_column_major(inout), "Unsupported matrix layout"); if (raft::is_col_major(inout)) { detail::colReverse( - inout.data_handle(), inout.extent(0), inout.extent(1), resource::get_cuda_stream(handle)); + inout.data_handle(), inout.extent(0), inout.extent(1), resource::get_cuda_stream(handle).get()); } else { detail::rowReverse( - inout.data_handle(), inout.extent(1), inout.extent(0), resource::get_cuda_stream(handle)); + inout.data_handle(), inout.extent(1), inout.extent(0), resource::get_cuda_stream(handle).get()); } } @@ -55,10 +55,10 @@ void row_reverse(raft::resources const& handle, RAFT_EXPECTS(raft::is_row_or_column_major(inout), "Unsupported matrix layout"); if (raft::is_col_major(inout)) { detail::rowReverse( - inout.data_handle(), inout.extent(0), inout.extent(1), resource::get_cuda_stream(handle)); + inout.data_handle(), inout.extent(0), inout.extent(1), resource::get_cuda_stream(handle).get()); } else { detail::colReverse( - inout.data_handle(), inout.extent(1), inout.extent(0), resource::get_cuda_stream(handle)); + inout.data_handle(), inout.extent(1), inout.extent(0), resource::get_cuda_stream(handle).get()); } } /** @} */ // end group matrix_reverse diff --git a/cpp/include/raft/matrix/sign_flip.cuh b/cpp/include/raft/matrix/sign_flip.cuh index 2ee230f207..4514e21a6d 100644 --- a/cpp/include/raft/matrix/sign_flip.cuh +++ b/cpp/include/raft/matrix/sign_flip.cuh @@ -33,7 +33,7 @@ void sign_flip(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::signFlip( - inout.data_handle(), inout.extent(0), inout.extent(1), resource::get_cuda_stream(handle)); + inout.data_handle(), inout.extent(0), inout.extent(1), resource::get_cuda_stream(handle).get()); } /** @} */ // end group matrix_sign_flip diff --git a/cpp/include/raft/matrix/slice.cuh b/cpp/include/raft/matrix/slice.cuh index f93f92300e..750280d856 100644 --- a/cpp/include/raft/matrix/slice.cuh +++ b/cpp/include/raft/matrix/slice.cuh @@ -68,7 +68,7 @@ void slice(raft::resources const& handle, coords.row2, coords.col2, raft::is_row_major(in), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group matrix_slice diff --git a/cpp/include/raft/matrix/sqrt.cuh b/cpp/include/raft/matrix/sqrt.cuh index 262df7ef1b..ebc0f8507b 100644 --- a/cpp/include/raft/matrix/sqrt.cuh +++ b/cpp/include/raft/matrix/sqrt.cuh @@ -37,7 +37,7 @@ void sqrt(raft::resources const& handle, if (resource::get_dry_run_flag(handle)) { return; } RAFT_EXPECTS(in.size() == out.size(), "Input and output matrices must have same size."); detail::seqRoot( - in.data_handle(), out.data_handle(), in.size(), resource::get_cuda_stream(handle)); + in.data_handle(), out.data_handle(), in.size(), resource::get_cuda_stream(handle).get()); } /** @@ -52,7 +52,7 @@ template void sqrt(raft::resources const& handle, raft::device_matrix_view inout) { if (resource::get_dry_run_flag(handle)) { return; } - detail::seqRoot(inout.data_handle(), inout.size(), resource::get_cuda_stream(handle)); + detail::seqRoot(inout.data_handle(), inout.size(), resource::get_cuda_stream(handle).get()); } /** @@ -79,7 +79,7 @@ void weighted_sqrt(raft::resources const& handle, out.data_handle(), *(scalar.data_handle()), in.size(), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), set_neg_zero); } @@ -103,7 +103,7 @@ void weighted_sqrt(raft::resources const& handle, detail::seqRoot(inout.data_handle(), *(scalar.data_handle()), inout.size(), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), set_neg_zero); } diff --git a/cpp/include/raft/matrix/threshold.cuh b/cpp/include/raft/matrix/threshold.cuh index 69c15ab080..ee882198c0 100644 --- a/cpp/include/raft/matrix/threshold.cuh +++ b/cpp/include/raft/matrix/threshold.cuh @@ -38,7 +38,7 @@ void zero_small_values(raft::resources const& handle, if (resource::get_dry_run_flag(handle)) { return; } RAFT_EXPECTS(in.size() == out.size(), "Input and output matrices must have same size"); detail::setSmallValuesZero( - out.data_handle(), in.data_handle(), in.size(), resource::get_cuda_stream(handle), thres); + out.data_handle(), in.data_handle(), in.size(), resource::get_cuda_stream(handle).get(), thres); } /** @@ -57,7 +57,7 @@ void zero_small_values(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::setSmallValuesZero( - inout.data_handle(), inout.size(), resource::get_cuda_stream(handle), thres); + inout.data_handle(), inout.size(), resource::get_cuda_stream(handle).get(), thres); } /** @} */ // end group matrix_threshold diff --git a/cpp/include/raft/matrix/triangular.cuh b/cpp/include/raft/matrix/triangular.cuh index e6d0b6a72e..b0a84c7c98 100644 --- a/cpp/include/raft/matrix/triangular.cuh +++ b/cpp/include/raft/matrix/triangular.cuh @@ -38,7 +38,7 @@ void upper_triangular(raft::resources const& handle, dst.data_handle(), src.extent(0), src.extent(1), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group matrix_triangular diff --git a/cpp/include/raft/mr/dry_run_resource.hpp b/cpp/include/raft/mr/dry_run_resource.hpp index 9e0abe3615..ec61ac4de5 100644 --- a/cpp/include/raft/mr/dry_run_resource.hpp +++ b/cpp/include/raft/mr/dry_run_resource.hpp @@ -5,7 +5,7 @@ #pragma once #include -#include +#include #include #include diff --git a/cpp/include/raft/mr/notifying_adaptor.hpp b/cpp/include/raft/mr/notifying_adaptor.hpp index 09be7f3895..db5673d039 100644 --- a/cpp/include/raft/mr/notifying_adaptor.hpp +++ b/cpp/include/raft/mr/notifying_adaptor.hpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/include/raft/mr/statistics_adaptor.hpp b/cpp/include/raft/mr/statistics_adaptor.hpp index 40959be8fc..5e32183beb 100644 --- a/cpp/include/raft/mr/statistics_adaptor.hpp +++ b/cpp/include/raft/mr/statistics_adaptor.hpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/include/raft/random/detail/multi_variable_gaussian.cuh b/cpp/include/raft/random/detail/multi_variable_gaussian.cuh index bf9df1eaee..95f4c3120d 100644 --- a/cpp/include/raft/random/detail/multi_variable_gaussian.cuh +++ b/cpp/include/raft/random/detail/multi_variable_gaussian.cuh @@ -192,7 +192,7 @@ class multi_variable_gaussian_impl { { if (resource::get_dry_run_flag(handle)) { return; } auto cusolverHandle = resource::get_cusolver_dn_handle(handle); - auto cudaStream = resource::get_cuda_stream(handle); + auto cudaStream = resource::get_cuda_stream(handle).get(); if (method == chol_decomp) { // lower part will contains chol_decomp RAFT_CUSOLVER_TRY(raft::linalg::detail::cusolverDnpotrf( diff --git a/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh b/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh index a4e2e70219..c04e013a5f 100644 --- a/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh +++ b/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh @@ -264,7 +264,7 @@ void rmat_rectangular_gen_impl(raft::resources const& handle, r_scale, c_scale, n_edges, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), r); } @@ -313,7 +313,7 @@ void rmat_rectangular_gen_impl(raft::resources const& handle, r_scale, c_scale, n_edges, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), r); } diff --git a/cpp/include/raft/random/detail/rng_impl.cuh b/cpp/include/raft/random/detail/rng_impl.cuh index c763aec29f..009d88da66 100644 --- a/cpp/include/raft/random/detail/rng_impl.cuh +++ b/cpp/include/raft/random/detail/rng_impl.cuh @@ -402,7 +402,7 @@ auto excess_subsample(raft::resources const& res, RngState& state, IdxT N, IdxT n_excess_samples += std::max(0.1 * n_samples, 100); bool dry_run = resource::get_dry_run_flag(res); - auto stream = resource::get_cuda_stream(res); + auto stream = resource::get_cuda_stream(res).get(); while (true) { // n_excess_sampless will be larger than N around k = 0.64*N. When we reach N, then instead of diff --git a/cpp/include/raft/random/make_blobs.cuh b/cpp/include/raft/random/make_blobs.cuh index e3cef05e32..9bb1f29a8d 100644 --- a/cpp/include/raft/random/make_blobs.cuh +++ b/cpp/include/raft/random/make_blobs.cuh @@ -165,7 +165,7 @@ void make_blobs( (IdxT)out.extent(0), (IdxT)out.extent(1), n_clusters, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), row_major, prm_centers, prm_cluster_std, diff --git a/cpp/include/raft/random/permute.cuh b/cpp/include/raft/random/permute.cuh index f312b80f52..eef03718e1 100644 --- a/cpp/include/raft/random/permute.cuh +++ b/cpp/include/raft/random/permute.cuh @@ -131,7 +131,7 @@ void permute(raft::resources const& handle, D, N, is_row_major, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), key); } } diff --git a/cpp/include/raft/random/rng.cuh b/cpp/include/raft/random/rng.cuh index 22be890543..740a100225 100644 --- a/cpp/include/raft/random/rng.cuh +++ b/cpp/include/raft/random/rng.cuh @@ -49,7 +49,7 @@ void uniform(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::uniform( - rng_state, out.data_handle(), out.extent(0), start, end, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), start, end, resource::get_cuda_stream(handle).get()); } /** @@ -77,7 +77,7 @@ void uniform(raft::resources const& handle, OutType end) { if (resource::get_dry_run_flag(handle)) { return; } - detail::uniform(rng_state, ptr, len, start, end, resource::get_cuda_stream(handle)); + detail::uniform(rng_state, ptr, len, start, end, resource::get_cuda_stream(handle).get()); } /** @@ -108,7 +108,7 @@ void uniformInt(raft::resources const& handle, static_assert(std::is_integral::value, "uniformInt: The elements of the output vector must have integral type."); detail::uniformInt( - rng_state, out.data_handle(), out.extent(0), start, end, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), start, end, resource::get_cuda_stream(handle).get()); } /** @@ -132,7 +132,7 @@ void uniformInt(raft::resources const& handle, OutType end) { if (resource::get_dry_run_flag(handle)) { return; } - detail::uniformInt(rng_state, ptr, len, start, end, resource::get_cuda_stream(handle)); + detail::uniformInt(rng_state, ptr, len, start, end, resource::get_cuda_stream(handle).get()); } /** @@ -158,7 +158,7 @@ void normal(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::normal( - rng_state, out.data_handle(), out.extent(0), mu, sigma, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), mu, sigma, resource::get_cuda_stream(handle).get()); } /** @@ -182,7 +182,7 @@ void normal(raft::resources const& handle, OutType sigma) { if (resource::get_dry_run_flag(handle)) { return; } - detail::normal(rng_state, ptr, len, mu, sigma, resource::get_cuda_stream(handle)); + detail::normal(rng_state, ptr, len, mu, sigma, resource::get_cuda_stream(handle).get()); } /** @@ -214,7 +214,7 @@ void normalInt(raft::resources const& handle, "normalInt: The output vector's value type must be an integer."); detail::normalInt( - rng_state, out.data_handle(), out.extent(0), mu, sigma, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), mu, sigma, resource::get_cuda_stream(handle).get()); } /** @@ -238,7 +238,7 @@ void normalInt(raft::resources const& handle, IntType sigma) { if (resource::get_dry_run_flag(handle)) { return; } - detail::normalInt(rng_state, ptr, len, mu, sigma, resource::get_cuda_stream(handle)); + detail::normalInt(rng_state, ptr, len, mu, sigma, resource::get_cuda_stream(handle).get()); } /** @@ -304,7 +304,7 @@ void normalTable( mu_vec.data_handle(), sigma_vec_ptr, sigma_value, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -339,7 +339,7 @@ void normalTable(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::normalTable( - rng_state, ptr, n_rows, n_cols, mu_vec, sigma_vec, sigma, resource::get_cuda_stream(handle)); + rng_state, ptr, n_rows, n_cols, mu_vec, sigma_vec, sigma, resource::get_cuda_stream(handle).get()); } /** @@ -361,7 +361,7 @@ void fill(raft::resources const& handle, raft::device_vector_view out) { if (resource::get_dry_run_flag(handle)) { return; } - detail::fill(rng_state, out.data_handle(), out.extent(0), val, resource::get_cuda_stream(handle)); + detail::fill(rng_state, out.data_handle(), out.extent(0), val, resource::get_cuda_stream(handle).get()); } /** @@ -380,7 +380,7 @@ void fill( raft::resources const& handle, RngState& rng_state, OutType* ptr, LenType len, OutType val) { if (resource::get_dry_run_flag(handle)) { return; } - detail::fill(rng_state, ptr, len, val, resource::get_cuda_stream(handle)); + detail::fill(rng_state, ptr, len, val, resource::get_cuda_stream(handle).get()); } /** @@ -405,7 +405,7 @@ void bernoulli(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::bernoulli( - rng_state, out.data_handle(), out.extent(0), prob, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), prob, resource::get_cuda_stream(handle).get()); } /** @@ -426,7 +426,7 @@ void bernoulli( raft::resources const& handle, RngState& rng_state, OutType* ptr, LenType len, Type prob) { if (resource::get_dry_run_flag(handle)) { return; } - detail::bernoulli(rng_state, ptr, len, prob, resource::get_cuda_stream(handle)); + detail::bernoulli(rng_state, ptr, len, prob, resource::get_cuda_stream(handle).get()); } /** @@ -451,7 +451,7 @@ void scaled_bernoulli(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::scaled_bernoulli( - rng_state, out.data_handle(), out.extent(0), prob, scale, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), prob, scale, resource::get_cuda_stream(handle).get()); } /** @@ -475,7 +475,7 @@ void scaled_bernoulli(raft::resources const& handle, OutType scale) { if (resource::get_dry_run_flag(handle)) { return; } - detail::scaled_bernoulli(rng_state, ptr, len, prob, scale, resource::get_cuda_stream(handle)); + detail::scaled_bernoulli(rng_state, ptr, len, prob, scale, resource::get_cuda_stream(handle).get()); } /** @@ -501,7 +501,7 @@ void gumbel(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::gumbel( - rng_state, out.data_handle(), out.extent(0), mu, beta, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), mu, beta, resource::get_cuda_stream(handle).get()); } /** @@ -526,7 +526,7 @@ void gumbel(raft::resources const& handle, OutType beta) { if (resource::get_dry_run_flag(handle)) { return; } - detail::gumbel(rng_state, ptr, len, mu, beta, resource::get_cuda_stream(handle)); + detail::gumbel(rng_state, ptr, len, mu, beta, resource::get_cuda_stream(handle).get()); } /** @@ -551,7 +551,7 @@ void lognormal(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::lognormal( - rng_state, out.data_handle(), out.extent(0), mu, sigma, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), mu, sigma, resource::get_cuda_stream(handle).get()); } /** @@ -575,7 +575,7 @@ void lognormal(raft::resources const& handle, OutType sigma) { if (resource::get_dry_run_flag(handle)) { return; } - detail::lognormal(rng_state, ptr, len, mu, sigma, resource::get_cuda_stream(handle)); + detail::lognormal(rng_state, ptr, len, mu, sigma, resource::get_cuda_stream(handle).get()); } /** @@ -600,7 +600,7 @@ void logistic(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::logistic( - rng_state, out.data_handle(), out.extent(0), mu, scale, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), mu, scale, resource::get_cuda_stream(handle).get()); } /** @@ -624,7 +624,7 @@ void logistic(raft::resources const& handle, OutType scale) { if (resource::get_dry_run_flag(handle)) { return; } - detail::logistic(rng_state, ptr, len, mu, scale, resource::get_cuda_stream(handle)); + detail::logistic(rng_state, ptr, len, mu, scale, resource::get_cuda_stream(handle).get()); } /** @@ -647,7 +647,7 @@ void exponential(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::exponential( - rng_state, out.data_handle(), out.extent(0), lambda, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), lambda, resource::get_cuda_stream(handle).get()); } /** @@ -666,7 +666,7 @@ void exponential( raft::resources const& handle, RngState& rng_state, OutType* ptr, LenType len, OutType lambda) { if (resource::get_dry_run_flag(handle)) { return; } - detail::exponential(rng_state, ptr, len, lambda, resource::get_cuda_stream(handle)); + detail::exponential(rng_state, ptr, len, lambda, resource::get_cuda_stream(handle).get()); } /** @@ -689,7 +689,7 @@ void rayleigh(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::rayleigh( - rng_state, out.data_handle(), out.extent(0), sigma, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), sigma, resource::get_cuda_stream(handle).get()); } /** @@ -708,7 +708,7 @@ void rayleigh( raft::resources const& handle, RngState& rng_state, OutType* ptr, LenType len, OutType sigma) { if (resource::get_dry_run_flag(handle)) { return; } - detail::rayleigh(rng_state, ptr, len, sigma, resource::get_cuda_stream(handle)); + detail::rayleigh(rng_state, ptr, len, sigma, resource::get_cuda_stream(handle).get()); } /** * @ingroup univariate_random_sampling @@ -732,7 +732,7 @@ void laplace(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } detail::laplace( - rng_state, out.data_handle(), out.extent(0), mu, scale, resource::get_cuda_stream(handle)); + rng_state, out.data_handle(), out.extent(0), mu, scale, resource::get_cuda_stream(handle).get()); } /** @@ -756,7 +756,7 @@ void laplace(raft::resources const& handle, OutType scale) { if (resource::get_dry_run_flag(handle)) { return; } - detail::laplace(rng_state, ptr, len, mu, scale, resource::get_cuda_stream(handle)); + detail::laplace(rng_state, ptr, len, mu, scale, resource::get_cuda_stream(handle).get()); } /** @@ -798,7 +798,7 @@ std::enable_if_t> discrete( weights.data_handle(), out.extent(0), weights.extent(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -838,7 +838,7 @@ void sampleWithoutReplacement(raft::resources const& handle, wts, sampledLen, len, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @brief Sample from range 0..N-1. diff --git a/cpp/include/raft/random/sample_without_replacement.cuh b/cpp/include/raft/random/sample_without_replacement.cuh index efa70d6509..7363d08505 100644 --- a/cpp/include/raft/random/sample_without_replacement.cuh +++ b/cpp/include/raft/random/sample_without_replacement.cuh @@ -140,7 +140,7 @@ void sample_without_replacement(raft::resources const& handle, wts_ptr, sampledLen, len, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** diff --git a/cpp/include/raft/solver/linear_assignment.cuh b/cpp/include/raft/solver/linear_assignment.cuh index 0e3d184f08..306595f950 100644 --- a/cpp/include/raft/solver/linear_assignment.cuh +++ b/cpp/include/raft/solver/linear_assignment.cuh @@ -178,7 +178,7 @@ class LinearAssignmentProblem { weight_t result; raft::update_host( &result, obj_val_primal_v.data() + spId, 1, resource::get_cuda_stream(handle_)); - RAFT_CHECK_CUDA(resource::get_cuda_stream(handle_)); + RAFT_CHECK_CUDA(resource::get_cuda_stream(handle_).get()); return result; } @@ -191,7 +191,7 @@ class LinearAssignmentProblem { { weight_t result; raft::update_host(&result, obj_val_dual_v.data() + spId, 1, resource::get_cuda_stream(handle_)); - RAFT_CHECK_CUDA(resource::get_cuda_stream(handle_)); + RAFT_CHECK_CUDA(resource::get_cuda_stream(handle_).get()); return result; } @@ -199,7 +199,7 @@ class LinearAssignmentProblem { // Helper function for initializing global variables and arrays on a single host. void initializeDevice() { - cudaStream_t stream = resource::get_cuda_stream(handle_); + cudaStream_t stream = resource::get_cuda_stream(handle_).get(); row_covers_v.resize(batchsize_ * size_, stream); col_covers_v.resize(batchsize_ * size_, stream); row_duals_v.resize(batchsize_ * size_, stream); diff --git a/cpp/include/raft/sparse/convert/detail/adj_to_csr.cuh b/cpp/include/raft/sparse/convert/detail/adj_to_csr.cuh index c9eaa724cb..715004c741 100644 --- a/cpp/include/raft/sparse/convert/detail/adj_to_csr.cuh +++ b/cpp/include/raft/sparse/convert/detail/adj_to_csr.cuh @@ -134,7 +134,7 @@ void adj_to_csr(raft::resources const& handle, { if (resource::get_dry_run_flag(handle)) { return; } // No allocations below - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); // Check inputs and return early if possible. if (num_rows == 0 || num_cols == 0) { return; } diff --git a/cpp/include/raft/sparse/convert/detail/bitmap_to_csr.cuh b/cpp/include/raft/sparse/convert/detail/bitmap_to_csr.cuh index 13c2f3e332..dd7e0ec0d5 100644 --- a/cpp/include/raft/sparse/convert/detail/bitmap_to_csr.cuh +++ b/cpp/include/raft/sparse/convert/detail/bitmap_to_csr.cuh @@ -296,7 +296,7 @@ void bitmap_to_csr(raft::resources const& handle, if (csr_view.get_n_rows() == 0 || csr_view.get_n_cols() == 0) { return; } auto thrust_policy = resource::get_thrust_policy(handle); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); index_t* indptr = csr_view.get_indptr().data(); index_t* indices = csr_view.get_indices().data(); diff --git a/cpp/include/raft/sparse/convert/detail/bitset_to_csr.cuh b/cpp/include/raft/sparse/convert/detail/bitset_to_csr.cuh index 8800a59014..b3de19a95b 100644 --- a/cpp/include/raft/sparse/convert/detail/bitset_to_csr.cuh +++ b/cpp/include/raft/sparse/convert/detail/bitset_to_csr.cuh @@ -102,7 +102,7 @@ void bitset_to_csr(raft::resources const& handle, if (csr_view.get_n_rows() == 0 || csr_view.get_n_cols() == 0) { return; } auto thrust_policy = resource::get_thrust_policy(handle); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); index_t* indptr = csr_view.get_indptr().data(); index_t* indices = csr_view.get_indices().data(); diff --git a/cpp/include/raft/sparse/convert/detail/csr.cuh b/cpp/include/raft/sparse/convert/detail/csr.cuh index 1e5bc4a7ea..f5eb58bbaf 100644 --- a/cpp/include/raft/sparse/convert/detail/csr.cuh +++ b/cpp/include/raft/sparse/convert/detail/csr.cuh @@ -46,7 +46,7 @@ void coo_to_csr(raft::resources const& handle, int* dstCols, value_t* dstVals) { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto cusparseHandle = resource::get_cusparse_handle(handle); rmm::device_uvector dstRows(nnz, stream); diff --git a/cpp/include/raft/sparse/linalg/detail/sddmm.hpp b/cpp/include/raft/sparse/linalg/detail/sddmm.hpp index 8c2325d0cf..a1d52ca960 100644 --- a/cpp/include/raft/sparse/linalg/detail/sddmm.hpp +++ b/cpp/include/raft/sparse/linalg/detail/sddmm.hpp @@ -61,7 +61,7 @@ void sddmm(raft::resources const& handle, descr_c, alg, &bufferSize, - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); resource::sync_stream(handle); @@ -79,7 +79,7 @@ void sddmm(raft::resources const& handle, descr_c, alg, reinterpret_cast(tmp.data()), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } } // end namespace detail diff --git a/cpp/include/raft/sparse/linalg/detail/spmm.hpp b/cpp/include/raft/sparse/linalg/detail/spmm.hpp index 3e27221839..111115b330 100644 --- a/cpp/include/raft/sparse/linalg/detail/spmm.hpp +++ b/cpp/include/raft/sparse/linalg/detail/spmm.hpp @@ -85,7 +85,7 @@ void spmm(raft::resources const& handle, descr_z, alg, &bufferSize, - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); resource::sync_stream(handle); @@ -104,7 +104,7 @@ void spmm(raft::resources const& handle, descr_z, alg, reinterpret_cast(tmp.data()), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } } // end namespace detail diff --git a/cpp/include/raft/sparse/linalg/detail/symmetrize.cuh b/cpp/include/raft/sparse/linalg/detail/symmetrize.cuh index 75a8aec8aa..730ba244f0 100644 --- a/cpp/include/raft/sparse/linalg/detail/symmetrize.cuh +++ b/cpp/include/raft/sparse/linalg/detail/symmetrize.cuh @@ -176,7 +176,7 @@ void coo_symmetrize(raft::resources const& handle, raft::device_coo_matrix& out, Lambda reduction_op) // two-argument reducer { - auto stream = raft::resource::get_cuda_stream(handle); + auto stream = raft::resource::get_cuda_stream(handle).get(); auto in_structure = in.structure_view(); diff --git a/cpp/include/raft/sparse/linalg/norm.cuh b/cpp/include/raft/sparse/linalg/norm.cuh index 1edfcdaac8..530d9996e7 100644 --- a/cpp/include/raft/sparse/linalg/norm.cuh +++ b/cpp/include/raft/sparse/linalg/norm.cuh @@ -87,7 +87,7 @@ void rowNormCsr(raft::resources const& handle, raft::linalg::NormType type, Lambda fin_op = raft::identity_op()) { - detail::rowNormCsrCaller(ia, data, nnz, N, norm, type, fin_op, resource::get_cuda_stream(handle)); + detail::rowNormCsrCaller(ia, data, nnz, N, norm, type, fin_op, resource::get_cuda_stream(handle).get()); } }; // end NAMESPACE linalg diff --git a/cpp/include/raft/sparse/matrix/detail/preprocessing.cuh b/cpp/include/raft/sparse/matrix/detail/preprocessing.cuh index 056c76ac12..019d7646d6 100644 --- a/cpp/include/raft/sparse/matrix/detail/preprocessing.cuh +++ b/cpp/include/raft/sparse/matrix/detail/preprocessing.cuh @@ -127,7 +127,7 @@ void fit_bm25(raft::resources const& handle, int& fullFeatCount, raft::device_vector_view rowFeatCnts) { - cudaStream_t stream = raft::resource::get_cuda_stream(handle); + cudaStream_t stream = raft::resource::get_cuda_stream(handle).get(); rmm::device_uvector temp_unique_rows(0, stream); int uniq_cnt = raft::label::getUniquelabels(handle, temp_unique_rows, rows, nnz); diff --git a/cpp/include/raft/sparse/matrix/preprocessing.cuh b/cpp/include/raft/sparse/matrix/preprocessing.cuh index 2fb3ed5f81..d56aafa6f6 100644 --- a/cpp/include/raft/sparse/matrix/preprocessing.cuh +++ b/cpp/include/raft/sparse/matrix/preprocessing.cuh @@ -110,7 +110,7 @@ void encode_bm25(raft::resources const& handle, float k_param = 1.6f, float b_param = 0.75f) { - cudaStream_t stream = raft::resource::get_cuda_stream(handle); + cudaStream_t stream = raft::resource::get_cuda_stream(handle).get(); // auto coo_in = detail::create_coo_from_csr(handle, csr_in); auto num_cols = csr_in.structure_view().get_n_cols(); auto num_rows = csr_in.structure_view().get_n_rows(); diff --git a/cpp/include/raft/sparse/op/detail/filter.cuh b/cpp/include/raft/sparse/op/detail/filter.cuh index 40c1717f70..6ef1360c34 100644 --- a/cpp/include/raft/sparse/op/detail/filter.cuh +++ b/cpp/include/raft/sparse/op/detail/filter.cuh @@ -203,7 +203,7 @@ void coo_remove_scalar(raft::resources const& handle, raft::host_scalar_view scalar, raft::device_coo_matrix& out) { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto in_structure = in.structure_view(); diff --git a/cpp/include/raft/sparse/op/detail/reduce.cuh b/cpp/include/raft/sparse/op/detail/reduce.cuh index de04fb1492..f4d1f8ff3d 100644 --- a/cpp/include/raft/sparse/op/detail/reduce.cuh +++ b/cpp/include/raft/sparse/op/detail/reduce.cuh @@ -133,7 +133,7 @@ void max_duplicates(raft::resources const& handle, value_idx m, value_idx n) { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto thrust_policy = resource::get_thrust_policy(handle); // compute diffs & take exclusive scan diff --git a/cpp/include/raft/sparse/op/sort.cuh b/cpp/include/raft/sparse/op/sort.cuh index 6f7780e7f0..c55a0eb0cc 100644 --- a/cpp/include/raft/sparse/op/sort.cuh +++ b/cpp/include/raft/sparse/op/sort.cuh @@ -58,7 +58,7 @@ void coo_sort( rows, cols, vals, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** diff --git a/cpp/include/raft/sparse/solver/detail/cholesky_qr.cuh b/cpp/include/raft/sparse/solver/detail/cholesky_qr.cuh index 24f7c4b8f4..01e54102cc 100644 --- a/cpp/include/raft/sparse/solver/detail/cholesky_qr.cuh +++ b/cpp/include/raft/sparse/solver/detail/cholesky_qr.cuh @@ -41,7 +41,7 @@ bool cholesky_qr_pass(raft::resources const& handle, int workspace_size, int* dev_info) { - auto stream = raft::resource::get_cuda_stream(handle); + auto stream = raft::resource::get_cuda_stream(handle).get(); auto cublas_h = raft::resource::get_cublas_handle(handle); auto cusolver_h = raft::resource::get_cusolver_dn_handle(handle); @@ -122,7 +122,7 @@ bool cholesky_qr2(raft::resources const& handle, int m = Q.extent(0); int k = Q.extent(1); - auto stream = raft::resource::get_cuda_stream(handle); + auto stream = raft::resource::get_cuda_stream(handle).get(); auto cusolver_h = raft::resource::get_cusolver_dn_handle(handle); // Allocate workspace for Gram matrix and Cholesky diff --git a/cpp/include/raft/sparse/solver/detail/lanczos.cuh b/cpp/include/raft/sparse/solver/detail/lanczos.cuh index ae576a6907..bd14b5c6bb 100644 --- a/cpp/include/raft/sparse/solver/detail/lanczos.cuh +++ b/cpp/include/raft/sparse/solver/detail/lanczos.cuh @@ -285,7 +285,7 @@ void lanczos_aux(raft::resources const& handle, } else { spmv_alg = CUSPARSE_SPMV_ALG_DEFAULT; } - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); bool const is_dry_run = resource::get_dry_run_flag(handle); IndexTypeT n = A.structure_view().get_n_rows(); @@ -469,7 +469,7 @@ auto lanczos_smallest(raft::resources const& handle, } int n = A.structure_view().get_n_rows(); int ncv = restartIter; - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); bool is_dry_run = resource::get_dry_run_flag(handle); auto V = raft::make_device_matrix(handle, ncv, n); diff --git a/cpp/include/raft/sparse/solver/detail/lanczos_svds.cuh b/cpp/include/raft/sparse/solver/detail/lanczos_svds.cuh index e77a2ba8b2..200f09853b 100644 --- a/cpp/include/raft/sparse/solver/detail/lanczos_svds.cuh +++ b/cpp/include/raft/sparse/solver/detail/lanczos_svds.cuh @@ -99,7 +99,7 @@ void cgs2_orthogonalize(raft::resources const& handle, common::nvtx::range scope("lanczos_svds::cgs2_orthogonalize"); if (n_valid <= 0) { return; } - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); ValueTypeT one = ValueTypeT(1); ValueTypeT zero = ValueTypeT(0); @@ -364,7 +364,7 @@ void compute_ritz_vectors(raft::resources const& handle, std::vector& locked_singular_values) { common::nvtx::range scope("lanczos_svds::compute_ritz_vectors"); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); int num_found = static_cast(indices.size()); if (num_found == 0) { return; } @@ -469,7 +469,7 @@ void compute_restart_vector(raft::resources const& handle, ValueTypeT* v_start) { common::nvtx::range scope("lanczos_svds::compute_restart_vector"); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto d_coeffs = raft::make_device_vector(handle, static_cast(n_cols)); raft::copy(handle, @@ -599,7 +599,7 @@ void sparse_lanczos_svd( ncv = std::min(ncv, min_dim - 1); RAFT_EXPECTS(ncv >= k, "ncv must be at least n_components after clamping"); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); uint64_t seed = config.seed.value_or(std::random_device{}()); raft::random::RngState rng_state(seed); diff --git a/cpp/include/raft/sparse/solver/detail/randomized_svds.cuh b/cpp/include/raft/sparse/solver/detail/randomized_svds.cuh index 53e3a05ffb..ace5c7af35 100644 --- a/cpp/include/raft/sparse/solver/detail/randomized_svds.cuh +++ b/cpp/include/raft/sparse/solver/detail/randomized_svds.cuh @@ -87,7 +87,7 @@ void sparse_randomized_svd( "Vt must have shape (n_components, n)"); } - auto stream = raft::resource::get_cuda_stream(handle); + auto stream = raft::resource::get_cuda_stream(handle).get(); int min_dim = std::min(m, n); if (k + p > min_dim) { diff --git a/cpp/include/raft/spectral/detail/matrix_wrappers.hpp b/cpp/include/raft/spectral/detail/matrix_wrappers.hpp index a9fa8a6d4c..c5667fc078 100644 --- a/cpp/include/raft/spectral/detail/matrix_wrappers.hpp +++ b/cpp/include/raft/spectral/detail/matrix_wrappers.hpp @@ -223,7 +223,7 @@ struct sparse_matrix_t { RAFT_EXPECTS(y != nullptr, "Null y buffer."); auto cusparse_h = resource::get_cusparse_handle(handle_); - auto stream = resource::get_cuda_stream(handle_); + auto stream = resource::get_cuda_stream(handle_).get(); bool is_dry_run = resource::get_dry_run_flag(handle_); cusparseOperation_t trans = transpose ? CUSPARSE_OPERATION_TRANSPOSE : // transpose @@ -393,7 +393,7 @@ struct laplacian_matrix_t : sparse_matrix_t { auto handle = sparse_matrix_t::get_handle(); auto cublas_h = resource::get_cublas_handle(handle); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); bool is_dry_run = resource::get_dry_run_flag(handle); // scales y by beta: @@ -459,7 +459,7 @@ struct modularity_matrix_t : laplacian_matrix_t::get_handle(); auto cublas_h = resource::get_cublas_handle(handle); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); bool is_dry_run = resource::get_dry_run_flag(handle); // y = A*x diff --git a/cpp/include/raft/spectral/detail/modularity_maximization.hpp b/cpp/include/raft/spectral/detail/modularity_maximization.hpp index 3f496d9b06..fa4b00ca83 100644 --- a/cpp/include/raft/spectral/detail/modularity_maximization.hpp +++ b/cpp/include/raft/spectral/detail/modularity_maximization.hpp @@ -56,7 +56,7 @@ void analyzeModularity( weight_t partModularity, clustersize; auto cublas_h = resource::get_cublas_handle(handle); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); // Device memory raft::spectral::matrix::vector_t part_i(handle, n); diff --git a/cpp/include/raft/spectral/detail/partition.hpp b/cpp/include/raft/spectral/detail/partition.hpp index 9d2cfb0afb..1bbedf30f5 100644 --- a/cpp/include/raft/spectral/detail/partition.hpp +++ b/cpp/include/raft/spectral/detail/partition.hpp @@ -70,7 +70,7 @@ void analyzePartition(raft::resources const& handle, if (resource::get_dry_run_flag(handle)) { return; } - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto cublas_h = resource::get_cublas_handle(handle); // Initialize cuBLAS diff --git a/cpp/include/raft/spectral/detail/spectral_util.cuh b/cpp/include/raft/spectral/detail/spectral_util.cuh index 0d4ee664a9..ef33c6cc37 100644 --- a/cpp/include/raft/spectral/detail/spectral_util.cuh +++ b/cpp/include/raft/spectral/detail/spectral_util.cuh @@ -41,7 +41,7 @@ void transform_eigen_matrix(raft::resources const& handle, if (resource::get_dry_run_flag(handle)) { return; } - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto cublas_h = resource::get_cublas_handle(handle); auto thrust_exec_policy = resource::get_thrust_policy(handle); @@ -141,7 +141,7 @@ bool construct_indicator( raft::spectral::matrix::laplacian_matrix_t const& B) { if (resource::get_dry_run_flag(handle)) { return {}; } - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto cublas_h = resource::get_cublas_handle(handle); auto thrust_exec_policy = resource::get_thrust_policy(handle); diff --git a/cpp/include/raft/stats/accuracy.cuh b/cpp/include/raft/stats/accuracy.cuh index 08b4babe30..81bdd5dd6b 100644 --- a/cpp/include/raft/stats/accuracy.cuh +++ b/cpp/include/raft/stats/accuracy.cuh @@ -59,7 +59,7 @@ float accuracy(raft::resources const& handle, predictions.data_handle(), ref_predictions.data_handle(), predictions.extent(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_accuracy diff --git a/cpp/include/raft/stats/adjusted_rand_index.cuh b/cpp/include/raft/stats/adjusted_rand_index.cuh index 9215eb38fa..e2ae069dd3 100644 --- a/cpp/include/raft/stats/adjusted_rand_index.cuh +++ b/cpp/include/raft/stats/adjusted_rand_index.cuh @@ -71,7 +71,7 @@ double adjusted_rand_index(raft::resources const& handle, first_cluster_array.data_handle(), second_cluster_array.data_handle(), first_cluster_array.extent(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_adj_rand_index diff --git a/cpp/include/raft/stats/completeness_score.cuh b/cpp/include/raft/stats/completeness_score.cuh index 30ee4ace0e..4a395bfc9b 100644 --- a/cpp/include/raft/stats/completeness_score.cuh +++ b/cpp/include/raft/stats/completeness_score.cuh @@ -72,7 +72,7 @@ double completeness_score(raft::resources const& handle, truth_cluster_array.extent(0), lower_label_range, upper_label_range, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_completeness diff --git a/cpp/include/raft/stats/contingency_matrix.cuh b/cpp/include/raft/stats/contingency_matrix.cuh index 6d6a224ec9..fde29c4b54 100644 --- a/cpp/include/raft/stats/contingency_matrix.cuh +++ b/cpp/include/raft/stats/contingency_matrix.cuh @@ -122,7 +122,7 @@ void get_input_class_cardinality(raft::resources const& handle, RAFT_EXPECTS(maxLabel.data_handle() != nullptr, "Invalid maxLabel pointer"); detail::getInputClassCardinality(groundTruth.data_handle(), groundTruth.extent(0), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), *minLabel.data_handle(), *maxLabel.data_handle()); } @@ -174,7 +174,7 @@ void contingency_matrix(raft::resources const& handle, auto workspace_sz = detail::getContingencyMatrixWorkspaceSize(resource::get_dry_run_flag(handle), ground_truth.extent(0), ground_truth.data_handle(), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), min_label_value, max_label_value); auto workspace = raft::make_device_vector(handle, workspace_sz); @@ -185,7 +185,7 @@ void contingency_matrix(raft::resources const& handle, predicted_label.data_handle(), ground_truth.extent(0), out_mat.data_handle(), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), workspace.data_handle(), workspace_sz, min_label_value, diff --git a/cpp/include/raft/stats/cov.cuh b/cpp/include/raft/stats/cov.cuh index 40d5960d89..5f65b82c26 100644 --- a/cpp/include/raft/stats/cov.cuh +++ b/cpp/include/raft/stats/cov.cuh @@ -98,7 +98,7 @@ void cov(raft::resources const& handle, data.extent(0), sample, stable, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_cov diff --git a/cpp/include/raft/stats/detail/batched/silhouette_score.cuh b/cpp/include/raft/stats/detail/batched/silhouette_score.cuh index 123847cbb6..5fd5c053c2 100644 --- a/cpp/include/raft/stats/detail/batched/silhouette_score.cuh +++ b/cpp/include/raft/stats/detail/batched/silhouette_score.cuh @@ -260,7 +260,7 @@ value_t silhouette_score( distances_buffer.data(), n_left_rows, n_right_rows, - chunk_stream); + chunk_stream.get()); } } diff --git a/cpp/include/raft/stats/detail/trustworthiness_score.cuh b/cpp/include/raft/stats/detail/trustworthiness_score.cuh index ac6de03fe3..5bde67db88 100644 --- a/cpp/include/raft/stats/detail/trustworthiness_score.cuh +++ b/cpp/include/raft/stats/detail/trustworthiness_score.cuh @@ -132,7 +132,7 @@ double trustworthiness_score(const raft::resources& h, int n_neighbors, int batchSize = 512) { - cudaStream_t stream = resource::get_cuda_stream(h); + cudaStream_t stream = resource::get_cuda_stream(h).get(); const int KNN_ALLOC = n * (n_neighbors + 1); rmm::device_uvector emb_ind(KNN_ALLOC, stream); diff --git a/cpp/include/raft/stats/dispersion.cuh b/cpp/include/raft/stats/dispersion.cuh index 20d065c168..b5cd3519ee 100644 --- a/cpp/include/raft/stats/dispersion.cuh +++ b/cpp/include/raft/stats/dispersion.cuh @@ -97,7 +97,7 @@ value_t cluster_dispersion( centroids.extent(0), n_points, centroids.extent(1), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_cluster_dispersion diff --git a/cpp/include/raft/stats/entropy.cuh b/cpp/include/raft/stats/entropy.cuh index c2330c34b2..56dc0fb417 100644 --- a/cpp/include/raft/stats/entropy.cuh +++ b/cpp/include/raft/stats/entropy.cuh @@ -67,7 +67,7 @@ double entropy(raft::resources const& handle, cluster_array.extent(0), lower_label_range, upper_label_range, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_entropy diff --git a/cpp/include/raft/stats/histogram.cuh b/cpp/include/raft/stats/histogram.cuh index 0a12f37305..0c0fd6153a 100644 --- a/cpp/include/raft/stats/histogram.cuh +++ b/cpp/include/raft/stats/histogram.cuh @@ -104,7 +104,7 @@ void histogram(raft::resources const& handle, data.data_handle(), data.extent(0), data.extent(1), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), binner); } diff --git a/cpp/include/raft/stats/homogeneity_score.cuh b/cpp/include/raft/stats/homogeneity_score.cuh index 1deb5b1880..b45c7b2ca7 100644 --- a/cpp/include/raft/stats/homogeneity_score.cuh +++ b/cpp/include/raft/stats/homogeneity_score.cuh @@ -75,7 +75,7 @@ double homogeneity_score(raft::resources const& handle, truth_cluster_array.extent(0), lower_label_range, upper_label_range, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_homogeneity_score diff --git a/cpp/include/raft/stats/information_criterion.cuh b/cpp/include/raft/stats/information_criterion.cuh index 54da1a3557..3e846ff710 100644 --- a/cpp/include/raft/stats/information_criterion.cuh +++ b/cpp/include/raft/stats/information_criterion.cuh @@ -100,7 +100,7 @@ void information_criterion_batched(raft::resources const& handle, n_params, d_ic.extent(0), n_samples, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_information_criterion diff --git a/cpp/include/raft/stats/kl_divergence.cuh b/cpp/include/raft/stats/kl_divergence.cuh index c4bf9071cd..8bba5ac00d 100644 --- a/cpp/include/raft/stats/kl_divergence.cuh +++ b/cpp/include/raft/stats/kl_divergence.cuh @@ -63,7 +63,7 @@ value_t kl_divergence(raft::resources const& handle, modelPDF.data_handle(), candidatePDF.data_handle(), modelPDF.extent(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group kl_divergence diff --git a/cpp/include/raft/stats/mean.cuh b/cpp/include/raft/stats/mean.cuh index 35d09c5422..bc11e98087 100644 --- a/cpp/include/raft/stats/mean.cuh +++ b/cpp/include/raft/stats/mean.cuh @@ -98,7 +98,7 @@ void mean(raft::resources const& handle, data.data_handle(), data.extent(1), data.extent(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -155,7 +155,7 @@ template data.extent(1), data.extent(0), sample, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_mean diff --git a/cpp/include/raft/stats/mean_center.cuh b/cpp/include/raft/stats/mean_center.cuh index b02a12214b..d365d4d3a3 100644 --- a/cpp/include/raft/stats/mean_center.cuh +++ b/cpp/include/raft/stats/mean_center.cuh @@ -99,7 +99,7 @@ void mean_center(raft::resources const& handle, mu.data_handle(), data.extent(1), data.extent(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @@ -137,7 +137,7 @@ void mean_add(raft::resources const& handle, mu.data_handle(), data.extent(1), data.extent(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_mean_center diff --git a/cpp/include/raft/stats/meanvar.cuh b/cpp/include/raft/stats/meanvar.cuh index 4c74b2c20d..227d85d9bc 100644 --- a/cpp/include/raft/stats/meanvar.cuh +++ b/cpp/include/raft/stats/meanvar.cuh @@ -95,7 +95,7 @@ void meanvar(raft::resources const& handle, data.extent(0), sample, std::is_same_v, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_mean_var diff --git a/cpp/include/raft/stats/minmax.cuh b/cpp/include/raft/stats/minmax.cuh index 8a1ac871da..4208238df4 100644 --- a/cpp/include/raft/stats/minmax.cuh +++ b/cpp/include/raft/stats/minmax.cuh @@ -126,7 +126,7 @@ void minmax(raft::resources const& handle, globalmin.data_handle(), globalmax.data_handle(), sampledcols_ptr, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_minmax diff --git a/cpp/include/raft/stats/mutual_info_score.cuh b/cpp/include/raft/stats/mutual_info_score.cuh index 7904d7349b..743884d5be 100644 --- a/cpp/include/raft/stats/mutual_info_score.cuh +++ b/cpp/include/raft/stats/mutual_info_score.cuh @@ -73,7 +73,7 @@ double mutual_info_score(raft::resources const& handle, first_cluster_array.extent(0), lower_label_range, upper_label_range, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_mutual_info diff --git a/cpp/include/raft/stats/r2_score.cuh b/cpp/include/raft/stats/r2_score.cuh index 58195e4110..53b65fe297 100644 --- a/cpp/include/raft/stats/r2_score.cuh +++ b/cpp/include/raft/stats/r2_score.cuh @@ -74,7 +74,7 @@ value_t r2_score(raft::resources const& handle, const_cast(y.data_handle()), const_cast(y_hat.data_handle()), y.extent(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_r2_score diff --git a/cpp/include/raft/stats/rand_index.cuh b/cpp/include/raft/stats/rand_index.cuh index 5d50c4b250..cd775ea9a1 100644 --- a/cpp/include/raft/stats/rand_index.cuh +++ b/cpp/include/raft/stats/rand_index.cuh @@ -59,7 +59,7 @@ double rand_index(raft::resources const& handle, first_cluster_array.data_handle(), second_cluster_array.data_handle(), second_cluster_array.extent(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_rand_index diff --git a/cpp/include/raft/stats/regression_metrics.cuh b/cpp/include/raft/stats/regression_metrics.cuh index 9a2cee0334..2f8bd962fc 100644 --- a/cpp/include/raft/stats/regression_metrics.cuh +++ b/cpp/include/raft/stats/regression_metrics.cuh @@ -91,7 +91,7 @@ void regression_metrics(raft::resources const& handle, predictions.data_handle(), ref_predictions.data_handle(), predictions.extent(0), - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), *mean_abs_error.data_handle(), *mean_squared_error.data_handle(), *median_abs_error.data_handle()); diff --git a/cpp/include/raft/stats/stddev.cuh b/cpp/include/raft/stats/stddev.cuh index ff3267882c..2573fcf577 100644 --- a/cpp/include/raft/stats/stddev.cuh +++ b/cpp/include/raft/stats/stddev.cuh @@ -119,7 +119,7 @@ void stddev(raft::resources const& handle, data.extent(1), data.extent(0), sample, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_stddev @@ -166,7 +166,7 @@ void vars(raft::resources const& handle, data.extent(1), data.extent(0), sample, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** @} */ // end group stats_variance diff --git a/cpp/include/raft/stats/v_measure.cuh b/cpp/include/raft/stats/v_measure.cuh index 983ddce4d4..5c9960f365 100644 --- a/cpp/include/raft/stats/v_measure.cuh +++ b/cpp/include/raft/stats/v_measure.cuh @@ -84,7 +84,7 @@ double v_measure(raft::resources const& handle, truth_cluster_array.extent(0), lower_label_range, upper_label_range, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), beta); } diff --git a/cpp/include/raft/stats/weighted_mean.cuh b/cpp/include/raft/stats/weighted_mean.cuh index 719a104433..41f84ee429 100644 --- a/cpp/include/raft/stats/weighted_mean.cuh +++ b/cpp/include/raft/stats/weighted_mean.cuh @@ -124,7 +124,7 @@ void weighted_mean(raft::resources const& handle, weights.data_handle(), data.extent(1), data.extent(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } /** diff --git a/cpp/include/raft/util/cudart_utils.hpp b/cpp/include/raft/util/cudart_utils.hpp index 4403b76ef1..768cc3ae70 100644 --- a/cpp/include/raft/util/cudart_utils.hpp +++ b/cpp/include/raft/util/cudart_utils.hpp @@ -136,7 +136,7 @@ class grid_1d_block_t { template void copy(Type* dst, const Type* src, size_t len, rmm::cuda_stream_view stream) { - RAFT_CUDA_TRY(cudaMemcpyAsync(dst, src, len * sizeof(Type), cudaMemcpyDefault, stream)); + RAFT_CUDA_TRY(cudaMemcpyAsync(dst, src, len * sizeof(Type), cudaMemcpyDefault, stream.get())); } /** @@ -172,7 +172,7 @@ void copy_matrix(Type* dst, width * elem_size, height, cudaMemcpyDefault, - stream)); + stream.get())); } /** @@ -199,7 +199,7 @@ template void copy_async(Type* d_ptr1, const Type* d_ptr2, size_t len, rmm::cuda_stream_view stream) { RAFT_CUDA_TRY( - cudaMemcpyAsync(d_ptr1, d_ptr2, len * sizeof(Type), cudaMemcpyDeviceToDevice, stream)); + cudaMemcpyAsync(d_ptr1, d_ptr2, len * sizeof(Type), cudaMemcpyDeviceToDevice, stream.get())); } /** @} */ diff --git a/cpp/include/raft/util/kernel_launch.hpp b/cpp/include/raft/util/kernel_launch.hpp index 8bfe5cdd65..d5f3870866 100644 --- a/cpp/include/raft/util/kernel_launch.hpp +++ b/cpp/include/raft/util/kernel_launch.hpp @@ -140,7 +140,7 @@ struct launch_on { std::size_t smem = 0, std::initializer_list attrs = {}, std::source_location loc = std::source_location::current()) - : launch_on{resource::get_cuda_stream(res).value(), + : launch_on{resource::get_cuda_stream(res).get(), smem, resource::get_dry_run_flag(res) ? detail::kSkipExecution : detail::launch_flags{}, attrs, @@ -167,7 +167,7 @@ struct launch_on { bool kSkipExecution = false, std::initializer_list attrs = {}, std::source_location loc = std::source_location::current()) - : launch_on{stream.value(), smem, kSkipExecution, attrs, loc} + : launch_on{stream.get(), smem, kSkipExecution, attrs, loc} { } diff --git a/cpp/src/raft_runtime/random/common.cuh b/cpp/src/raft_runtime/random/common.cuh index f63b998c06..9967f75f4c 100644 --- a/cpp/src/raft_runtime/random/common.cuh +++ b/cpp/src/raft_runtime/random/common.cuh @@ -26,6 +26,6 @@ r_scale, \ c_scale, \ n_edges, \ - resource::get_cuda_stream(handle), \ + resource::get_cuda_stream(handle).get(), \ r); \ } diff --git a/cpp/tests/core/bitset.cu b/cpp/tests/core/bitset.cu index f5d465b043..d022eafe38 100644 --- a/cpp/tests/core/bitset.cu +++ b/cpp/tests/core/bitset.cu @@ -177,7 +177,7 @@ class BitsetTest : public testing::TestWithParam { void run() { - auto stream = resource::get_cuda_stream(res); + auto stream = resource::get_cuda_stream(res).get(); // generate input and mask raft::random::RngState rng(42); diff --git a/cpp/tests/core/device_resources_manager.cpp b/cpp/tests/core/device_resources_manager.cpp index eebff0ec81..fc1640c78a 100644 --- a/cpp/tests/core/device_resources_manager.cpp +++ b/cpp/tests/core/device_resources_manager.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #include @@ -72,7 +72,7 @@ TEST(DeviceResourcesManager, ObeysSetters) auto device = devices[i % devices.size()]; auto const& res = device_resources_manager::get_device_resources(device); - auto primary_stream = res.get_stream().value(); + auto primary_stream = res.get_stream().get(); prev_streams[device] = prev_streams[device].value_or(primary_stream); // Expect to receive the same stream every time for a given thread EXPECT_EQ(*prev_streams[device], primary_stream); @@ -82,7 +82,7 @@ TEST(DeviceResourcesManager, ObeysSetters) auto scoped_device = device_setter{device}; auto const& res2 = device_resources_manager::get_device_resources(); // Expect device_resources to default to current device - EXPECT_EQ(primary_stream, res2.get_stream().value()); + EXPECT_EQ(primary_stream, res2.get_stream().get()); auto const& pool = res.get_stream_pool(); EXPECT_EQ(streams_per_pool, pool.get_pool_size()); diff --git a/cpp/tests/core/handle.cpp b/cpp/tests/core/handle.cpp index cc4e6083f3..b55c80cc9d 100644 --- a/cpp/tests/core/handle.cpp +++ b/cpp/tests/core/handle.cpp @@ -169,16 +169,16 @@ class mock_comms : public comms_iface { void assert_handles_equal(raft::handle_t& handle_one, raft::handle_t& handle_two) { // Assert shallow copied state - ASSERT_EQ(handle_one.get_stream().value(), handle_two.get_stream().value()); + ASSERT_EQ(handle_one.get_stream().get(), handle_two.get_stream().get()); ASSERT_EQ(handle_one.get_stream_pool_size(), handle_two.get_stream_pool_size()); // Sanity check to make sure non-corresponding streams are not equal - ASSERT_NE(handle_one.get_stream_pool().get_stream(0).value(), - handle_two.get_stream_pool().get_stream(1).value()); + ASSERT_NE(handle_one.get_stream_pool().get_stream(0).get(), + handle_two.get_stream_pool().get_stream(1).get()); for (size_t i = 0; i < handle_one.get_stream_pool_size(); ++i) { - ASSERT_EQ(handle_one.get_stream_pool().get_stream(i).value(), - handle_two.get_stream_pool().get_stream(i).value()); + ASSERT_EQ(handle_one.get_stream_pool().get_stream(i).get(), + handle_two.get_stream_pool().get_stream(i).get()); } } @@ -224,8 +224,8 @@ TEST(Raft, DefaultConstructor) auto s2 = resource::get_cuda_stream(handle); auto s3 = resource::get_next_usable_stream(handle, 5); - ASSERT_EQ(s1, s2); - ASSERT_EQ(s2, s3); + ASSERT_EQ(s1.get(), s2.get()); + ASSERT_EQ(s2.get(), s3.get()); ASSERT_EQ(0, resource::get_stream_pool_size(handle)); } @@ -238,7 +238,7 @@ TEST(Raft, GetHandleFromPool) for (std::size_t i = 0; i < n_streams; i++) { auto worker_stream = parent.get_stream_from_stream_pool(i); raft::handle_t child(worker_stream); - ASSERT_EQ(parent.get_stream_from_stream_pool(i), child.get_stream()); + ASSERT_EQ(parent.get_stream_from_stream_pool(i).get(), child.get_stream().get()); } parent.wait_stream_pool_on_stream(); diff --git a/cpp/tests/core/math_device.cu b/cpp/tests/core/math_device.cu index 1b3249d538..1e0a65f70c 100644 --- a/cpp/tests/core/math_device.cu +++ b/cpp/tests/core/math_device.cu @@ -33,7 +33,7 @@ auto math_eval(OpT op, Args&&... args) auto stream = rmm::cuda_stream_default; rmm::device_scalar result(stream); raft::launch_kernel( - stream, 1, 1, math_eval_kernel, result.data(), op, std::forward(args)...); + stream.get(), 1, 1, math_eval_kernel, result.data(), op, std::forward(args)...); return result.value(stream); } diff --git a/cpp/tests/core/mdarray.cu b/cpp/tests/core/mdarray.cu index fbe89e5145..82b6c29591 100644 --- a/cpp/tests/core/mdarray.cu +++ b/cpp/tests/core/mdarray.cu @@ -45,7 +45,7 @@ namespace { void check_status(int32_t* d_status, rmm::cuda_stream_view stream) { - stream.synchronize(); + stream.sync(); int32_t h_status{1}; raft::update_host(&h_status, d_status, 1, stream); ASSERT_EQ(h_status, 0); diff --git a/cpp/tests/core/memory_stats_resources.cpp b/cpp/tests/core/memory_stats_resources.cpp index cd275dace0..f969e53ede 100644 --- a/cpp/tests/core/memory_stats_resources.cpp +++ b/cpp/tests/core/memory_stats_resources.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include diff --git a/cpp/tests/core/operators_device.cu b/cpp/tests/core/operators_device.cu index f46a66ef30..150e909661 100644 --- a/cpp/tests/core/operators_device.cu +++ b/cpp/tests/core/operators_device.cu @@ -30,7 +30,7 @@ auto eval_op_on_device(OpT op, Args&&... args) auto stream = rmm::cuda_stream_default; rmm::device_scalar result(stream); raft::launch_kernel( - stream, 1, 1, eval_op_on_device_kernel, result.data(), op, std::forward(args)...); + stream.get(), 1, 1, eval_op_on_device_kernel, result.data(), op, std::forward(args)...); return result.value(stream); } diff --git a/cpp/tests/core/temporary_device_buffer.cu b/cpp/tests/core/temporary_device_buffer.cu index df59a28013..f06a91aaf1 100644 --- a/cpp/tests/core/temporary_device_buffer.cu +++ b/cpp/tests/core/temporary_device_buffer.cu @@ -69,7 +69,7 @@ TEST(TemporaryDeviceBuffer, HostPointerWithWriteBack) d_view.data_handle() + d_view.extent(0), 10); raft::copy( - result.data(), d_view.data_handle(), d_view.extent(0), resource::get_cuda_stream(h)); + result.data(), d_view.data_handle(), d_view.extent(0), resource::get_cuda_stream(h).get()); } }, alloc_behavior::ARGUMENT_DRIVEN, @@ -80,7 +80,7 @@ TEST(TemporaryDeviceBuffer, HostPointerWithWriteBack) result.data(), array.extent(0), raft::Compare(), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } } // namespace raft diff --git a/cpp/tests/label/merge_labels.cu b/cpp/tests/label/merge_labels.cu index 392cd73f74..61839a8e61 100644 --- a/cpp/tests/label/merge_labels.cu +++ b/cpp/tests/label/merge_labels.cu @@ -34,7 +34,7 @@ class MergeLabelsTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), labels_a(params.N, stream), labels_b(params.N, stream), expected(params.N, stream), diff --git a/cpp/tests/linalg/add.cu b/cpp/tests/linalg/add.cu index a8c422122b..9b75e17130 100644 --- a/cpp/tests/linalg/add.cu +++ b/cpp/tests/linalg/add.cu @@ -21,7 +21,7 @@ class AddTest : public ::testing::TestWithParam> { public: AddTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in1(params.len, stream), in2(params.len, stream), out_ref(params.len, stream), diff --git a/cpp/tests/linalg/axpy.cu b/cpp/tests/linalg/axpy.cu index 8cc4ebacf5..7ba6b834e2 100644 --- a/cpp/tests/linalg/axpy.cu +++ b/cpp/tests/linalg/axpy.cu @@ -58,7 +58,7 @@ class AxpyTest : public ::testing::TestWithParam> { { params = ::testing::TestWithParam>::GetParam(); - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); raft::random::RngState r(params.seed); diff --git a/cpp/tests/linalg/binary_op.cu b/cpp/tests/linalg/binary_op.cu index 2e0cd6e9fb..065c12aa7b 100644 --- a/cpp/tests/linalg/binary_op.cu +++ b/cpp/tests/linalg/binary_op.cu @@ -38,7 +38,7 @@ class BinaryOpTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in1(params.len, stream), in2(params.len, stream), out_ref(params.len, stream), @@ -125,7 +125,7 @@ class BinaryOpAlignment : public ::testing::Test { public: void Misaligned() { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); // Test to trigger cudaErrorMisalignedAddress if veclen is incorrectly // chosen. int n = 1024; @@ -139,7 +139,7 @@ class BinaryOpAlignment : public ::testing::Test { y.data() + 19, 256, raft::add_op{}, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } raft::resources handle; diff --git a/cpp/tests/linalg/cholesky_r1.cu b/cpp/tests/linalg/cholesky_r1.cu index c528b051d2..e714ede6ae 100644 --- a/cpp/tests/linalg/cholesky_r1.cu +++ b/cpp/tests/linalg/cholesky_r1.cu @@ -49,7 +49,7 @@ class CholeskyR1Test : public ::testing::Test { nullptr, &n_bytes, CUBLAS_FILL_MODE_LOWER, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); Lwork = std::max(Lwork * sizeof(math_t), (size_t)n_bytes); workspace.resize(Lwork, resource::get_cuda_stream(handle)); } @@ -76,7 +76,7 @@ class CholeskyR1Test : public ::testing::Test { (math_t*)workspace.data(), Lwork, devInfo.data(), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); // Incremental Cholesky factorization using rank one updates. raft::linalg::choleskyRank1Update(handle, @@ -86,13 +86,13 @@ class CholeskyR1Test : public ::testing::Test { workspace.data(), &Lwork, uplo, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); ASSERT_TRUE(raft::devArrMatch(L_exp.data(), L.data(), n_rows * rank, raft::CompareApprox(3e-3), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } } } @@ -104,7 +104,7 @@ class CholeskyR1Test : public ::testing::Test { for (auto uplo : fillmode) { raft::copy(L.data(), G.data(), 4, resource::get_cuda_stream(handle)); ASSERT_NO_THROW(raft::linalg::choleskyRank1Update( - handle, L.data(), 1, 2, workspace.data(), &Lwork, uplo, resource::get_cuda_stream(handle))); + handle, L.data(), 1, 2, workspace.data(), &Lwork, uplo, resource::get_cuda_stream(handle).get())); ASSERT_THROW(raft::linalg::choleskyRank1Update(handle, L.data(), 2, @@ -112,7 +112,7 @@ class CholeskyR1Test : public ::testing::Test { workspace.data(), &Lwork, uplo, - resource::get_cuda_stream(handle)), + resource::get_cuda_stream(handle).get()), raft::exception); math_t eps = std::numeric_limits::epsilon(); @@ -123,7 +123,7 @@ class CholeskyR1Test : public ::testing::Test { workspace.data(), &Lwork, uplo, - resource::get_cuda_stream(handle), + resource::get_cuda_stream(handle).get(), eps)); } } diff --git a/cpp/tests/linalg/coalesced_reduction.cu b/cpp/tests/linalg/coalesced_reduction.cu index 335c0a6fc0..d223258a17 100644 --- a/cpp/tests/linalg/coalesced_reduction.cu +++ b/cpp/tests/linalg/coalesced_reduction.cu @@ -49,7 +49,7 @@ class coalescedReductionTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream), dots_exp(params.rows * params.cols, stream), dots_act(params.rows * params.cols, stream) diff --git a/cpp/tests/linalg/divide.cu b/cpp/tests/linalg/divide.cu index cdc5ae9d8a..ee552687e6 100644 --- a/cpp/tests/linalg/divide.cu +++ b/cpp/tests/linalg/divide.cu @@ -37,7 +37,7 @@ class DivideTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in(params.len, stream), out_ref(params.len, stream), out(params.len, stream) diff --git a/cpp/tests/linalg/dot.cu b/cpp/tests/linalg/dot.cu index 5c386e6ca8..f2aa203372 100644 --- a/cpp/tests/linalg/dot.cu +++ b/cpp/tests/linalg/dot.cu @@ -51,7 +51,7 @@ class DotTest : public ::testing::TestWithParam> { params = ::testing::TestWithParam>::GetParam(); raft::resources handle; - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); raft::random::RngState r(params.seed); diff --git a/cpp/tests/linalg/eig.cu b/cpp/tests/linalg/eig.cu index b58ac402f3..9537169166 100644 --- a/cpp/tests/linalg/eig.cu +++ b/cpp/tests/linalg/eig.cu @@ -37,7 +37,7 @@ class EigTest : public ::testing::TestWithParam> { public: EigTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), cov_matrix(params.len, stream), eig_vectors(params.len, stream), eig_vectors_jacobi(params.len, stream), diff --git a/cpp/tests/linalg/eig_sel.cu b/cpp/tests/linalg/eig_sel.cu index 54e92cc68d..35abb52c4f 100644 --- a/cpp/tests/linalg/eig_sel.cu +++ b/cpp/tests/linalg/eig_sel.cu @@ -34,7 +34,7 @@ class EigSelTest : public ::testing::TestWithParam> { public: EigSelTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), cov_matrix(params.len, stream), eig_vectors(params.n_eigen_vals * params.n, stream), eig_vectors_ref(params.n_eigen_vals * params.n, stream), diff --git a/cpp/tests/linalg/gemm_large.cpp b/cpp/tests/linalg/gemm_large.cpp index 9b75421fef..3e6ccdb54e 100644 --- a/cpp/tests/linalg/gemm_large.cpp +++ b/cpp/tests/linalg/gemm_large.cpp @@ -31,14 +31,14 @@ TEST(Raft, GemmLargeSpan) auto b = raft::make_device_vector(resources, informative); auto c = raft::make_device_vector(resources, max_samples); - RAFT_CUDA_TRY(cudaMemsetAsync(a.data_handle(), 0, a.size() * sizeof(float), stream.value())); - RAFT_CUDA_TRY(cudaMemsetAsync(b.data_handle(), 0, b.size() * sizeof(float), stream.value())); + RAFT_CUDA_TRY(cudaMemsetAsync(a.data_handle(), 0, a.size() * sizeof(float), stream.get())); + RAFT_CUDA_TRY(cudaMemsetAsync(b.data_handle(), 0, b.size() * sizeof(float), stream.get())); const float alpha = 1.0f; const float beta = 0.0f; for (const auto samples : sample_counts) { SCOPED_TRACE(samples); - RAFT_CUDA_TRY(cudaMemsetAsync(c.data_handle(), 0xff, samples * sizeof(float), stream.value())); + RAFT_CUDA_TRY(cudaMemsetAsync(c.data_handle(), 0xff, samples * sizeof(float), stream.get())); raft::linalg::gemm(resources, true, true, @@ -53,22 +53,22 @@ TEST(Raft, GemmLargeSpan) &beta, c.data_handle(), static_cast(samples), - stream.value()); + stream.get()); std::array output_samples{}; RAFT_CUDA_TRY(cudaMemcpyAsync( - &output_samples[0], c.data_handle(), sizeof(float), cudaMemcpyDeviceToHost, stream.value())); + &output_samples[0], c.data_handle(), sizeof(float), cudaMemcpyDeviceToHost, stream.get())); RAFT_CUDA_TRY(cudaMemcpyAsync(&output_samples[1], c.data_handle() + samples / 2, sizeof(float), cudaMemcpyDeviceToHost, - stream.value())); + stream.get())); RAFT_CUDA_TRY(cudaMemcpyAsync(&output_samples[2], c.data_handle() + samples - 1, sizeof(float), cudaMemcpyDeviceToHost, - stream.value())); - RAFT_CUDA_TRY(cudaStreamSynchronize(stream.value())); + stream.get())); + RAFT_CUDA_TRY(cudaStreamSynchronize(stream.get())); EXPECT_FLOAT_EQ(output_samples[0], 0.0f); EXPECT_FLOAT_EQ(output_samples[1], 0.0f); EXPECT_FLOAT_EQ(output_samples[2], 0.0f); diff --git a/cpp/tests/linalg/gemm_layout.cu b/cpp/tests/linalg/gemm_layout.cu index c1598a63e6..c90688fd8b 100644 --- a/cpp/tests/linalg/gemm_layout.cu +++ b/cpp/tests/linalg/gemm_layout.cu @@ -57,7 +57,7 @@ class GemmLayoutTest : public ::testing::TestWithParam> { params = ::testing::TestWithParam>::GetParam(); raft::resources handle; - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); raft::random::RngState r(params.seed); diff --git a/cpp/tests/linalg/gemv.cu b/cpp/tests/linalg/gemv.cu index 3f2a0187db..c1f50e0b12 100644 --- a/cpp/tests/linalg/gemv.cu +++ b/cpp/tests/linalg/gemv.cu @@ -70,7 +70,7 @@ class GemvTest : public ::testing::TestWithParam> { refy(0, rmm::cuda_stream_default), y(0, rmm::cuda_stream_default) { - rmm::cuda_stream_default.synchronize(); + rmm::cuda_stream_default.sync(); } protected: @@ -79,7 +79,7 @@ class GemvTest : public ::testing::TestWithParam> { params = ::testing::TestWithParam>::GetParam(); raft::resources handle; - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); raft::random::RngState r(params.seed); diff --git a/cpp/tests/linalg/map.cu b/cpp/tests/linalg/map.cu index 628ed8695a..1fe2b0ebe6 100644 --- a/cpp/tests/linalg/map.cu +++ b/cpp/tests/linalg/map.cu @@ -211,7 +211,7 @@ class MapTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in1(params.len, stream), in2(params.len, stream), in3(params.len, stream), @@ -310,7 +310,7 @@ class MapOffsetTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), out_ref(params.len, stream), out(params.len, stream) { diff --git a/cpp/tests/linalg/map_then_reduce.cu b/cpp/tests/linalg/map_then_reduce.cu index be61674ff1..24617f30c6 100644 --- a/cpp/tests/linalg/map_then_reduce.cu +++ b/cpp/tests/linalg/map_then_reduce.cu @@ -71,7 +71,7 @@ class MapReduceTest : public ::testing::TestWithParam> { public: MapReduceTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in(params.len, stream), out_ref(params.len, stream), out(params.len, stream) @@ -133,7 +133,7 @@ class MapGenericReduceTest : public ::testing::Test { MapGenericReduceTest() : input(n, resource::get_cuda_stream(handle)), output(resource::get_cuda_stream(handle)) { - initInput(input.data(), input.size(), resource::get_cuda_stream(handle)); + initInput(input.data(), input.size(), resource::get_cuda_stream(handle).get()); } public: @@ -155,7 +155,7 @@ class MapGenericReduceTest : public ::testing::Test { input.data(), static_cast(input.size())); map_reduce(handle, input_view, output_view, neutral, raft::identity_op{}, cuda::minimum{}); EXPECT_TRUE(raft::devArrMatch( - OutType(1), output.data(), 1, raft::Compare(), resource::get_cuda_stream(handle))); + OutType(1), output.data(), 1, raft::Compare(), resource::get_cuda_stream(handle).get())); } void testMax() { @@ -165,7 +165,7 @@ class MapGenericReduceTest : public ::testing::Test { input.data(), static_cast(input.size())); map_reduce(handle, input_view, output_view, neutral, raft::identity_op{}, cuda::maximum{}); EXPECT_TRUE(raft::devArrMatch( - OutType(5), output.data(), 1, raft::Compare(), resource::get_cuda_stream(handle))); + OutType(5), output.data(), 1, raft::Compare(), resource::get_cuda_stream(handle).get())); } protected: diff --git a/cpp/tests/linalg/matrix_vector.cu b/cpp/tests/linalg/matrix_vector.cu index 711d39df9d..e76741d85c 100644 --- a/cpp/tests/linalg/matrix_vector.cu +++ b/cpp/tests/linalg/matrix_vector.cu @@ -153,7 +153,7 @@ void naive_matrix_vector_op_launch(const raft::resources& handle, bool bcast_along_rows, int operation_type) { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto operation_bin_mult_skip_zero = [] __device__(T mat_element, T vec_element) { if (vec_element != T(0)) { return mat_element * vec_element; @@ -192,7 +192,7 @@ class MatrixVectorTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in(params.rows * params.cols, stream), out_ref(params.rows * params.cols, stream), out(params.rows * params.cols, stream), diff --git a/cpp/tests/linalg/matrix_vector_op.cu b/cpp/tests/linalg/matrix_vector_op.cu index 7f77d65afe..800aa3a3b4 100644 --- a/cpp/tests/linalg/matrix_vector_op.cu +++ b/cpp/tests/linalg/matrix_vector_op.cu @@ -116,7 +116,7 @@ template > { public: MatVecOpTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), params(::testing::TestWithParam>::GetParam()), vec_size(params.bcastAlongRows ? params.cols : params.rows), in(params.rows * params.cols + params.inAlignOffset, stream), diff --git a/cpp/tests/linalg/mean_squared_error.cu b/cpp/tests/linalg/mean_squared_error.cu index d3a5712809..85cd9bc257 100644 --- a/cpp/tests/linalg/mean_squared_error.cu +++ b/cpp/tests/linalg/mean_squared_error.cu @@ -61,7 +61,7 @@ class MeanSquaredErrorTest : public ::testing::TestWithParam>::GetParam(); - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); raft::random::RngState r(params.seed); diff --git a/cpp/tests/linalg/multiply.cu b/cpp/tests/linalg/multiply.cu index e2ac787995..a66627d26f 100644 --- a/cpp/tests/linalg/multiply.cu +++ b/cpp/tests/linalg/multiply.cu @@ -21,7 +21,7 @@ class MultiplyTest : public ::testing::TestWithParam> { public: MultiplyTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in(params.len, stream), out_ref(params.len, stream), out(params.len, stream) diff --git a/cpp/tests/linalg/norm.cu b/cpp/tests/linalg/norm.cu index c15379c05d..a78ea6e4f7 100644 --- a/cpp/tests/linalg/norm.cu +++ b/cpp/tests/linalg/norm.cu @@ -81,7 +81,7 @@ class RowNormTest : public ::testing::TestWithParam> { public: RowNormTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream), dots_exp(params.rows, stream), dots_act(params.rows, stream) @@ -177,7 +177,7 @@ class ColNormTest : public ::testing::TestWithParam> { public: ColNormTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream), dots_exp(params.cols, stream), dots_act(params.cols, stream) diff --git a/cpp/tests/linalg/normalize.cu b/cpp/tests/linalg/normalize.cu index c86cb366c1..ffb01808d0 100644 --- a/cpp/tests/linalg/normalize.cu +++ b/cpp/tests/linalg/normalize.cu @@ -62,7 +62,7 @@ class RowNormalizeTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream), out_exp(params.rows * params.cols, stream), out_act(params.rows * params.cols, stream) diff --git a/cpp/tests/linalg/pca.cu b/cpp/tests/linalg/pca.cu index d8476cd521..df6c8f5771 100644 --- a/cpp/tests/linalg/pca.cu +++ b/cpp/tests/linalg/pca.cu @@ -43,7 +43,7 @@ class PcaTest : public ::testing::TestWithParam> { public: PcaTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), explained_vars(params.n_col, stream), explained_vars_ref(params.n_col, stream), components(params.n_col * params.n_col, stream), @@ -238,7 +238,7 @@ TEST_P(PcaTestValF, Result) explained_vars_ref.data(), params.n_col, raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef PcaTest PcaTestValD; @@ -248,7 +248,7 @@ TEST_P(PcaTestValD, Result) explained_vars_ref.data(), params.n_col, raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef PcaTest PcaTestLeftVecF; @@ -258,7 +258,7 @@ TEST_P(PcaTestLeftVecF, Result) components_ref.data(), (params.n_col * params.n_col), raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef PcaTest PcaTestLeftVecD; @@ -268,7 +268,7 @@ TEST_P(PcaTestLeftVecD, Result) components_ref.data(), (params.n_col * params.n_col), raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef PcaTest PcaTestTransDataF; @@ -278,7 +278,7 @@ TEST_P(PcaTestTransDataF, Result) trans_data_ref.data(), (params.n_row * params.n_col), raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef PcaTest PcaTestTransDataD; @@ -288,7 +288,7 @@ TEST_P(PcaTestTransDataD, Result) trans_data_ref.data(), (params.n_row * params.n_col), raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef PcaTest PcaTestDataVecSmallF; @@ -298,7 +298,7 @@ TEST_P(PcaTestDataVecSmallF, Result) data_back.data(), (params.n_col * params.n_col), raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef PcaTest PcaTestDataVecSmallD; @@ -308,7 +308,7 @@ TEST_P(PcaTestDataVecSmallD, Result) data_back.data(), (params.n_col * params.n_col), raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef PcaTest PcaTestDataVecF; diff --git a/cpp/tests/linalg/power.cu b/cpp/tests/linalg/power.cu index 0131ec2855..439d8a38a6 100644 --- a/cpp/tests/linalg/power.cu +++ b/cpp/tests/linalg/power.cu @@ -76,7 +76,7 @@ class PowerTest : public ::testing::TestWithParam> { raft::random::RngState r(params.seed); int len = params.len; - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); in1.resize(len, stream); in2.resize(len, stream); diff --git a/cpp/tests/linalg/randomized_svd.cu b/cpp/tests/linalg/randomized_svd.cu index 956fa4c1a6..cb59bce3ca 100644 --- a/cpp/tests/linalg/randomized_svd.cu +++ b/cpp/tests/linalg/randomized_svd.cu @@ -37,7 +37,7 @@ class randomized_svdTest : public ::testing::TestWithParam>::GetParam()), - stream(handle.get_stream()), + stream(handle.get_stream().get()), data(params.n_row * params.n_col, stream), reconst(params.n_row * params.n_col, stream), left_eig_vectors_act(params.n_row * params.k, stream), diff --git a/cpp/tests/linalg/reduce.cu b/cpp/tests/linalg/reduce.cu index 6c25db338f..33bbfa478a 100644 --- a/cpp/tests/linalg/reduce.cu +++ b/cpp/tests/linalg/reduce.cu @@ -92,7 +92,7 @@ class ReduceTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream), dots_exp(params.alongRows ? params.rows : params.cols, stream), dots_act(params.alongRows ? params.rows : params.cols, stream) diff --git a/cpp/tests/linalg/reduce_cols_by_key.cu b/cpp/tests/linalg/reduce_cols_by_key.cu index e7f53112fc..24fb479cdc 100644 --- a/cpp/tests/linalg/reduce_cols_by_key.cu +++ b/cpp/tests/linalg/reduce_cols_by_key.cu @@ -68,7 +68,7 @@ class ReduceColsTest : public ::testing::TestWithParam params = ::testing::TestWithParam>::GetParam(); raft::random::RngState r(params.seed); raft::resources handle; - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto nrows = params.rows; auto ncols = params.cols; auto nkeys = params.nkeys; diff --git a/cpp/tests/linalg/reduce_rows_by_key.cu b/cpp/tests/linalg/reduce_rows_by_key.cu index cb4d35ea84..43af82279e 100644 --- a/cpp/tests/linalg/reduce_rows_by_key.cu +++ b/cpp/tests/linalg/reduce_rows_by_key.cu @@ -93,7 +93,7 @@ class ReduceRowTest : public ::testing::TestWithParam> { public: ReduceRowTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in(params.nobs * params.cols, stream), out(params.nkeys * params.cols, stream), out_ref(params.nkeys * params.cols, stream), diff --git a/cpp/tests/linalg/rsvd.cu b/cpp/tests/linalg/rsvd.cu index 1f674d6836..23e51a638d 100644 --- a/cpp/tests/linalg/rsvd.cu +++ b/cpp/tests/linalg/rsvd.cu @@ -58,7 +58,7 @@ class RsvdTest : public ::testing::TestWithParam> { void SetUp() override { raft::resources handle; - stream = resource::get_cuda_stream(handle); + stream = resource::get_cuda_stream(handle).get(); params = ::testing::TestWithParam>::GetParam(); // rSVD seems to be very sensitive to the random number sequence as well! @@ -282,7 +282,7 @@ TEST_P(RsvdTestSquareMatrixNormF, Result) params.n_col, params.k, 4 * params.tolerance, - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef RsvdTest RsvdTestSquareMatrixNormD; @@ -299,7 +299,7 @@ TEST_P(RsvdTestSquareMatrixNormD, Result) params.n_col, params.k, 4 * params.tolerance, - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } INSTANTIATE_TEST_CASE_P(RsvdTests, RsvdSanityCheckValF, ::testing::ValuesIn(sanity_inputs_fx)); diff --git a/cpp/tests/linalg/sqrt.cu b/cpp/tests/linalg/sqrt.cu index 15d464d91d..bc9cd821d7 100644 --- a/cpp/tests/linalg/sqrt.cu +++ b/cpp/tests/linalg/sqrt.cu @@ -56,7 +56,7 @@ class SqrtTest : public ::testing::TestWithParam> { void SetUp() override { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); params = ::testing::TestWithParam>::GetParam(); raft::random::RngState r(params.seed); int len = params.len; diff --git a/cpp/tests/linalg/strided_reduction.cu b/cpp/tests/linalg/strided_reduction.cu index 3a3452868b..30f821ecd4 100644 --- a/cpp/tests/linalg/strided_reduction.cu +++ b/cpp/tests/linalg/strided_reduction.cu @@ -41,7 +41,7 @@ class stridedReductionTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream), dots_exp(params.cols, stream), // expected dot products (from test) dots_act(params.cols, stream) // actual dot products (from prim) @@ -155,12 +155,12 @@ TEST(stridedReductionTest, LargeReducedDimension) sums_same_type.data_handle(), kCols, raft::CompareApprox(1e-6f), - stream)); + stream.get())); ASSERT_TRUE(devArrMatch(static_cast(kRows), sums_wider_type.data_handle(), kCols, raft::CompareApprox(1e-12), - stream)); + stream.get())); } } // end namespace linalg diff --git a/cpp/tests/linalg/subtract.cu b/cpp/tests/linalg/subtract.cu index 176f63274a..1ed594feea 100644 --- a/cpp/tests/linalg/subtract.cu +++ b/cpp/tests/linalg/subtract.cu @@ -64,7 +64,7 @@ class SubtractTest : public ::testing::TestWithParam> { public: SubtractTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in1(params.len, stream), in2(params.len, stream), out_ref(params.len, stream), diff --git a/cpp/tests/linalg/svd.cu b/cpp/tests/linalg/svd.cu index 98dc9f919d..1003d7029e 100644 --- a/cpp/tests/linalg/svd.cu +++ b/cpp/tests/linalg/svd.cu @@ -38,7 +38,7 @@ class SvdTest : public ::testing::TestWithParam> { public: SvdTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.len, stream), left_eig_vectors_qr(params.n_row * params.n_col, stream), right_eig_vectors_trans_qr(params.n_col * params.n_col, stream), diff --git a/cpp/tests/linalg/ternary_op.cu b/cpp/tests/linalg/ternary_op.cu index 631a7effb8..c7aff9a3a6 100644 --- a/cpp/tests/linalg/ternary_op.cu +++ b/cpp/tests/linalg/ternary_op.cu @@ -33,7 +33,7 @@ class ternaryOpTest : public ::testing::TestWithParam> { public: ternaryOpTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), out_add_ref(params.len, stream), out_add(params.len, stream), out_mul_ref(params.len, stream), diff --git a/cpp/tests/linalg/transpose.cu b/cpp/tests/linalg/transpose.cu index 811f788e2d..8162131bb6 100644 --- a/cpp/tests/linalg/transpose.cu +++ b/cpp/tests/linalg/transpose.cu @@ -88,7 +88,7 @@ class TransposeTest : public ::testing::TestWithParam> { public: TransposeTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.n_row * params.n_col, stream), data_trans_ref(params.n_row * params.n_col, stream), data_trans(params.n_row * params.n_col, stream) @@ -117,7 +117,7 @@ class TransposeTest : public ::testing::TestWithParam> { data_trans.data(), params.n_row, params.n_col, - resource::get_cuda_stream(h)); + resource::get_cuda_stream(h).get()); }, raft::alloc_behavior::NO_ALLOCATIONS); if (params.n_row == params.n_col) { transpose(data.data(), params.n_col, stream); } diff --git a/cpp/tests/linalg/tsvd.cu b/cpp/tests/linalg/tsvd.cu index f273e50b53..1d11dd8c90 100644 --- a/cpp/tests/linalg/tsvd.cu +++ b/cpp/tests/linalg/tsvd.cu @@ -43,7 +43,7 @@ class TsvdTest : public ::testing::TestWithParam> { public: TsvdTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), components(0, stream), components_ref(0, stream), data2(0, stream), @@ -218,7 +218,7 @@ TEST_P(TsvdTestLeftVecF, Result) components_ref.data(), (params.n_col * params.n_col), raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef TsvdTest TsvdTestLeftVecD; @@ -228,7 +228,7 @@ TEST_P(TsvdTestLeftVecD, Result) components_ref.data(), (params.n_col * params.n_col), raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef TsvdTest TsvdTestDataVecF; @@ -238,7 +238,7 @@ TEST_P(TsvdTestDataVecF, Result) data2_back.data(), (params.n_col2 * params.n_col2), raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef TsvdTest TsvdTestDataVecD; @@ -248,7 +248,7 @@ TEST_P(TsvdTestDataVecD, Result) data2_back.data(), (params.n_col2 * params.n_col2), raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } INSTANTIATE_TEST_CASE_P(TsvdTests, TsvdTestLeftVecF, ::testing::ValuesIn(inputsf2)); diff --git a/cpp/tests/linalg/unary_op.cu b/cpp/tests/linalg/unary_op.cu index c2cf60a63a..bab35a8838 100644 --- a/cpp/tests/linalg/unary_op.cu +++ b/cpp/tests/linalg/unary_op.cu @@ -22,7 +22,7 @@ class UnaryOpTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in(params.len, stream), out_ref(params.len, stream), out(params.len, stream) diff --git a/cpp/tests/matrix/argmax.cu b/cpp/tests/matrix/argmax.cu index 1193aaad55..67753c7c1f 100644 --- a/cpp/tests/matrix/argmax.cu +++ b/cpp/tests/matrix/argmax.cu @@ -49,7 +49,7 @@ class ArgMaxTest : public ::testing::TestWithParam> { raft::update_device(expected.data_handle(), params.output_matrix.data(), params.output_matrix.size(), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); auto input_const_view = raft::make_device_matrix_view( input.data_handle(), input.extent(0), input.extent(1)); @@ -81,7 +81,7 @@ TEST_P(ArgMaxTestF, Result) output.data_handle(), params.n_rows, Compare(), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef ArgMaxTest ArgMaxTestD; @@ -91,7 +91,7 @@ TEST_P(ArgMaxTestD, Result) output.data_handle(), params.n_rows, Compare(), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } INSTANTIATE_TEST_SUITE_P(ArgMaxTest, ArgMaxTestF, ::testing::ValuesIn(inputsf)); diff --git a/cpp/tests/matrix/argmin.cu b/cpp/tests/matrix/argmin.cu index 0d2af18aab..80a84a9f20 100644 --- a/cpp/tests/matrix/argmin.cu +++ b/cpp/tests/matrix/argmin.cu @@ -49,7 +49,7 @@ class ArgMinTest : public ::testing::TestWithParam> { raft::update_device(expected.data_handle(), params.output_matrix.data(), params.output_matrix.size(), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); auto input_const_view = raft::make_device_matrix_view( input.data_handle(), input.extent(0), input.extent(1)); @@ -81,7 +81,7 @@ TEST_P(ArgMinTestF, Result) output.data_handle(), params.n_rows, Compare(), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef ArgMinTest ArgMinTestD; @@ -91,7 +91,7 @@ TEST_P(ArgMinTestD, Result) output.data_handle(), params.n_rows, Compare(), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } INSTANTIATE_TEST_SUITE_P(ArgMinTest, ArgMinTestF, ::testing::ValuesIn(inputsf)); diff --git a/cpp/tests/matrix/columnSort.cu b/cpp/tests/matrix/columnSort.cu index 6f00ded865..d65dd2c41f 100644 --- a/cpp/tests/matrix/columnSort.cu +++ b/cpp/tests/matrix/columnSort.cu @@ -109,7 +109,7 @@ class ColumnSort : public ::testing::TestWithParam> { raft::matrix::sort_cols_per_row( handle, key_in_view, value_out_view, std::make_optional(key_sorted_view)); - RAFT_CUDA_TRY(cudaStreamSynchronize(resource::get_cuda_stream(handle))); + RAFT_CUDA_TRY(cudaStreamSynchronize(resource::get_cuda_stream(handle).get())); } protected: diff --git a/cpp/tests/matrix/diagonal.cu b/cpp/tests/matrix/diagonal.cu index 70f25e517c..a37c093905 100644 --- a/cpp/tests/matrix/diagonal.cu +++ b/cpp/tests/matrix/diagonal.cu @@ -87,7 +87,7 @@ TEST_P(DiagonalTestF, Result) diag_actual.data_handle(), diag_size, Compare(), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } typedef DiagonalTest DiagonalTestD; @@ -97,7 +97,7 @@ TEST_P(DiagonalTestD, Result) diag_actual.data_handle(), diag_size, Compare(), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } INSTANTIATE_TEST_SUITE_P(DiagonalTest, DiagonalTestF, ::testing::ValuesIn(inputsf)); diff --git a/cpp/tests/matrix/eye.cu b/cpp/tests/matrix/eye.cu index 27a87cdf40..1bce479365 100644 --- a/cpp/tests/matrix/eye.cu +++ b/cpp/tests/matrix/eye.cu @@ -31,7 +31,7 @@ class InitTest : public ::testing::TestWithParam> { public: InitTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)) + stream(resource::get_cuda_stream(handle).get()) { } diff --git a/cpp/tests/matrix/gather.cu b/cpp/tests/matrix/gather.cu index 0af05e579a..912fa3fb9d 100644 --- a/cpp/tests/matrix/gather.cu +++ b/cpp/tests/matrix/gather.cu @@ -79,7 +79,7 @@ template > { protected: GatherTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), params(::testing::TestWithParam>::GetParam()), d_in(0, stream), d_out_exp(0, stream), @@ -204,7 +204,7 @@ class GatherTest : public ::testing::TestWithParam> { params.ncols * sizeof(MatrixT), map_length, cudaMemcpyDefault, - raft::resource::get_cuda_stream(handle))); + raft::resource::get_cuda_stream(handle).get())); } resource::sync_stream(handle, stream); diff --git a/cpp/tests/matrix/linewise_op.cu b/cpp/tests/matrix/linewise_op.cu index 7e04ed1d15..ad62d69c3e 100644 --- a/cpp/tests/matrix/linewise_op.cu +++ b/cpp/tests/matrix/linewise_op.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -175,7 +175,7 @@ struct LinewiseTest : public ::testing::TestWithParam blob_val(params.checkCorrectness ? blob.size() / 2 : 0, stream); - stream.synchronize(); + stream.sync(); cudaProfilerStart(); testing::AssertionResult r = testing::AssertionSuccess(); for (auto [n, m] : dims) { @@ -197,7 +197,7 @@ struct LinewiseTest : public ::testing::TestWithParam(params.tolerance)) << " " << (alongRows ? "alongRows" : "acrossRows") << " with one vec; lineLen: " << lineLen << "; nLines " << nLines; @@ -214,7 +214,7 @@ struct LinewiseTest : public ::testing::TestWithParam(params.tolerance)) << " " << (alongRows ? "alongRows" : "acrossRows") << " with two vecs; lineLen: " << lineLen << "; nLines " << nLines; @@ -233,7 +233,7 @@ struct LinewiseTest : public ::testing::TestWithParam blob_val(params.checkCorrectness ? blob.size() / 2 : 0, stream); - stream.synchronize(); + stream.sync(); cudaProfilerStart(); testing::AssertionResult r = testing::AssertionSuccess(); for (auto alongRows : ::testing::Bool()) { diff --git a/cpp/tests/matrix/math.cu b/cpp/tests/matrix/math.cu index f885382d32..2956098186 100644 --- a/cpp/tests/matrix/math.cu +++ b/cpp/tests/matrix/math.cu @@ -108,7 +108,7 @@ class MathTest : public ::testing::TestWithParam> { public: MathTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in_power(params.len, stream), out_power_ref(params.len, stream), in_sqrt(params.len, stream), diff --git a/cpp/tests/matrix/matrix.cu b/cpp/tests/matrix/matrix.cu index c8e358373e..cc26c74f46 100644 --- a/cpp/tests/matrix/matrix.cu +++ b/cpp/tests/matrix/matrix.cu @@ -42,7 +42,7 @@ class MatrixTest : public ::testing::TestWithParam> { public: MatrixTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in1(params.n_row * params.n_col, stream), in2(params.n_row * params.n_col, stream), in1_revr(params.n_row * params.n_col, stream) @@ -116,8 +116,8 @@ class MatrixCopyRowsTest : public ::testing::Test { protected: MatrixCopyRowsTest() - : stream(resource::get_cuda_stream(handle)), - input(n_cols * n_rows, resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), + input(n_cols * n_rows, resource::get_cuda_stream(handle).get()), indices(n_selected, resource::get_cuda_stream(handle)), output(n_cols * n_selected, resource::get_cuda_stream(handle)) { diff --git a/cpp/tests/matrix/norm.cu b/cpp/tests/matrix/norm.cu index 75bd499327..af42a2a957 100644 --- a/cpp/tests/matrix/norm.cu +++ b/cpp/tests/matrix/norm.cu @@ -48,7 +48,7 @@ class NormTest : public ::testing::TestWithParam> { public: NormTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream) { } diff --git a/cpp/tests/matrix/reverse.cu b/cpp/tests/matrix/reverse.cu index 7bd3092027..25dd8b311c 100644 --- a/cpp/tests/matrix/reverse.cu +++ b/cpp/tests/matrix/reverse.cu @@ -65,7 +65,7 @@ class ReverseTest : public ::testing::TestWithParam> { public: ReverseTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream) { } diff --git a/cpp/tests/matrix/sample_rows.cu b/cpp/tests/matrix/sample_rows.cu index a238b5e7e1..ec672e1c71 100644 --- a/cpp/tests/matrix/sample_rows.cu +++ b/cpp/tests/matrix/sample_rows.cu @@ -45,7 +45,7 @@ class SampleRowsTest : public ::testing::TestWithParam { SampleRowsTest() : params(::testing::TestWithParam::GetParam()), ld(params.dim + params.dim_margin), - stream(resource::get_cuda_stream(res)), + stream(resource::get_cuda_stream(res).get()), state{137ULL}, in(make_device_matrix(res, params.N, ld)), out(make_device_matrix(res, 0, 0)), diff --git a/cpp/tests/matrix/scatter.cu b/cpp/tests/matrix/scatter.cu index dea0ca5c11..397a9230b5 100644 --- a/cpp/tests/matrix/scatter.cu +++ b/cpp/tests/matrix/scatter.cu @@ -49,7 +49,7 @@ template class ScatterTest : public ::testing::TestWithParam> { protected: ScatterTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), params(::testing::TestWithParam>::GetParam()), d_in(0, stream), d_out_exp(0, stream), diff --git a/cpp/tests/matrix/select_k.cuh b/cpp/tests/matrix/select_k.cuh index 537ee10bc8..71afc7c1ab 100644 --- a/cpp/tests/matrix/select_k.cuh +++ b/cpp/tests/matrix/select_k.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -38,9 +38,9 @@ auto gen_simple_ids(uint32_t batch_size, uint32_t len) -> std::vector std::vector out(batch_size * len); auto s = rmm::cuda_stream_default; rmm::device_uvector out_d(out.size(), s); - sparse::iota_fill(out_d.data(), IdxT(batch_size), IdxT(len), s); + sparse::iota_fill(out_d.data(), IdxT(batch_size), IdxT(len), s.get()); update_host(out.data(), out_d.data(), out.size(), s); - s.synchronize(); + s.sync(); return out; } @@ -491,7 +491,7 @@ struct with_ref { } update_host(dists.data(), dists_d.data(), dists_d.size(), s); - s.synchronize(); + s.sync(); } return std::make_tuple(spec, algo, io_computed(spec, RefAlgo, dists)); diff --git a/cpp/tests/matrix/shift.cu b/cpp/tests/matrix/shift.cu index 3922c6d246..689938a117 100644 --- a/cpp/tests/matrix/shift.cu +++ b/cpp/tests/matrix/shift.cu @@ -90,7 +90,7 @@ class ShiftTest : public ::testing::TestWithParam> { raft::update_device(values.data_handle(), params.values.data(), values_rows * values_cols, - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); raft::matrix::shift(handle, in_out.view(), raft::make_const_mdspan(values.view()), @@ -264,7 +264,7 @@ TEST_P(ShiftTestF, Result) in_out.data_handle(), params.n_rows * params.n_cols, Compare(), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } INSTANTIATE_TEST_SUITE_P(ShiftTestConstant, ShiftTestF, ::testing::ValuesIn(inputs_constant)); diff --git a/cpp/tests/matrix/slice.cu b/cpp/tests/matrix/slice.cu index 79a255aa95..a325b850b2 100644 --- a/cpp/tests/matrix/slice.cu +++ b/cpp/tests/matrix/slice.cu @@ -53,7 +53,7 @@ class SliceTest : public ::testing::TestWithParam> { public: SliceTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream) { } diff --git a/cpp/tests/matrix/triangular.cu b/cpp/tests/matrix/triangular.cu index 0d6fda087e..d5fc1acc2b 100644 --- a/cpp/tests/matrix/triangular.cu +++ b/cpp/tests/matrix/triangular.cu @@ -47,7 +47,7 @@ class TriangularTest : public ::testing::TestWithParam> { public: TriangularTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream) { } diff --git a/cpp/tests/random/excess_sampling.cu b/cpp/tests/random/excess_sampling.cu index 51c7f345ea..2668fb4674 100644 --- a/cpp/tests/random/excess_sampling.cu +++ b/cpp/tests/random/excess_sampling.cu @@ -40,7 +40,7 @@ class ExcessSamplingTest : public ::testing::TestWithParam { public: ExcessSamplingTest() : params(::testing::TestWithParam::GetParam()), - stream(resource::get_cuda_stream(res)), + stream(resource::get_cuda_stream(res).get()), state{137ULL} { } diff --git a/cpp/tests/random/make_blobs.cu b/cpp/tests/random/make_blobs.cu index fc2d36258a..662b39d6a7 100644 --- a/cpp/tests/random/make_blobs.cu +++ b/cpp/tests/random/make_blobs.cu @@ -72,7 +72,7 @@ class MakeBlobsTest : public ::testing::TestWithParam> { public: MakeBlobsTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), mu_vec(make_device_matrix(handle, params.n_clusters, params.cols)), mean_var(make_device_vector(handle, 2 * params.n_clusters * params.cols)) { diff --git a/cpp/tests/random/make_regression.cu b/cpp/tests/random/make_regression.cu index 32315ce63d..e6b36eac6a 100644 --- a/cpp/tests/random/make_regression.cu +++ b/cpp/tests/random/make_regression.cu @@ -52,7 +52,7 @@ class MakeRegressionTest : public ::testing::TestWithParam zc_device(stream); @@ -103,7 +103,7 @@ class MakeRegressionTest : public ::testing::TestWithParam{}, raft::equal_const_op{0}}, raft::add_op{}, - stream, + stream.get(), coef.data()); zero_count = zc_device.value(stream); } @@ -137,7 +137,7 @@ TEST_P(MakeRegressionTestF, Result) params.n_samples, params.n_targets, raft::CompareApprox(params.tolerance), - stream)); + stream.get())); } INSTANTIATE_TEST_CASE_P(MakeRegressionTests, MakeRegressionTestF, ::testing::ValuesIn(inputsf_t)); @@ -160,7 +160,7 @@ TEST_P(MakeRegressionTestD, Result) params.n_samples, params.n_targets, raft::CompareApprox(params.tolerance), - stream)); + stream.get())); } INSTANTIATE_TEST_CASE_P(MakeRegressionTests, MakeRegressionTestD, ::testing::ValuesIn(inputsd_t)); @@ -221,18 +221,18 @@ class MakeRegressionMdspanTest : public ::testing::TestWithParam zc_device(stream); @@ -241,7 +241,7 @@ class MakeRegressionMdspanTest : public ::testing::TestWithParam{}, raft::equal_const_op{0}}, raft::add_op{}, - stream, + stream.get(), coef.data()); zero_count = zc_device.value(stream); } @@ -268,7 +268,7 @@ TEST_P(MakeRegressionMdspanTestF, Result) params.n_samples, params.n_targets, raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } INSTANTIATE_TEST_CASE_P(MakeRegressionMdspanTests, MakeRegressionMdspanTestF, @@ -286,7 +286,7 @@ TEST_P(MakeRegressionMdspanTestD, Result) params.n_samples, params.n_targets, raft::CompareApprox(params.tolerance), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); } INSTANTIATE_TEST_CASE_P(MakeRegressionMdspanTests, MakeRegressionMdspanTestD, diff --git a/cpp/tests/random/multi_variable_gaussian.cu b/cpp/tests/random/multi_variable_gaussian.cu index c3f350d86b..668d149842 100644 --- a/cpp/tests/random/multi_variable_gaussian.cu +++ b/cpp/tests/random/multi_variable_gaussian.cu @@ -103,7 +103,7 @@ class MVGTest : public ::testing::TestWithParam> { tolerance = params.tolerance; auto cusolverH = resource::get_cusolver_dn_handle(handle); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); // preparing to store stuff P.resize(dim * dim); @@ -241,7 +241,7 @@ class MVGMdspanTest : public ::testing::TestWithParam> { tolerance = params.tolerance; auto cusolverH = resource::get_cusolver_dn_handle(handle); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); P.resize(dim * dim); x.resize(dim); @@ -409,7 +409,7 @@ TEST_P(MVGTestF, MeanIsCorrectF) Rand_mean.data(), dim, raft::CompareApprox(tolerance), - resource::get_cuda_stream(handle))) + resource::get_cuda_stream(handle).get())) << " in MeanIsCorrect"; } TEST_P(MVGTestF, CovIsCorrectF) @@ -419,7 +419,7 @@ TEST_P(MVGTestF, CovIsCorrectF) dim, dim, raft::CompareApprox(tolerance), - resource::get_cuda_stream(handle))) + resource::get_cuda_stream(handle).get())) << " in CovIsCorrect"; } TEST_P(MVGTestD, MeanIsCorrectD) @@ -428,7 +428,7 @@ TEST_P(MVGTestD, MeanIsCorrectD) Rand_mean.data(), dim, raft::CompareApprox(tolerance), - resource::get_cuda_stream(handle))) + resource::get_cuda_stream(handle).get())) << " in MeanIsCorrect"; } TEST_P(MVGTestD, CovIsCorrectD) @@ -438,7 +438,7 @@ TEST_P(MVGTestD, CovIsCorrectD) dim, dim, raft::CompareApprox(tolerance), - resource::get_cuda_stream(handle))) + resource::get_cuda_stream(handle).get())) << " in CovIsCorrect"; } @@ -450,7 +450,7 @@ TEST_P(MVGMdspanTestF, MeanIsCorrectF) Rand_mean.data(), dim, raft::CompareApprox(tolerance), - resource::get_cuda_stream(handle))) + resource::get_cuda_stream(handle).get())) << " in MeanIsCorrect"; } TEST_P(MVGMdspanTestF, CovIsCorrectF) @@ -460,7 +460,7 @@ TEST_P(MVGMdspanTestF, CovIsCorrectF) dim, dim, raft::CompareApprox(tolerance), - resource::get_cuda_stream(handle))) + resource::get_cuda_stream(handle).get())) << " in CovIsCorrect"; } TEST_P(MVGMdspanTestD, MeanIsCorrectD) @@ -469,7 +469,7 @@ TEST_P(MVGMdspanTestD, MeanIsCorrectD) Rand_mean.data(), dim, raft::CompareApprox(tolerance), - resource::get_cuda_stream(handle))) + resource::get_cuda_stream(handle).get())) << " in MeanIsCorrect"; } TEST_P(MVGMdspanTestD, CovIsCorrectD) @@ -479,7 +479,7 @@ TEST_P(MVGMdspanTestD, CovIsCorrectD) dim, dim, raft::CompareApprox(tolerance), - resource::get_cuda_stream(handle))) + resource::get_cuda_stream(handle).get())) << " in CovIsCorrect"; } diff --git a/cpp/tests/random/permute.cu b/cpp/tests/random/permute.cu index 2f798371d7..fedd5e764a 100644 --- a/cpp/tests/random/permute.cu +++ b/cpp/tests/random/permute.cu @@ -56,7 +56,7 @@ class PermTest : public ::testing::TestWithParam> { /** @brief Allocate test inputs and run the keyed raw-pointer overload. */ void SetUp() override { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); params = ::testing::TestWithParam>::GetParam(); // forcefully set needPerms, since we need it for unit-testing! if (params.needShuffle) { params.needPerms = true; } @@ -453,9 +453,10 @@ TEST(PermTest, SeedDiversity) rmm::device_uvector d_ref(N, stream); rmm::device_uvector d_matches(total_threads, stream); detail::permute( - d_ref.data(), nullptr, nullptr, 0, N, true, stream, base_seed); + d_ref.data(), nullptr, nullptr, 0, N, true, stream.get(), base_seed); - seed_diversity_kernel<<>>(d_ref.data(), N, base_seed, d_matches.data()); + seed_diversity_kernel<<>>( + d_ref.data(), N, base_seed, d_matches.data()); RAFT_CUDA_TRY(cudaPeekAtLastError()); std::vector h_matches(total_threads); diff --git a/cpp/tests/random/rmat_rectangular_generator.cu b/cpp/tests/random/rmat_rectangular_generator.cu index 3d752567b4..bd726c5dd3 100644 --- a/cpp/tests/random/rmat_rectangular_generator.cu +++ b/cpp/tests/random/rmat_rectangular_generator.cu @@ -154,7 +154,7 @@ class RmatGenTest : public ::testing::TestWithParam { public: RmatGenTest() : handle{}, - stream{resource::get_cuda_stream(handle)}, + stream{resource::get_cuda_stream(handle).get()}, params{::testing::TestWithParam::GetParam()}, out{params.n_edges * 2, stream}, out_src{params.n_edges, stream}, @@ -254,7 +254,7 @@ class RmatGenMdspanTest : public ::testing::TestWithParam { public: RmatGenMdspanTest() : handle{}, - stream{resource::get_cuda_stream(handle)}, + stream{resource::get_cuda_stream(handle).get()}, params{::testing::TestWithParam::GetParam()}, out{params.n_edges * 2, stream}, out_src{params.n_edges, stream}, @@ -404,7 +404,7 @@ class RmatGenForceTest : public ::testing::TestWithParam { public: RmatGenForceTest() : handle{}, - stream{resource::get_cuda_stream(handle)}, + stream{resource::get_cuda_stream(handle).get()}, params{::testing::TestWithParam::GetParam()}, out{2, stream}, out_src{1, stream}, diff --git a/cpp/tests/random/rng.cu b/cpp/tests/random/rng.cu index 5486a51fbc..7d859b9191 100644 --- a/cpp/tests/random/rng.cu +++ b/cpp/tests/random/rng.cu @@ -90,7 +90,7 @@ class RngTest : public ::testing::TestWithParam> { public: RngTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(0, stream), stats(2, stream) { @@ -193,7 +193,7 @@ class RngMdspanTest : public ::testing::TestWithParam> { public: RngMdspanTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(0, stream), stats(2, stream) { @@ -397,7 +397,7 @@ TEST(Rng, MeanError) int len = num_samples * num_experiments; raft::resources handle; - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); rmm::device_uvector data(len, stream); rmm::device_uvector mean_result(num_experiments, stream); @@ -443,7 +443,7 @@ TEST(Rng, MeanError) template class ScaledBernoulliTest : public ::testing::Test { public: - ScaledBernoulliTest() : stream(resource::get_cuda_stream(handle)), data(len, stream) {} + ScaledBernoulliTest() : stream(resource::get_cuda_stream(handle).get()), data(len, stream) {} protected: void SetUp() override @@ -470,7 +470,7 @@ class ScaledBernoulliTest : public ::testing::Test { template class ScaledBernoulliMdspanTest : public ::testing::Test { public: - ScaledBernoulliMdspanTest() : stream(resource::get_cuda_stream(handle)), data(len, stream) {} + ScaledBernoulliMdspanTest() : stream(resource::get_cuda_stream(handle).get()), data(len, stream) {} protected: void SetUp() override @@ -511,7 +511,7 @@ TEST_F(ScaledBernoulliMdspanTest2, RangeCheck) { rangeCheck(); } template class BernoulliTest : public ::testing::Test { public: - BernoulliTest() : stream(resource::get_cuda_stream(handle)), data(len, stream) {} + BernoulliTest() : stream(resource::get_cuda_stream(handle).get()), data(len, stream) {} protected: void SetUp() override @@ -540,7 +540,7 @@ class BernoulliTest : public ::testing::Test { template class BernoulliMdspanTest : public ::testing::Test { public: - BernoulliMdspanTest() : stream(resource::get_cuda_stream(handle)), data(len, stream) {} + BernoulliMdspanTest() : stream(resource::get_cuda_stream(handle).get()), data(len, stream) {} protected: void SetUp() override @@ -601,7 +601,7 @@ class RngNormalTableTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream), stats(2, stream), mu_vec(params.cols, stream) @@ -657,7 +657,7 @@ class RngNormalTableMdspanTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream), stats(2, stream), mu_vec(params.cols, stream) diff --git a/cpp/tests/random/rng_discrete.cu b/cpp/tests/random/rng_discrete.cu index db4b807ba9..bb36c84924 100644 --- a/cpp/tests/random/rng_discrete.cu +++ b/cpp/tests/random/rng_discrete.cu @@ -107,7 +107,7 @@ class RngDiscreteTest : public ::testing::TestWithParam> public: RngDiscreteTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), out(params.sampled_len, stream), weights(params.len, stream), histogram(params.len, stream), diff --git a/cpp/tests/random/rng_int.cu b/cpp/tests/random/rng_int.cu index 96d531dea2..5b28ef2668 100644 --- a/cpp/tests/random/rng_int.cu +++ b/cpp/tests/random/rng_int.cu @@ -67,7 +67,7 @@ class RngTest : public ::testing::TestWithParam> { public: RngTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(0, stream), stats(2, stream) { @@ -126,7 +126,7 @@ class RngMdspanTest : public ::testing::TestWithParam> { public: RngMdspanTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(0, stream), stats(2, stream) { diff --git a/cpp/tests/random/rng_pcg_host_api.cu b/cpp/tests/random/rng_pcg_host_api.cu index dba311aba8..9d6fcb0886 100644 --- a/cpp/tests/random/rng_pcg_host_api.cu +++ b/cpp/tests/random/rng_pcg_host_api.cu @@ -48,7 +48,7 @@ RAFT_KERNEL pcg_device_kernel(DType* buffer, template class HostApiTest { public: - HostApiTest() : stream(resource::get_cuda_stream(handle)), d_buffer(0, stream) + HostApiTest() : stream(resource::get_cuda_stream(handle).get()), d_buffer(0, stream) { len = total_threads * CPT * IPC; d_buffer.resize(len, stream); diff --git a/cpp/tests/random/sample_without_replacement.cu b/cpp/tests/random/sample_without_replacement.cu index 8fd877525e..6e237e0744 100644 --- a/cpp/tests/random/sample_without_replacement.cu +++ b/cpp/tests/random/sample_without_replacement.cu @@ -45,7 +45,7 @@ class SWoRTest : public ::testing::TestWithParam> { public: SWoRTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in(params.len, stream), wts(params.len, stream), out(params.sampledLen, stream), @@ -84,7 +84,7 @@ class SWoRMdspanTest : public ::testing::TestWithParam> { public: SWoRMdspanTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in(params.len, stream), wts(params.len, stream), out(params.sampledLen, stream), diff --git a/cpp/tests/sparse/add.cu b/cpp/tests/sparse/add.cu index 72e3924799..61f32511a6 100644 --- a/cpp/tests/sparse/add.cu +++ b/cpp/tests/sparse/add.cu @@ -38,7 +38,7 @@ class CSRAddTest : public ::testing::TestWithParam> public: CSRAddTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), ind_a(params.matrix_a.row_ind.size(), stream), ind_ptr_a(params.matrix_a.row_ind_ptr.size(), stream), values_a(params.matrix_a.row_ind_ptr.size(), stream), diff --git a/cpp/tests/sparse/convert_coo.cu b/cpp/tests/sparse/convert_coo.cu index dba832e46c..926624b1b9 100644 --- a/cpp/tests/sparse/convert_coo.cu +++ b/cpp/tests/sparse/convert_coo.cu @@ -30,7 +30,7 @@ class CSRtoCOOTest : public ::testing::TestWithParam> { public: CSRtoCOOTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), ex_scan(params.ex_scan.size(), stream), verify(params.verify.size(), stream), result(params.verify.size(), stream) diff --git a/cpp/tests/sparse/convert_csr.cu b/cpp/tests/sparse/convert_csr.cu index d4b9a81e10..df61f76dc6 100644 --- a/cpp/tests/sparse/convert_csr.cu +++ b/cpp/tests/sparse/convert_csr.cu @@ -87,7 +87,7 @@ typedef SparseConvertCSRTest COOToCSRTest; TEST_P(COOToCSRTest, Result) { raft::resources handle; - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); int nnz = 8; int m = 4; @@ -181,7 +181,7 @@ template class CSRAdjGraphTest : public ::testing::TestWithParam> { public: CSRAdjGraphTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), params(::testing::TestWithParam>::GetParam()), adj(params.n_rows * params.n_cols, stream), row_ind(params.n_rows, stream), @@ -293,7 +293,7 @@ template class BitmapToCSRTest : public ::testing::TestWithParam> { public: BitmapToCSRTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), params(::testing::TestWithParam>::GetParam()), bitmap_d(0, stream), indices_d(0, stream), @@ -559,7 +559,7 @@ template class BitsetToCSRTest : public ::testing::TestWithParam> { public: BitsetToCSRTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), params(::testing::TestWithParam>::GetParam()), bitset_d(0, stream), indices_d(0, stream), diff --git a/cpp/tests/sparse/csr_row_slice.cu b/cpp/tests/sparse/csr_row_slice.cu index 566d981777..6e7425f78d 100644 --- a/cpp/tests/sparse/csr_row_slice.cu +++ b/cpp/tests/sparse/csr_row_slice.cu @@ -47,7 +47,7 @@ class CSRRowSliceTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), indptr(0, stream), indices(0, stream), data(0, stream), diff --git a/cpp/tests/sparse/csr_to_dense.cu b/cpp/tests/sparse/csr_to_dense.cu index 4d4690e5ad..b7d18e9dae 100644 --- a/cpp/tests/sparse/csr_to_dense.cu +++ b/cpp/tests/sparse/csr_to_dense.cu @@ -46,7 +46,7 @@ class CSRToDenseTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(raft_handle)), + stream(resource::get_cuda_stream(raft_handle).get()), indptr(0, stream), indices(0, stream), data(0, stream), diff --git a/cpp/tests/sparse/csr_transpose.cu b/cpp/tests/sparse/csr_transpose.cu index c494aa94e5..189bbe2584 100644 --- a/cpp/tests/sparse/csr_transpose.cu +++ b/cpp/tests/sparse/csr_transpose.cu @@ -45,7 +45,7 @@ class CSRTransposeTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(raft_handle)), + stream(resource::get_cuda_stream(raft_handle).get()), indptr(0, stream), indices(0, stream), data(0, stream), @@ -105,7 +105,7 @@ class CSRTransposeTest : public ::testing::TestWithParam COORemoveZeros; TEST_P(COORemoveZeros, Result) { raft::resources h; - auto stream = resource::get_cuda_stream(h); + auto stream = resource::get_cuda_stream(h).get(); params = ::testing::TestWithParam>::GetParam(); float* in_h_vals = new float[params.nnz]; @@ -110,7 +110,7 @@ typedef SparseFilterTests COORemoveScalarView; TEST_P(COORemoveScalarView, ResultView) { raft::resources h; - auto stream = resource::get_cuda_stream(h); + auto stream = resource::get_cuda_stream(h).get(); params = ::testing::TestWithParam>::GetParam(); rmm::device_uvector in_rows(params.nnz, stream); diff --git a/cpp/tests/sparse/laplacian.cu b/cpp/tests/sparse/laplacian.cu index 03193cfca8..45c32a72d9 100644 --- a/cpp/tests/sparse/laplacian.cu +++ b/cpp/tests/sparse/laplacian.cu @@ -267,7 +267,7 @@ TEST(Raft, ComputeGraphLaplacianNormalizedCOO) raft::copy(adjacency_structure_csr.get_indptr().data(), &(indptr[0]), indptr.size(), - raft::resource::get_cuda_stream(res)); + raft::resource::get_cuda_stream(res).get()); // Convert CSR to COO auto adjacency_matrix_coo = @@ -280,7 +280,7 @@ TEST(Raft, ComputeGraphLaplacianNormalizedCOO) adjacency_structure_csr.get_n_rows(), adjacency_matrix_coo.structure_view().get_rows().data(), adjacency_structure_csr.get_nnz(), - raft::resource::get_cuda_stream(res)); + raft::resource::get_cuda_stream(res).get()); raft::copy(adjacency_matrix_coo.structure_view().get_cols().data(), adjacency_structure_csr.get_indices().data(), @@ -290,7 +290,7 @@ TEST(Raft, ComputeGraphLaplacianNormalizedCOO) raft::copy(adjacency_matrix_coo.get_elements().data(), adjacency_matrix_csr.get_elements().data(), adjacency_structure_csr.get_nnz(), - raft::resource::get_cuda_stream(res)); + raft::resource::get_cuda_stream(res).get()); // Create diagonal output vector auto diagonal_out = @@ -308,7 +308,7 @@ TEST(Raft, ComputeGraphLaplacianNormalizedCOO) normalized_laplacian_coo_structure.get_rows().data(), normalized_laplacian_coo_structure.get_cols().data(), normalized_laplacian_coo.get_elements().data(), - raft::resource::get_cuda_stream(res)); + raft::resource::get_cuda_stream(res).get()); // Convert COO result to CSR for comparison auto normalized_laplacian_csr = @@ -331,7 +331,7 @@ TEST(Raft, ComputeGraphLaplacianNormalizedCOO) normalized_laplacian_coo_structure.get_nnz(), normalized_laplacian_csr_structure.get_indptr().data(), normalized_laplacian_coo_structure.get_n_rows(), - raft::resource::get_cuda_stream(res)); + raft::resource::get_cuda_stream(res).get()); // Manually set the last element of indptr to nnz (workaround for potential bug) int nnz = normalized_laplacian_coo_structure.get_nnz(); diff --git a/cpp/tests/sparse/masked_matmul.cu b/cpp/tests/sparse/masked_matmul.cu index 9fc3bd7d1b..b6fa7ba086 100644 --- a/cpp/tests/sparse/masked_matmul.cu +++ b/cpp/tests/sparse/masked_matmul.cu @@ -87,8 +87,8 @@ class MaskedMatmulTest public: MaskedMatmulTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), - a_data_d(0, resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), + a_data_d(0, resource::get_cuda_stream(handle).get()), b_data_d(0, resource::get_cuda_stream(handle)), bits_d(0, resource::get_cuda_stream(handle)), c_indptr_d(0, resource::get_cuda_stream(handle)), diff --git a/cpp/tests/sparse/mst.cu b/cpp/tests/sparse/mst.cu index 38f6822002..e0816eea37 100644 --- a/cpp/tests/sparse/mst.cu +++ b/cpp/tests/sparse/mst.cu @@ -131,13 +131,13 @@ class MSTTest : public ::testing::TestWithParam::max(), mst_src.size() * sizeof(vertex_t), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); RAFT_CUDA_TRY(cudaMemsetAsync(mst_dst.data(), std::numeric_limits::max(), mst_dst.size() * sizeof(vertex_t), - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); RAFT_CUDA_TRY(cudaMemsetAsync( - color.data(), 0, color.size() * sizeof(vertex_t), resource::get_cuda_stream(handle))); + color.data(), 0, color.size() * sizeof(vertex_t), resource::get_cuda_stream(handle).get())); vertex_t* color_ptr = thrust::raw_pointer_cast(color.data()); @@ -155,7 +155,7 @@ class MSTTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.data.size(), stream), verify(params.indptr.size() - 1, stream), indptr(params.indptr.size(), stream), diff --git a/cpp/tests/sparse/normalize.cu b/cpp/tests/sparse/normalize.cu index e98abd956c..4e3ed7eb84 100644 --- a/cpp/tests/sparse/normalize.cu +++ b/cpp/tests/sparse/normalize.cu @@ -34,7 +34,7 @@ class CSRRowNormalizeTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), in_vals(params.in_vals.size(), stream), verify(params.verify.size(), stream), ex_scan(params.ex_scan.size(), stream), diff --git a/cpp/tests/sparse/preprocess.cu b/cpp/tests/sparse/preprocess.cu index 069905077f..410c213b22 100644 --- a/cpp/tests/sparse/preprocess.cu +++ b/cpp/tests/sparse/preprocess.cu @@ -27,7 +27,7 @@ void get_clean_coo(raft::resources& handle, int num_cols, raft::sparse::COO& coo) { - cudaStream_t stream = raft::resource::get_cuda_stream(handle); + cudaStream_t stream = raft::resource::get_cuda_stream(handle).get(); raft::sparse::op::coo_sort(int(rows.size()), int(columns.size()), int(values.size()), @@ -54,7 +54,7 @@ create_coo_matrix(raft::resources& handle, int num_rows, int num_cols) { - cudaStream_t stream = raft::resource::get_cuda_stream(handle); + cudaStream_t stream = raft::resource::get_cuda_stream(handle).get(); auto coo_struct_view = raft::make_device_coordinate_structure_view( rows.data_handle(), columns.data_handle(), num_rows, num_cols, int(rows.size())); auto c_matrix = raft::make_device_coo_matrix(handle, coo_struct_view); @@ -67,7 +67,7 @@ template raft::device_coo_matrix create_coo_matrix(raft::resources& handle, raft::sparse::COO& coo) { - cudaStream_t stream = raft::resource::get_cuda_stream(handle); + cudaStream_t stream = raft::resource::get_cuda_stream(handle).get(); auto coo_struct_view = raft::make_device_coordinate_structure_view( coo.rows(), coo.cols(), coo.n_rows, coo.n_cols, int(coo.nnz)); auto c_matrix = raft::make_device_coo_matrix(handle, coo_struct_view); @@ -88,7 +88,7 @@ class SparsePreprocessCSR public: SparsePreprocessCSR() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)) + stream(resource::get_cuda_stream(handle).get()) { } @@ -97,7 +97,7 @@ class SparsePreprocessCSR void Run(bool bm25_on, bool coo_on) { - cudaStream_t stream = raft::resource::get_cuda_stream(handle); + cudaStream_t stream = raft::resource::get_cuda_stream(handle).get(); int num_rows = pow(2, params.n_rows); int num_cols = pow(2, params.n_cols); int nnz = params.nnz_edges; diff --git a/cpp/tests/sparse/reduce.cu b/cpp/tests/sparse/reduce.cu index 183a57bc2a..c42e97959f 100644 --- a/cpp/tests/sparse/reduce.cu +++ b/cpp/tests/sparse/reduce.cu @@ -46,7 +46,7 @@ class SparseReduceTest : public ::testing::TestWithParam in_rows(params.in_rows.size(), stream); rmm::device_uvector in_cols(params.in_cols.size(), stream); diff --git a/cpp/tests/sparse/row_op.cu b/cpp/tests/sparse/row_op.cu index 89cfbf35c5..ac5758c288 100644 --- a/cpp/tests/sparse/row_op.cu +++ b/cpp/tests/sparse/row_op.cu @@ -46,7 +46,7 @@ class CSRRowOpTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), verify(params.verify.size(), stream), ex_scan(params.ex_scan.size(), stream), result(params.verify.size(), stream) diff --git a/cpp/tests/sparse/sddmm.cu b/cpp/tests/sparse/sddmm.cu index 3d68b60395..30a2443b30 100644 --- a/cpp/tests/sparse/sddmm.cu +++ b/cpp/tests/sparse/sddmm.cu @@ -75,8 +75,8 @@ class SDDMMTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), - a_data_d(0, resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), + a_data_d(0, resource::get_cuda_stream(handle).get()), b_data_d(0, resource::get_cuda_stream(handle)), c_indptr_d(0, resource::get_cuda_stream(handle)), c_indices_d(0, resource::get_cuda_stream(handle)), diff --git a/cpp/tests/sparse/select_k_csr.cu b/cpp/tests/sparse/select_k_csr.cu index d6fe4ca3dc..b0a8434f85 100644 --- a/cpp/tests/sparse/select_k_csr.cu +++ b/cpp/tests/sparse/select_k_csr.cu @@ -61,7 +61,7 @@ template class SelectKCsrTest : public ::testing::TestWithParam> { public: SelectKCsrTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), params(::testing::TestWithParam>::GetParam()), indices_d(0, stream), customized_indices_d(0, stream), diff --git a/cpp/tests/sparse/solver/lanczos.cu b/cpp/tests/sparse/solver/lanczos.cu index bdc3173c04..5129dd7f5b 100644 --- a/cpp/tests/sparse/solver/lanczos.cu +++ b/cpp/tests/sparse/solver/lanczos.cu @@ -337,7 +337,7 @@ std::vector compute_full_spectrum( IndexType n = structure.get_n_rows(); auto dense = raft::make_device_matrix(handle, n, n); - RAFT_CUDA_TRY(cudaMemsetAsync(dense.data_handle(), 0, dense.size() * sizeof(ValueType), stream)); + RAFT_CUDA_TRY(cudaMemsetAsync(dense.data_handle(), 0, dense.size() * sizeof(ValueType), stream.get())); raft::sparse::convert::csr_to_dense( resource::get_cusparse_handle(handle), n, @@ -348,7 +348,7 @@ std::vector compute_full_spectrum( A.get_elements().data(), n, dense.data_handle(), - stream, + stream.get(), false); // column-major output; A is symmetric so row/col-major coincide anyway auto ref_vectors = raft::make_device_matrix(handle, n, n); @@ -435,7 +435,7 @@ class rmat_lanczos_tests public: rmat_lanczos_tests() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), rng(params.seed), r_scale(params.r_scale), c_scale(params.c_scale), @@ -642,7 +642,7 @@ class lanczos_tests : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), n(params.rows.size() - 1), nnz(params.vals.size()), rng(params.seed), diff --git a/cpp/tests/sparse/solver/lanczos_svds.cu b/cpp/tests/sparse/solver/lanczos_svds.cu index 675edc088d..c3bb2a50ba 100644 --- a/cpp/tests/sparse/solver/lanczos_svds.cu +++ b/cpp/tests/sparse/solver/lanczos_svds.cu @@ -59,7 +59,7 @@ template class LanczosSvdsTest : public ::testing::Test { public: LanczosSvdsTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), m(12), n(8), k(3), @@ -172,7 +172,7 @@ template class LanczosClusteredSpectrumTest : public ::testing::Test { public: LanczosClusteredSpectrumTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), m(48), n(32), k(8), @@ -881,7 +881,7 @@ struct dense_linear_operator { CUBLAS_OP_N, ValueType(1), ValueType(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } void apply_transpose(raft::resources const& handle, @@ -900,7 +900,7 @@ struct dense_linear_operator { CUBLAS_OP_N, ValueType(1), ValueType(0), - resource::get_cuda_stream(handle)); + resource::get_cuda_stream(handle).get()); } }; diff --git a/cpp/tests/sparse/solver/randomized_svds.cu b/cpp/tests/sparse/solver/randomized_svds.cu index c1841c8036..43e7514824 100644 --- a/cpp/tests/sparse/solver/randomized_svds.cu +++ b/cpp/tests/sparse/solver/randomized_svds.cu @@ -94,7 +94,7 @@ template class RandomizedSvdsTest : public ::testing::Test { public: RandomizedSvdsTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), m(20), n(15), k(3), @@ -233,7 +233,7 @@ template class OptionalUVtTest : public ::testing::Test { public: OptionalUVtTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), m(20), n(15), k(3), @@ -395,7 +395,7 @@ TEST_F(OptionalUVtTestD, AllModes) { Run(); } struct ReconstructionErrorTest : public ::testing::Test { raft::resources handle; cudaStream_t stream; - ReconstructionErrorTest() : stream(resource::get_cuda_stream(handle)) {} + ReconstructionErrorTest() : stream(resource::get_cuda_stream(handle).get()) {} void Run() { @@ -574,7 +574,7 @@ struct mean_centered_operator { class MeanCenteredOperatorTest : public ::testing::Test { public: - MeanCenteredOperatorTest() : stream(resource::get_cuda_stream(handle)) {} + MeanCenteredOperatorTest() : stream(resource::get_cuda_stream(handle).get()) {} protected: void Run() diff --git a/cpp/tests/sparse/sort.cu b/cpp/tests/sparse/sort.cu index 9414d5c624..034a6f6d79 100644 --- a/cpp/tests/sparse/sort.cu +++ b/cpp/tests/sparse/sort.cu @@ -43,7 +43,7 @@ TEST_P(COOSort, Result) params = ::testing::TestWithParam>::GetParam(); raft::random::RngState r(params.seed); raft::resources h; - auto stream = resource::get_cuda_stream(h); + auto stream = resource::get_cuda_stream(h).get(); rmm::device_uvector in_rows(params.nnz, stream); rmm::device_uvector in_cols(params.nnz, stream); diff --git a/cpp/tests/sparse/spgemmi.cu b/cpp/tests/sparse/spgemmi.cu index dc933a8a6e..e444f58141 100644 --- a/cpp/tests/sparse/spgemmi.cu +++ b/cpp/tests/sparse/spgemmi.cu @@ -31,7 +31,7 @@ class SPGemmiTest : public ::testing::TestWithParam { public: SPGemmiTest() : params(::testing::TestWithParam::GetParam()), - stream(resource::get_cuda_stream(handle)) + stream(resource::get_cuda_stream(handle).get()) { } @@ -104,7 +104,7 @@ class SPGemmiTest : public ::testing::TestWithParam { &beta, dC.data(), ldc, - resource::get_cuda_stream(handle))); + resource::get_cuda_stream(handle).get())); //-------------------------------------------------------------------------- // result check diff --git a/cpp/tests/sparse/spmm.cu b/cpp/tests/sparse/spmm.cu index 778e2bd2f4..59f3e0031f 100644 --- a/cpp/tests/sparse/spmm.cu +++ b/cpp/tests/sparse/spmm.cu @@ -88,7 +88,7 @@ class SpmmTest : public ::testing::TestWithParam> { { params = ::testing::TestWithParam>::GetParam(); - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); // We compute Z = X * Y and compare against reference result // Dimensions of X : M x K @@ -138,7 +138,7 @@ class SpmmTest : public ::testing::TestWithParam> { void runTest() { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); auto [ldx, ldy, ldz, x_size, y_size, z_size] = getXYZStrides(); @@ -225,7 +225,7 @@ class SpmmTest : public ::testing::TestWithParam> { { double eps = 1e-4; - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); size_t dense_size = n_rows * n_cols; std::vector dense_host(dense_size); diff --git a/cpp/tests/sparse/symmetrize.cu b/cpp/tests/sparse/symmetrize.cu index d794ca4086..6d279099fb 100644 --- a/cpp/tests/sparse/symmetrize.cu +++ b/cpp/tests/sparse/symmetrize.cu @@ -58,7 +58,7 @@ class SparseSymmetrizeTest public: SparseSymmetrizeTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), indptr(0, stream), indices(0, stream), data(0, stream) @@ -164,7 +164,7 @@ typedef COOSymmetrizeTest COOSymmetrizeView; TEST_P(COOSymmetrizeView, ResultView) { raft::resources handle; - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); rmm::device_uvector in_rows(params.nnz, stream); rmm::device_uvector in_cols(params.nnz, stream); @@ -226,7 +226,7 @@ TEST_P(COOSymmetrizeView, ResultView) TEST_P(COOSymmetrizeView, ResultLegacy) { raft::resources handle; - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); raft::sparse::COO in(stream, params.nnz, params.n_rows, params.n_cols, false); raft::sparse::COO out(stream); @@ -255,7 +255,7 @@ TEST_P(COOSymmetrizeView, ResultLegacy) TEST(FromKnnSymmetrizeTest, RestrictedPointerArguments) { raft::resources handle; - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); constexpr int n = 2; constexpr int k = 1; diff --git a/cpp/tests/stats/accuracy.cu b/cpp/tests/stats/accuracy.cu index 0ca2be24eb..4b09858924 100644 --- a/cpp/tests/stats/accuracy.cu +++ b/cpp/tests/stats/accuracy.cu @@ -39,7 +39,7 @@ template template class AccuracyTest : public ::testing::TestWithParam> { protected: - AccuracyTest() : stream(resource::get_cuda_stream(handle)) {} + AccuracyTest() : stream(resource::get_cuda_stream(handle).get()) {} void SetUp() override { diff --git a/cpp/tests/stats/adjusted_rand_index.cu b/cpp/tests/stats/adjusted_rand_index.cu index 4aebfab025..fae598e0b6 100644 --- a/cpp/tests/stats/adjusted_rand_index.cu +++ b/cpp/tests/stats/adjusted_rand_index.cu @@ -34,7 +34,7 @@ template class adjustedRandIndexTest : public ::testing::TestWithParam { protected: adjustedRandIndexTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), firstClusterArray(0, stream), secondClusterArray(0, stream) { diff --git a/cpp/tests/stats/completeness_score.cu b/cpp/tests/stats/completeness_score.cu index a0e66f255c..e18506d5ec 100644 --- a/cpp/tests/stats/completeness_score.cu +++ b/cpp/tests/stats/completeness_score.cu @@ -33,7 +33,7 @@ template class completenessTest : public ::testing::TestWithParam { protected: // the constructor - completenessTest() : stream(resource::get_cuda_stream(handle)) {} + completenessTest() : stream(resource::get_cuda_stream(handle).get()) {} void SetUp() override { diff --git a/cpp/tests/stats/contingencyMatrix.cu b/cpp/tests/stats/contingencyMatrix.cu index 70f46311eb..1996a0b3e7 100644 --- a/cpp/tests/stats/contingencyMatrix.cu +++ b/cpp/tests/stats/contingencyMatrix.cu @@ -34,7 +34,7 @@ template class ContingencyMatrixTest : public ::testing::TestWithParam { protected: ContingencyMatrixTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), dY(0, stream), dYHat(0, stream), dComputedOutput(0, stream), diff --git a/cpp/tests/stats/cov.cu b/cpp/tests/stats/cov.cu index 07b2fbf0ab..d17b64763d 100644 --- a/cpp/tests/stats/cov.cu +++ b/cpp/tests/stats/cov.cu @@ -48,7 +48,7 @@ class CovTest : public ::testing::TestWithParam> { void SetUp() override { raft::resources handle; - cudaStream_t stream = resource::get_cuda_stream(handle); + cudaStream_t stream = resource::get_cuda_stream(handle).get(); params = ::testing::TestWithParam>::GetParam(); params.tolerance *= 2; @@ -116,7 +116,7 @@ class CovTest : public ::testing::TestWithParam> { 3, true, true, - resource::get_cuda_stream(h)); + resource::get_cuda_stream(h).get()); }, raft::alloc_behavior::NO_ALLOCATIONS); } diff --git a/cpp/tests/stats/dispersion.cu b/cpp/tests/stats/dispersion.cu index 38f641dfe4..f4a3131da7 100644 --- a/cpp/tests/stats/dispersion.cu +++ b/cpp/tests/stats/dispersion.cu @@ -40,7 +40,7 @@ template class DispersionTest : public ::testing::TestWithParam> { protected: DispersionTest() - : stream(resource::get_cuda_stream(handle)), exp_mean(0, stream), act_mean(0, stream) + : stream(resource::get_cuda_stream(handle).get()), exp_mean(0, stream), act_mean(0, stream) { } diff --git a/cpp/tests/stats/entropy.cu b/cpp/tests/stats/entropy.cu index af70e1bc5e..13792c98e6 100644 --- a/cpp/tests/stats/entropy.cu +++ b/cpp/tests/stats/entropy.cu @@ -32,7 +32,7 @@ template class entropyTest : public ::testing::TestWithParam { protected: // the constructor - entropyTest() : stream(resource::get_cuda_stream(handle)) {} + entropyTest() : stream(resource::get_cuda_stream(handle).get()) {} void SetUp() override { diff --git a/cpp/tests/stats/histogram.cu b/cpp/tests/stats/histogram.cu index 06cd38deff..709dd80d05 100644 --- a/cpp/tests/stats/histogram.cu +++ b/cpp/tests/stats/histogram.cu @@ -66,7 +66,7 @@ class HistTest : public ::testing::TestWithParam { { params = ::testing::TestWithParam::GetParam(); raft::random::RngState r(params.seed); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); int len = params.nrows * params.ncols; in.resize(len, stream); if (params.isNormal) { @@ -107,7 +107,7 @@ class HistMdspanTest : public ::testing::TestWithParam { { params = ::testing::TestWithParam::GetParam(); raft::random::RngState r(params.seed); - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); int len = params.nrows * params.ncols; in.resize(len, stream); diff --git a/cpp/tests/stats/homogeneity_score.cu b/cpp/tests/stats/homogeneity_score.cu index 7e24367c05..f4d522a48d 100644 --- a/cpp/tests/stats/homogeneity_score.cu +++ b/cpp/tests/stats/homogeneity_score.cu @@ -41,7 +41,7 @@ class homogeneityTest : public ::testing::TestWithParam { nElements = params.nElements; lowerLabelRange = params.lowerLabelRange; upperLabelRange = params.upperLabelRange; - stream = resource::get_cuda_stream(handle); + stream = resource::get_cuda_stream(handle).get(); // generating random value test input std::vector arr1(nElements, 0); diff --git a/cpp/tests/stats/information_criterion.cu b/cpp/tests/stats/information_criterion.cu index 5efe91240f..191fec0821 100644 --- a/cpp/tests/stats/information_criterion.cu +++ b/cpp/tests/stats/information_criterion.cu @@ -53,7 +53,7 @@ class BatchedICTest : public ::testing::TestWithParam> { public: BatchedICTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), res_d(sizeof(T) * params.batch_size, stream) { } diff --git a/cpp/tests/stats/kl_divergence.cu b/cpp/tests/stats/kl_divergence.cu index 32e4032fcd..09fb538c6a 100644 --- a/cpp/tests/stats/kl_divergence.cu +++ b/cpp/tests/stats/kl_divergence.cu @@ -32,7 +32,7 @@ class klDivergenceTest : public ::testing::TestWithParam { { // getting the parameters params = ::testing::TestWithParam::GetParam(); - stream = resource::get_cuda_stream(handle); + stream = resource::get_cuda_stream(handle).get(); nElements = params.nElements; diff --git a/cpp/tests/stats/mean.cu b/cpp/tests/stats/mean.cu index d0b241de85..cb59dc984a 100644 --- a/cpp/tests/stats/mean.cu +++ b/cpp/tests/stats/mean.cu @@ -64,7 +64,7 @@ class MeanTest : public ::testing::TestWithParam> { public: MeanTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), rows(params.rows), cols(params.cols), data(raft::make_device_matrix(handle, rows, cols)), diff --git a/cpp/tests/stats/mean_center.cu b/cpp/tests/stats/mean_center.cu index 914c7a0a18..8febb3608e 100644 --- a/cpp/tests/stats/mean_center.cu +++ b/cpp/tests/stats/mean_center.cu @@ -36,7 +36,7 @@ class MeanCenterTest : public ::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), rows(params.rows), cols(params.cols), out(rows * cols, stream), diff --git a/cpp/tests/stats/meanvar.cu b/cpp/tests/stats/meanvar.cu index 812969d7c9..f86420c0db 100644 --- a/cpp/tests/stats/meanvar.cu +++ b/cpp/tests/stats/meanvar.cu @@ -46,7 +46,7 @@ class MeanVarTest : public ::testing::TestWithParam> { public: MeanVarTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), data(params.rows * params.cols, stream), mean_act(params.cols, stream), vars_act(params.cols, stream) diff --git a/cpp/tests/stats/minmax.cu b/cpp/tests/stats/minmax.cu index dc67896eec..8bbf02a5cf 100644 --- a/cpp/tests/stats/minmax.cu +++ b/cpp/tests/stats/minmax.cu @@ -94,7 +94,7 @@ class MinMaxTest : public ::testing::TestWithParam> { void SetUp() override { - auto stream = resource::get_cuda_stream(handle); + auto stream = resource::get_cuda_stream(handle).get(); params = ::testing::TestWithParam>::GetParam(); raft::random::RngState r(params.seed); int len = params.rows * params.cols; diff --git a/cpp/tests/stats/mutual_info_score.cu b/cpp/tests/stats/mutual_info_score.cu index 0c533f1cd6..a469334bd3 100644 --- a/cpp/tests/stats/mutual_info_score.cu +++ b/cpp/tests/stats/mutual_info_score.cu @@ -93,7 +93,7 @@ class mutualInfoTest : public ::testing::TestWithParam { truthmutualInfo /= nElements; // allocating and initializing memory to the GPU - stream = resource::get_cuda_stream(handle); + stream = resource::get_cuda_stream(handle).get(); rmm::device_uvector firstClusterArray(nElements, stream); rmm::device_uvector secondClusterArray(nElements, stream); diff --git a/cpp/tests/stats/r2_score.cu b/cpp/tests/stats/r2_score.cu index f3223101e4..4db685a697 100644 --- a/cpp/tests/stats/r2_score.cu +++ b/cpp/tests/stats/r2_score.cu @@ -39,7 +39,7 @@ template template class R2_scoreTest : public ::testing::TestWithParam> { protected: - R2_scoreTest() : stream(resource::get_cuda_stream(handle)) {} + R2_scoreTest() : stream(resource::get_cuda_stream(handle).get()) {} void SetUp() override { diff --git a/cpp/tests/stats/rand_index.cu b/cpp/tests/stats/rand_index.cu index e76ebe9b8e..5c6f05060e 100644 --- a/cpp/tests/stats/rand_index.cu +++ b/cpp/tests/stats/rand_index.cu @@ -72,7 +72,7 @@ class randIndexTest : public ::testing::TestWithParam { } // allocating and initializing memory to the GPU - stream = resource::get_cuda_stream(handle); + stream = resource::get_cuda_stream(handle).get(); rmm::device_uvector firstClusterArray(size, stream); rmm::device_uvector secondClusterArray(size, stream); diff --git a/cpp/tests/stats/regression_metrics.cu b/cpp/tests/stats/regression_metrics.cu index 680a3f0d0f..8d65fa56d0 100644 --- a/cpp/tests/stats/regression_metrics.cu +++ b/cpp/tests/stats/regression_metrics.cu @@ -69,7 +69,7 @@ void naive_reg_metrics(std::vector& predictions, template class RegressionTest : public ::testing::TestWithParam> { protected: - RegressionTest() : stream(resource::get_cuda_stream(handle)) {} + RegressionTest() : stream(resource::get_cuda_stream(handle).get()) {} void SetUp() override { diff --git a/cpp/tests/stats/stddev.cu b/cpp/tests/stats/stddev.cu index a8e544ff12..663bc46e9a 100644 --- a/cpp/tests/stats/stddev.cu +++ b/cpp/tests/stats/stddev.cu @@ -37,7 +37,7 @@ class StdDevTest : public ::testing::TestWithParam> { public: StdDevTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), rows(params.rows), cols(params.cols), data(rows * cols, stream), diff --git a/cpp/tests/stats/sum.cu b/cpp/tests/stats/sum.cu index cb762597f3..e441c9e0c1 100644 --- a/cpp/tests/stats/sum.cu +++ b/cpp/tests/stats/sum.cu @@ -38,7 +38,7 @@ class SumTest : public ::testing::TestWithParam> { public: SumTest() : params(::testing::TestWithParam>::GetParam()), - stream(resource::get_cuda_stream(handle)), + stream(resource::get_cuda_stream(handle).get()), rows(params.rows), cols(params.cols), data(rows * cols, stream), diff --git a/cpp/tests/stats/v_measure.cu b/cpp/tests/stats/v_measure.cu index d436e1c9c5..b689ea2653 100644 --- a/cpp/tests/stats/v_measure.cu +++ b/cpp/tests/stats/v_measure.cu @@ -58,7 +58,7 @@ class vMeasureTest : public ::testing::TestWithParam { // allocating and initializing memory to the GPU - stream = resource::get_cuda_stream(handle); + stream = resource::get_cuda_stream(handle).get(); rmm::device_uvector truthClusterArray(nElements, stream); rmm::device_uvector predClusterArray(nElements, stream); raft::update_device(truthClusterArray.data(), &arr1[0], (int)nElements, stream); diff --git a/cpp/tests/util/bitonic_sort.cu b/cpp/tests/util/bitonic_sort.cu index 61be78c9c8..7adff1bfb5 100644 --- a/cpp/tests/util/bitonic_sort.cu +++ b/cpp/tests/util/bitonic_sort.cu @@ -154,7 +154,7 @@ class BitonicTest : public testing::TestWithParam { // NOLINT update_host(out.data(), arr_d.data(), arr_d.size(), stream); // make sure the results are available on host - stream.synchronize(); + stream.sync(); // calculate the reference std::copy(in.begin(), in.end(), ref.begin()); diff --git a/cpp/tests/util/cudart_utils.cpp b/cpp/tests/util/cudart_utils.cpp index 2d7f56aa46..9271a9db02 100644 --- a/cpp/tests/util/cudart_utils.cpp +++ b/cpp/tests/util/cudart_utils.cpp @@ -139,12 +139,12 @@ TEST(Raft, Copy2DAsync) } } RAFT_CUDA_TRY(cudaMemcpyAsync( - d_src.data(), h_src.data(), pitch * elem_size * rows, cudaMemcpyHostToDevice, stream)); - RAFT_CUDA_TRY(cudaMemsetAsync(d_dst.data(), 0, pitch * elem_size * rows, stream)); + d_src.data(), h_src.data(), pitch * elem_size * rows, cudaMemcpyHostToDevice, stream.get())); + RAFT_CUDA_TRY(cudaMemsetAsync(d_dst.data(), 0, pitch * elem_size * rows, stream.get())); - raft::copy_matrix(d_dst.data(), pitch, d_src.data(), pitch, width, height, stream); + raft::copy_matrix(d_dst.data(), pitch, d_src.data(), pitch, width, height, stream.get()); RAFT_CUDA_TRY(cudaMemcpyAsync( - h_dst.data(), d_dst.data(), pitch * elem_size * rows, cudaMemcpyDeviceToHost, stream)); + h_dst.data(), d_dst.data(), pitch * elem_size * rows, cudaMemcpyDeviceToHost, stream.get())); raft::resource::sync_stream(handle); for (size_t r = 0; r < rows; ++r) { diff --git a/cpp/tests/util/device_atomics.cu b/cpp/tests/util/device_atomics.cu index acbbafaefa..8177dc03f4 100644 --- a/cpp/tests/util/device_atomics.cu +++ b/cpp/tests/util/device_atomics.cu @@ -44,7 +44,7 @@ TEST(Raft, AtomicIncWarp) std::array out_host{0}; // Write all 1M thread indices to a unique location in `out_device` - raft::launch_kernel(s, + raft::launch_kernel(s.get(), num_blocks, threads_per_block, test_atomic_inc_warp_kernel, @@ -55,7 +55,7 @@ TEST(Raft, AtomicIncWarp) (const void*)out_device.data(), num_elts * sizeof(int), cudaMemcpyDeviceToHost, - s)); + s.get())); // Check that count is correct and that each thread index is contained in the // array exactly once. diff --git a/cpp/tests/util/dry_run_resources.cpp b/cpp/tests/util/dry_run_resources.cpp index ffce61b083..e07005a1ce 100644 --- a/cpp/tests/util/dry_run_resources.cpp +++ b/cpp/tests/util/dry_run_resources.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include diff --git a/cpp/tests/util/integer_utils.cu b/cpp/tests/util/integer_utils.cu index ef23fd4373..7275ca690b 100644 --- a/cpp/tests/util/integer_utils.cu +++ b/cpp/tests/util/integer_utils.cu @@ -38,7 +38,7 @@ RAFT_KERNEL mul64_test_kernel(uint64_t* result_high, class Multiplication64bit : public testing::TestWithParam { protected: Multiplication64bit() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), d_result_high(stream), d_result_low(stream), d_swapped_result_high(stream), diff --git a/cpp/tests/util/kernel_launch.cu b/cpp/tests/util/kernel_launch.cu index 3bca911184..3b450e9670 100644 --- a/cpp/tests/util/kernel_launch.cu +++ b/cpp/tests/util/kernel_launch.cu @@ -119,8 +119,8 @@ static_assert(!launchable_at_runtime, "too many arguments TEST(KernelLaunch, SuccessfulLaunch) { raft::resources res; - rmm::device_uvector out(1, resource::get_cuda_stream(res)); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), resource::get_cuda_stream(res))); + rmm::device_uvector out(1, resource::get_cuda_stream(res).get()); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), resource::get_cuda_stream(res).get())); raft::launch_kernel(res, 1, 32, write_one_kernel, out.data()); resource::sync_stream(res); @@ -133,8 +133,8 @@ TEST(KernelLaunch, SuccessfulLaunch) TEST(KernelLaunch, RestrictedPointerArgument) { raft::resources res; - rmm::device_uvector out(1, resource::get_cuda_stream(res)); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), resource::get_cuda_stream(res))); + rmm::device_uvector out(1, resource::get_cuda_stream(res).get()); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), resource::get_cuda_stream(res).get())); launch_write_one_with_restricted_pointer(res, out.data()); resource::sync_stream(res); @@ -147,7 +147,7 @@ TEST(KernelLaunch, RestrictedPointerArgument) TEST(KernelLaunch, ConvertedRestrictedPointerArgument) { raft::resources res; - auto stream = resource::get_cuda_stream(res); + auto stream = resource::get_cuda_stream(res).get(); rmm::device_uvector in(1, stream); rmm::device_uvector out(1, stream); int host_in = 1; @@ -172,7 +172,7 @@ TEST(KernelLaunch, StreamOverload) TEST(KernelLaunch, RawStreamHandleOverload) { raft::resources res; - cudaStream_t stream = resource::get_cuda_stream(res).value(); + cudaStream_t stream = resource::get_cuda_stream(res).get(); EXPECT_NO_THROW(raft::launch_kernel(stream, 1, 1, noop_kernel)); resource::sync_stream(res); } @@ -182,7 +182,7 @@ TEST(KernelLaunch, SharedMemory) raft::resources res; auto stream = resource::get_cuda_stream(res); rmm::device_uvector out(1, stream); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream)); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream.get())); raft::launch_kernel({stream, sizeof(int)}, 1, 32, smem_kernel, out.data()); resource::sync_stream(res); @@ -222,7 +222,7 @@ TEST(KernelLaunch, ErrorReportsCallSite) TEST(KernelLaunch, DryRunSkipsLaunch) { raft::resources res; - auto stream = resource::get_cuda_stream(res); + auto stream = resource::get_cuda_stream(res).get(); // Allocate and zero with the real resources: dry-run memory must never be written to. rmm::device_uvector out(1, stream); RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream)); @@ -254,7 +254,7 @@ TEST(KernelLaunch, SkipExecutionOnStream) raft::resources res; auto stream = resource::get_cuda_stream(res); rmm::device_uvector out(1, stream); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream)); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream.get())); raft::launch_kernel({stream, 0, true}, 1, 32, write_one_kernel, out.data()); resource::sync_stream(res); @@ -268,7 +268,7 @@ TEST(KernelLaunch, CooperativeLaunch) { raft::resources res; rmm::device_uvector out(1, resource::get_cuda_stream(res)); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), resource::get_cuda_stream(res))); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), resource::get_cuda_stream(res).get())); raft::launch_kernel({res, 0, {raft::cooperative()}}, 1, 32, write_one_kernel, out.data()); resource::sync_stream(res); @@ -299,7 +299,7 @@ TEST(KernelLaunch, SharedMemoryCarveout) raft::resources res; auto stream = resource::get_cuda_stream(res); rmm::device_uvector out(1, stream); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream)); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream.get())); raft::launch_kernel( {res, sizeof(int), {raft::shmem_carveout(100)}}, 1, 32, smem_kernel, out.data()); @@ -315,7 +315,7 @@ TEST(KernelLaunch, MultipleAttributes) raft::resources res; auto stream = resource::get_cuda_stream(res); rmm::device_uvector out(1, stream); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream)); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream.get())); raft::launch_kernel({res, sizeof(int), {raft::cooperative(), raft::shmem_carveout(50)}}, 1, @@ -334,7 +334,7 @@ TEST(KernelLaunch, AttributesInDryRunAreSkipped) raft::resources res; auto stream = resource::get_cuda_stream(res); rmm::device_uvector out(1, stream); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream)); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream.get())); resource::sync_stream(res); auto launch = [&](raft::resources const& h) { @@ -361,7 +361,7 @@ TEST(KernelLaunch, RuntimeKernelLaunch) { raft::resources res; rmm::device_uvector out(1, resource::get_cuda_stream(res)); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), resource::get_cuda_stream(res))); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), resource::get_cuda_stream(res).get())); raft::launch_kernel( res, 1, 32, raft::kernel_ref{handle_of(write_one_kernel)}, out.data()); @@ -377,7 +377,7 @@ TEST(KernelLaunch, RuntimeKernelConvertsArguments) raft::resources res; auto stream = resource::get_cuda_stream(res); rmm::device_uvector out(1, stream); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream)); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream.get())); // A std::size_t into a std::uint32_t parameter: the conversion is what lets a call site drop the // casts that a launch taking the addresses of its arguments would need for the sizes to match. @@ -402,7 +402,7 @@ TEST(KernelLaunch, RuntimeKernelConvertsPointerArgument) rmm::device_uvector in(1, stream); rmm::device_uvector out(1, stream); int host_in = 1; - RAFT_CUDA_TRY(cudaMemcpyAsync(in.data(), &host_in, sizeof(int), cudaMemcpyHostToDevice, stream)); + RAFT_CUDA_TRY(cudaMemcpyAsync(in.data(), &host_in, sizeof(int), cudaMemcpyHostToDevice, stream.get())); // `int*` into a `int const*` parameter. raft::launch_kernel(res, @@ -422,7 +422,7 @@ TEST(KernelLaunch, CooperativeRuntimeKernel) { raft::resources res; rmm::device_uvector out(1, resource::get_cuda_stream(res)); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), resource::get_cuda_stream(res))); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), resource::get_cuda_stream(res).get())); // The two features are independent: a runtime kernel takes its attributes from `launch_on` just // like a statically compiled one. @@ -443,7 +443,7 @@ TEST(KernelLaunch, RuntimeKernelDryRunSkipsLaunch) raft::resources res; auto stream = resource::get_cuda_stream(res); rmm::device_uvector out(1, stream); - RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream)); + RAFT_CUDA_TRY(cudaMemsetAsync(out.data(), 0, sizeof(int), stream.get())); resource::sync_stream(res); auto handle = handle_of(write_one_kernel); diff --git a/cpp/tests/util/popc.cu b/cpp/tests/util/popc.cu index bcffd61542..5a6181aa5b 100644 --- a/cpp/tests/util/popc.cu +++ b/cpp/tests/util/popc.cu @@ -37,7 +37,7 @@ template class PopcTest : public ::testing::TestWithParam> { public: PopcTest() - : stream(resource::get_cuda_stream(handle)), + : stream(resource::get_cuda_stream(handle).get()), params(::testing::TestWithParam>::GetParam()), bits_d(0, stream) { diff --git a/cpp/tests/util/preprocess_utils.cu b/cpp/tests/util/preprocess_utils.cu index c71316d9d9..152648d0ad 100644 --- a/cpp/tests/util/preprocess_utils.cu +++ b/cpp/tests/util/preprocess_utils.cu @@ -34,7 +34,7 @@ void preproc(raft::resources& handle, int num_cols, bool tf_idf) { - cudaStream_t stream = raft::resource::get_cuda_stream(handle); + cudaStream_t stream = raft::resource::get_cuda_stream(handle).get(); // create matrix and copy to device auto host_dense_vals = raft::make_host_vector(handle, dense_values.size()); @@ -132,7 +132,7 @@ void calc_tfidf_bm25(raft::resources& handle, ResultVectorView results, bool tf_idf = false) { - cudaStream_t stream = raft::resource::get_cuda_stream(handle); + cudaStream_t stream = raft::resource::get_cuda_stream(handle).get(); int num_rows = csr_in.structure_view().get_n_rows(); int num_cols = csr_in.structure_view().get_n_cols(); int rows_size = csr_in.structure_view().get_indptr().size(); @@ -176,7 +176,7 @@ void create_dataset(raft::resources& handle, int num_cols_unique = 7, int seed = 12345) { - cudaStream_t stream = raft::resource::get_cuda_stream(handle); + cudaStream_t stream = raft::resource::get_cuda_stream(handle).get(); raft::random::RngState rng(seed); auto d_out = raft::make_device_vector(handle, rows.size() * 2); diff --git a/cpp/tests/util/reduction.cu b/cpp/tests/util/reduction.cu index bf970e1ef2..ada6265d0f 100644 --- a/cpp/tests/util/reduction.cu +++ b/cpp/tests/util/reduction.cu @@ -82,7 +82,7 @@ struct reduction_launch { const int grid_dim = 1; raft::launch_kernel( stream, grid_dim, block_dim, test_reduction_kernel, arr_d.data(), ref_d.data(), reduce_op); - stream.synchronize(); + stream.sync(); RAFT_CUDA_TRY(cudaPeekAtLastError()); ASSERT_EQ(ref_d.value(stream), ref_val); } @@ -106,7 +106,7 @@ struct reduction_launch { ref_d.data(), rank_d.data(), reduce_op); - stream.synchronize(); + stream.sync(); RAFT_CUDA_TRY(cudaPeekAtLastError()); ASSERT_EQ(ref_d.value(stream), ref_val); ASSERT_EQ(rank_d.value(stream), rank_ref_val); @@ -121,7 +121,7 @@ struct reduction_launch { const int grid_dim = 1; raft::launch_kernel( stream, grid_dim, block_dim, test_block_random_sample_kernel, arr_d.data(), ref_d.data()); - stream.synchronize(); + stream.sync(); RAFT_CUDA_TRY(cudaPeekAtLastError()); ASSERT_EQ(ref_d.value(stream), ref_val); } @@ -139,7 +139,7 @@ struct reduction_launch { test_binary_reduction_kernel, arr_d.data(), ref_d.data()); - stream.synchronize(); + stream.sync(); RAFT_CUDA_TRY(cudaPeekAtLastError()); ASSERT_EQ(ref_d.value(stream), ref_val); }