Skip to content
Open
2 changes: 1 addition & 1 deletion cpp/docs/DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Similar to a `rmm::device_vector`, allocates a contiguous set of elements in dev
key differences:
- As an optimization, elements are uninitialized and no synchronization occurs at construction.
This limits the types `T` to trivially copyable types.
- All operations are stream ordered (i.e., they accept a `cuda_stream_view` specifying the stream
- All operations are stream ordered (i.e., they accept a `cuda::stream_ref` specifying the stream
on which the operation is performed).

## Namespaces
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand All @@ -18,6 +18,7 @@
#include <raft/core/handle.hpp>
#include <raft/random/rng_state.hpp>

#include <cuda/stream>
#include <thrust/for_each.h>

#include <iostream>
Expand All @@ -44,7 +45,7 @@ std::unique_ptr<raft::handle_t> initialize_mg_handle()
rmm::mr::set_current_device_resource(resource);

std::unique_ptr<raft::handle_t> handle =
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, nullptr, resource);
std::make_unique<raft::handle_t>(cuda::stream_ref{cudaStreamPerThread}, nullptr, resource);

raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD);
auto& comm = handle->get_comms();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand All @@ -15,6 +15,7 @@
#include <raft/random/rng_state.hpp>

#include <cuda/std/tuple>
#include <cuda/stream>
#include <thrust/for_each.h>

#include <iostream>
Expand All @@ -41,7 +42,7 @@ std::unique_ptr<raft::handle_t> initialize_mg_handle()
rmm::mr::set_current_device_resource(resource);

std::unique_ptr<raft::handle_t> handle =
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, nullptr, resource);
std::make_unique<raft::handle_t>(cuda::stream_ref{cudaStreamPerThread}, nullptr, resource);

raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD);
auto& comm = handle->get_comms();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand All @@ -12,6 +12,8 @@
#include <raft/core/handle.hpp>
#include <raft/random/rng_state.hpp>

#include <cuda/stream>

#include <iostream>
#include <string>

Expand All @@ -36,7 +38,7 @@ std::unique_ptr<raft::handle_t> initialize_mg_handle()
rmm::mr::set_current_device_resource(resource);

std::unique_ptr<raft::handle_t> handle =
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, nullptr, resource);
std::make_unique<raft::handle_t>(cuda::stream_ref{cudaStreamPerThread}, nullptr, resource);

raft::comms::initialize_mpi_comms(handle.get(), MPI_COMM_WORLD);
auto& comm = handle->get_comms();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand All @@ -9,6 +9,8 @@
#include <raft/core/handle.hpp>
#include <raft/random/rng_state.hpp>

#include <cuda/stream>

#include <iostream>
#include <string>

Expand All @@ -19,7 +21,7 @@ std::unique_ptr<raft::handle_t> initialize_sg_handle()
rmm::mr::set_current_device_resource(resource);

std::unique_ptr<raft::handle_t> handle =
std::make_unique<raft::handle_t>(rmm::cuda_stream_per_thread, nullptr, resource);
std::make_unique<raft::handle_t>(cuda::stream_ref{cudaStreamPerThread}, nullptr, resource);
return std::move(handle);
}

Expand Down
6 changes: 4 additions & 2 deletions cpp/include/cugraph/dendrogram.hpp
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
*/
#pragma once
Expand All @@ -9,6 +9,8 @@
#include <rmm/device_uvector.hpp>
#include <rmm/resource_ref.hpp>

#include <cuda/stream>

#include <memory>
#include <vector>

Expand All @@ -19,7 +21,7 @@ class Dendrogram {
public:
void add_level(vertex_t first_index,
vertex_t num_verts,
rmm::cuda_stream_view stream_view,
cuda::stream_ref stream_view,
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource_ref())
{
level_ptr_.push_back(
Expand Down
6 changes: 3 additions & 3 deletions cpp/include/cugraph/detail/decompress_edge_partition.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
Expand Down Expand Up @@ -119,7 +119,7 @@ void decompress_edge_partition_to_fill_edgelist_majors(
detail::decompress_to_edgelist_high_degree<<<update_grid.num_blocks,
update_grid.block_size,
0,
handle.get_stream()>>>(
handle.get_stream().get()>>>(
edge_partition,
edge_partition.major_range_first(),
edge_partition.major_range_first() + (*segment_offsets)[1],
Expand All @@ -133,7 +133,7 @@ void decompress_edge_partition_to_fill_edgelist_majors(
detail::decompress_to_edgelist_mid_degree<<<update_grid.num_blocks,
update_grid.block_size,
0,
handle.get_stream()>>>(
handle.get_stream().get()>>>(
edge_partition,
edge_partition.major_range_first() + (*segment_offsets)[1],
edge_partition.major_range_first() + (*segment_offsets)[2],
Expand Down
14 changes: 8 additions & 6 deletions cpp/include/cugraph/detail/utility_wrappers.hpp
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
*/
#pragma once
Expand All @@ -12,6 +12,8 @@

#include <rmm/device_uvector.hpp>

#include <cuda/stream>

namespace CUGRAPH_EXPORT cugraph {
namespace detail {

Expand All @@ -37,7 +39,7 @@ namespace detail {
*
*/
template <typename value_t>
void uniform_random_fill(rmm::cuda_stream_view const& stream_view,
void uniform_random_fill(cuda::stream_ref const& stream_view,
value_t* d_value,
size_t size,
value_t min_value,
Expand All @@ -58,7 +60,7 @@ void uniform_random_fill(rmm::cuda_stream_view const& stream_view,
template <typename value_t>
void transform_increment_ints(raft::device_span<value_t> values,
value_t value,
rmm::cuda_stream_view const& stream_view);
cuda::stream_ref const& stream_view);

/**
* @ingroup utility_wrappers_cpp
Expand All @@ -76,7 +78,7 @@ template <typename value_t>
void transform_not_equal(raft::device_span<value_t> values,
raft::device_span<bool> result,
value_t compare,
rmm::cuda_stream_view const& stream_view);
cuda::stream_ref const& stream_view);

/**
* @ingroup utility_wrappers_cpp
Expand All @@ -94,7 +96,7 @@ void transform_not_equal(raft::device_span<value_t> values,
* @param the maximum value occurring in the edge list
*/
template <typename vertex_t>
vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view,
vertex_t compute_maximum_vertex_id(cuda::stream_ref const& stream_view,
vertex_t const* d_edgelist_srcs,
vertex_t const* d_edgelist_dsts,
size_t num_edges);
Expand All @@ -114,7 +116,7 @@ vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view,
* @param the maximum value occurring in the edge list
*/
template <typename vertex_t>
vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view,
vertex_t compute_maximum_vertex_id(cuda::stream_ref const& stream_view,
rmm::device_uvector<vertex_t> const& d_edgelist_srcs,
rmm::device_uvector<vertex_t> const& d_edgelist_dsts)
{
Expand Down
7 changes: 3 additions & 4 deletions cpp/include/cugraph/dynamic/memory_manager/block_array.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
Expand All @@ -8,9 +8,8 @@
#include <cugraph/utilities/dataframe_buffer.hpp>
#include <cugraph/utilities/thrust_tuple_utils.hpp>

#include <rmm/cuda_stream_view.hpp>

#include <cuda/std/tuple>
#include <cuda/stream>

#include <cstddef>
#include <type_traits>
Expand All @@ -31,7 +30,7 @@ class block_array_t {

using buffer_type = dataframe_buffer_type_t<T>;

block_array_t(size_t elements_per_block, size_t num_blocks, rmm::cuda_stream_view stream)
block_array_t(size_t elements_per_block, size_t num_blocks, cuda::stream_ref stream)
: bit_tree_(elements_per_block, num_blocks),
block_storage_(allocate_dataframe_buffer<T>(num_blocks * elements_per_block, stream))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once

#include <cugraph/dynamic/memory_manager/block_array.hpp>

#include <rmm/cuda_stream_view.hpp>
#include <cuda/stream>

#include <algorithm>
#include <array>
Expand Down Expand Up @@ -55,7 +55,7 @@ class block_array_manager_t {
block_array_manager_t(block_array_manager_t&&) = default;
block_array_manager_t& operator=(block_array_manager_t&&) = default;

block_access_data_t insert(size_t num_elements_per_block, rmm::cuda_stream_view stream)
block_access_data_t insert(size_t num_elements_per_block, cuda::stream_ref stream)
{
CUGRAPH_EXPECTS(
num_elements_per_block <= max_elements_per_block_array_,
Expand Down
Loading
Loading