Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cpp/src/randomforest/randomforest.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class RandomForest {
int stream_id = omp_get_thread_num();
auto s = handle.get_stream_from_stream_pool(stream_id);

auto& selected_rows = row_sampler.sample(i, stream_id, s);
auto& selected_rows = row_sampler.sample(i, stream_id, s.get());

/* Build individual tree in the forest.
- input is a pointer to orig data that have n_cols features and n_rows rows.
Expand All @@ -375,7 +375,7 @@ class RandomForest {
*/

forest->trees[i] = DT::DecisionTree::fit(handle,
s,
s.get(),
input,
n_cols,
n_rows,
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/svm/linear.cu
Original file line number Diff line number Diff line change
@@ -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
*/
#include <common/nvtx.hpp>
Expand Down Expand Up @@ -112,7 +112,7 @@ class WorkerHandle {
: handle_ptr{new raft::handle_t{h.get_next_usable_stream(stream_id)}},
stream_id(stream_id),
handle(*handle_ptr),
stream(h.get_next_usable_stream(stream_id))
stream(h.get_next_usable_stream(stream_id).get())
{
}

Expand Down
10 changes: 5 additions & 5 deletions cpp/src_prims/selection/knn.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -192,7 +192,7 @@ void class_probs(const raft::handle_t& handle,
const float* weights = nullptr)
{
for (std::size_t i = 0; i < y.size(); i++) {
cudaStream_t stream = handle.get_next_usable_stream();
cudaStream_t stream = handle.get_next_usable_stream().get();

int n_unique_labels = n_unique[i];
size_t cur_size = n_query_rows * n_unique_labels;
Expand Down Expand Up @@ -274,7 +274,7 @@ void knn_classify(const raft::handle_t& handle,
for (std::size_t i = 0; i < n_unique.size(); i++) {
int size = n_unique[i];

cudaStream_t stream = handle.get_next_usable_stream(i);
cudaStream_t stream = handle.get_next_usable_stream(i).get();

tmp_probs.emplace_back(n_query_rows * size, stream);
probs.push_back(tmp_probs.back().data());
Expand All @@ -293,7 +293,7 @@ void knn_classify(const raft::handle_t& handle,
dim3 blk(TPB_X, 1, 1);

for (std::size_t i = 0; i < y.size(); i++) {
cudaStream_t stream = handle.get_next_usable_stream(i);
cudaStream_t stream = handle.get_next_usable_stream(i).get();

int n_unique_labels = n_unique[i];

Expand Down Expand Up @@ -347,7 +347,7 @@ void knn_regress(const raft::handle_t& handle,
* Vote average regression value
*/
for (std::size_t i = 0; i < y.size(); i++) {
cudaStream_t stream = handle.get_next_usable_stream();
cudaStream_t stream = handle.get_next_usable_stream().get();

regress_avg_kernel<ValType, precomp_lbls>
<<<raft::ceildiv(n_query_rows, static_cast<std::size_t>(TPB_X)), TPB_X, 0, stream>>>(
Expand Down
45 changes: 24 additions & 21 deletions cpp/tests/sg/rf_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,14 @@ std::shared_ptr<thrust::device_vector<LabelT>> nvForestPredict(
TreeliteModelHandle model;
build_treelite_forest(&model, forest, params.n_cols);

auto nvforest_model = nvforest::import_from_treelite_handle(model,
nvforest::tree_layout::breadth_first,
128,
std::is_same_v<DataT, double>,
nvforest::device_type::gpu,
handle.get_device(),
handle.get_next_usable_stream());
auto nvforest_model =
nvforest::import_from_treelite_handle(model,
nvforest::tree_layout::breadth_first,
128,
std::is_same_v<DataT, double>,
nvforest::device_type::gpu,
handle.get_device(),
handle.get_next_usable_stream().get());
handle.sync_stream();
handle.sync_stream_pool();
delete static_cast<treelite::Model*>(model);
Expand Down Expand Up @@ -325,13 +326,14 @@ auto nvForestPredictProba(const raft::handle_t& handle,
TreeliteModelHandle model;
build_treelite_forest(&model, forest, params.n_cols);

auto nvforest_model = nvforest::import_from_treelite_handle(model,
nvforest::tree_layout::breadth_first,
128,
std::is_same_v<DataT, double>,
nvforest::device_type::gpu,
handle.get_device(),
handle.get_next_usable_stream());
auto nvforest_model =
nvforest::import_from_treelite_handle(model,
nvforest::tree_layout::breadth_first,
128,
std::is_same_v<DataT, double>,
nvforest::device_type::gpu,
handle.get_device(),
handle.get_next_usable_stream().get());
handle.sync_stream();
handle.sync_stream_pool();
delete static_cast<treelite::Model*>(model);
Expand Down Expand Up @@ -929,13 +931,14 @@ TEST(RfTests, IntegerOverflow)
TreeliteModelHandle model;
build_treelite_forest(&model, forest_ptr, n);

auto nvforest_model = nvforest::import_from_treelite_handle(model,
nvforest::tree_layout::breadth_first,
128,
false,
nvforest::device_type::gpu,
handle.get_device(),
handle.get_next_usable_stream());
auto nvforest_model =
nvforest::import_from_treelite_handle(model,
nvforest::tree_layout::breadth_first,
128,
false,
nvforest::device_type::gpu,
handle.get_device(),
handle.get_next_usable_stream().get());
handle.sync_stream();
handle.sync_stream_pool();
delete static_cast<treelite::Model*>(model);
Expand Down
Loading