From 60d710661f71eacaf0d18cbe6b1cb841c056294a Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Fri, 28 Aug 2026 13:08:49 -0500 Subject: [PATCH 01/10] Use cuda::stream_ref for pooled streams --- cpp/include/cugraph/mtmg/handle.hpp | 8 +++-- .../extract_transform_if_v_frontier_e.cuh | 23 ++++++++------- .../prims/detail/per_v_transform_reduce_e.cuh | 29 ++++++++++--------- .../prims/fill_edge_src_dst_property.cuh | 3 +- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/cpp/include/cugraph/mtmg/handle.hpp b/cpp/include/cugraph/mtmg/handle.hpp index cb6faf0d159..09334cefc90 100644 --- a/cpp/include/cugraph/mtmg/handle.hpp +++ b/cpp/include/cugraph/mtmg/handle.hpp @@ -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 */ @@ -11,6 +11,8 @@ #include +#include + namespace CUGRAPH_EXPORT cugraph { namespace mtmg { @@ -51,11 +53,11 @@ class handle_t { * * @return cuda stream */ - rmm::cuda_stream_view get_stream() const + cuda::stream_ref get_stream() const { return raft_handle_.is_stream_pool_initialized() ? raft_handle_.get_stream_from_stream_pool(thread_rank_) - : raft_handle_.get_stream(); + : static_cast(raft_handle_.get_stream()); } /** diff --git a/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh b/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh index dcd6ccb62e0..79ec2d1f1ad 100644 --- a/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh +++ b/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -557,7 +558,7 @@ void extract_transform_if_v_frontier_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[0 % stream_pool_size]) - : handle.get_stream(); + : static_cast(handle.get_stream()); raft::grid_1d_thread_t update_grid((*high_segment_edge_count), extract_transform_if_v_frontier_e_kernel_block_size, @@ -582,7 +583,7 @@ void extract_transform_if_v_frontier_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[1 % stream_pool_size]) - : handle.get_stream(); + : static_cast(handle.get_stream()); raft::grid_1d_warp_t update_grid((*key_segment_offsets)[2] - (*key_segment_offsets)[1], extract_transform_if_v_frontier_e_kernel_block_size, handle.get_device_properties().maxGridSize[0]); @@ -605,7 +606,7 @@ void extract_transform_if_v_frontier_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[2 % stream_pool_size]) - : handle.get_stream(); + : static_cast(handle.get_stream()); raft::grid_1d_thread_t update_grid((*key_segment_offsets)[3] - (*key_segment_offsets)[2], extract_transform_if_v_frontier_e_kernel_block_size, handle.get_device_properties().maxGridSize[0]); @@ -629,7 +630,7 @@ void extract_transform_if_v_frontier_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[3 % stream_pool_size]) - : handle.get_stream(); + : static_cast(handle.get_stream()); raft::grid_1d_thread_t update_grid((*key_segment_offsets)[4] - (*key_segment_offsets)[3], extract_transform_if_v_frontier_e_kernel_block_size, handle.get_device_properties().maxGridSize[0]); @@ -652,7 +653,7 @@ void extract_transform_if_v_frontier_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[0 % stream_pool_size]) - : handle.get_stream(); + : static_cast(handle.get_stream()); auto frontier_size = static_cast( cuda::std::distance(edge_partition_frontier_key_first, edge_partition_frontier_key_last)); @@ -1324,7 +1325,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); std::variant, rmm::device_uvector> keys = rmm::device_uvector(0, loop_stream); @@ -1428,7 +1429,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, auto partition_idx = i + j; auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); if ((static_cast(partition_idx) != minor_comm_rank) && nonzero_key_lists[j]) { auto edge_partition = @@ -1524,7 +1525,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, for (size_t j = 0; j < loop_count; ++j) { auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); output_key_buffers.push_back(allocate_optional_dataframe_buffer( edge_partition_max_push_counts[j], loop_stream)); @@ -1547,7 +1548,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, auto partition_idx = i + j; auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); auto edge_partition = edge_partition_device_view_t( @@ -1766,7 +1767,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, for (size_t j = 0; j < loop_count; ++j) { auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); auto tmp_buffer_size = h_counts[j]; if (tmp_buffer_size > 0) { @@ -1820,7 +1821,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, for (size_t i = 0; i < key_buffers.size(); ++i) { auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[i]) - : handle.get_stream(); + : static_cast(handle.get_stream()); if constexpr (!std::is_same_v) { thrust::copy( rmm::exec_policy_nosync(loop_stream), diff --git a/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh b/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh index 6f3e49c4af7..2ee142a33ed 100644 --- a/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh +++ b/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -1003,7 +1004,7 @@ void per_v_transform_reduce_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[0 % stream_pool_size]) - : handle.get_stream(); + : static_cast(handle.get_stream()); if constexpr (update_major && !use_input_key) { // this is necessary as we don't visit // every vertex in the hypersparse segment @@ -1052,7 +1053,7 @@ void per_v_transform_reduce_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[1 % stream_pool_size]) - : handle.get_stream(); + : static_cast(handle.get_stream()); raft::grid_1d_thread_t update_grid((*key_segment_offsets)[3] - (*key_segment_offsets)[2], detail::per_v_transform_reduce_e_kernel_block_size, handle.get_device_properties().maxGridSize[0]); @@ -1086,7 +1087,7 @@ void per_v_transform_reduce_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[2 % stream_pool_size]) - : handle.get_stream(); + : static_cast(handle.get_stream()); raft::grid_1d_warp_t update_grid((*key_segment_offsets)[2] - (*key_segment_offsets)[1], detail::per_v_transform_reduce_e_kernel_block_size, handle.get_device_properties().maxGridSize[0]); @@ -1121,7 +1122,7 @@ void per_v_transform_reduce_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[3 % stream_pool_size]) - : handle.get_stream(); + : static_cast(handle.get_stream()); raft::grid_1d_block_t update_grid( (*key_segment_offsets)[1], std::is_same_v> @@ -1156,7 +1157,7 @@ void per_v_transform_reduce_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[0 % stream_pool_size]) - : handle.get_stream(); + : static_cast(handle.get_stream()); size_t num_keys{}; if constexpr (use_input_key) { @@ -2032,7 +2033,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); std::variant, rmm::device_uvector> keys = rmm::device_uvector(0, loop_stream); @@ -2131,7 +2132,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); auto const& key_segment_offsets = (*key_segment_offset_vectors)[partition_idx]; @@ -2209,7 +2210,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); rmm::device_uvector input_count_offsets(0, loop_stream); if (nonzero_key_lists[j] && process_local_edges[j]) { @@ -2272,7 +2273,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); rmm::device_uvector filtered_bitmap(0, loop_stream); rmm::device_uvector output_count_offsets(0, loop_stream); @@ -2367,7 +2368,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); auto const& key_segment_offsets = (*key_segment_offset_vectors)[partition_idx]; @@ -2612,7 +2613,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); auto const& key_segment_offsets = (*key_segment_offset_vectors)[partition_idx]; @@ -2799,7 +2800,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); if (nonzero_key_lists[j] && process_local_edges[j]) { auto const& key_segment_offsets = (*key_segment_offset_vectors)[partition_idx]; @@ -2844,7 +2845,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto partition_idx = i + j; auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); size_t buffer_size{0}; if (process_local_edges[j]) { @@ -3106,7 +3107,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, for (size_t j = 0; j < loop_count; ++j) { auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : handle.get_stream(); + : static_cast(handle.get_stream()); auto const& output_buffer = edge_partition_major_output_buffers[j]; if (nonzero_key_lists[j] && process_local_edges[j]) { diff --git a/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh b/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh index fd4e69b89e1..33441b35c78 100644 --- a/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh +++ b/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -950,7 +951,7 @@ void fill_edge_minor_property(raft::handle_t const& handle, auto loop_stream = stream_pool_indices ? handle.get_stream_from_stream_pool((*stream_pool_indices)[i % stream_pool_size]) - : handle.get_stream(); + : static_cast(handle.get_stream()); std::optional> rx_vertices{std::nullopt}; if (v_list_bitmap_size) { From c30d965982e65dda95d43d61b6b74455f403b4c4 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 1 Sep 2026 05:54:38 -0500 Subject: [PATCH 02/10] Migrate stream view APIs to cuda::stream_ref --- cpp/include/cugraph/dendrogram.hpp | 2 +- .../cugraph/detail/utility_wrappers.hpp | 10 +- .../dynamic/memory_manager/block_array.hpp | 2 +- .../memory_manager/block_array_manager.hpp | 2 +- .../cugraph/edge_partition_device_view.cuh | 110 +++++++++--------- cpp/include/cugraph/edge_src_dst_property.hpp | 2 +- .../cugraph/host_staging_buffer_manager.hpp | 2 +- cpp/include/cugraph/large_buffer_manager.hpp | 5 +- .../mtmg/detail/per_device_edgelist.hpp | 12 +- cpp/include/cugraph/mtmg/handle.hpp | 4 +- .../cugraph/mtmg/per_thread_edgelist.hpp | 6 +- .../prims/detail/multi_stream_utils.cuh | 6 +- .../detail/optional_dataframe_buffer.hpp | 10 +- .../prims/detail/per_v_transform_reduce_e.cuh | 2 +- cpp/include/cugraph/prims/key_store.cuh | 42 +++---- cpp/include/cugraph/prims/kv_store.cuh | 78 ++++++------- ...air_transform_src_dst_nbr_intersection.cuh | 2 +- cpp/include/cugraph/prims/vertex_frontier.cuh | 10 +- .../cugraph/utilities/collect_comm.cuh | 6 +- .../cugraph/utilities/dataframe_buffer.hpp | 16 +-- cpp/include/cugraph/utilities/device_comm.hpp | 108 ++++++++--------- .../cugraph/utilities/groupby_and_count.cuh | 20 ++-- cpp/include/cugraph/utilities/mask_utils.cuh | 14 +-- .../utilities/mem_frugal_partition.cuh | 4 +- cpp/include/cugraph/utilities/misc_utils.cuh | 2 +- .../partition_scatter_map_wrappers.cuh | 4 +- .../cugraph/utilities/permute_wrappers.cuh | 16 +-- .../cugraph/utilities/shuffle_comm.cuh | 14 +-- .../include/hash/concurrent_unordered_map.cuh | 12 +- cpp/src/c_api/array.hpp | 2 +- cpp/src/c_api/graph_helper.hpp | 4 +- cpp/src/c_api/graph_helper_impl.cuh | 4 +- cpp/src/c_api/graph_helper_sg.cu | 34 ++---- cpp/src/converters/legacy/COOtoCSR.cuh | 13 +-- cpp/src/detail/utility_wrappers_32_common.cu | 10 +- cpp/src/detail/utility_wrappers_64_common.cu | 10 +- cpp/src/detail/utility_wrappers_impl.cuh | 8 +- cpp/src/layout/legacy/barnes_hut.cuh | 2 +- cpp/src/structure/coarsen_graph_impl.cuh | 2 +- .../edge_partition_device_view_impl.cuh | 18 +-- ...device_view_mask_degrees_common_v32_e32.cu | 8 +- ...device_view_mask_degrees_common_v64_e64.cu | 8 +- .../edge_partition_device_view_mg_v32_e32.cu | 10 +- .../edge_partition_device_view_mg_v64_e64.cu | 10 +- .../edge_partition_device_view_sg_v32_e32.cu | 8 +- .../edge_partition_device_view_sg_v64_e64.cu | 8 +- cpp/src/structure/legacy/graph.cu | 8 +- .../partition_scatter_map_wrappers.cu | 4 +- cpp/src/utilities/permute_wrappers.cu | 13 +-- ...rm_reduce_dst_key_aggregated_outgoing_e.cu | 2 +- ..._v_transform_reduce_incoming_outgoing_e.cu | 4 +- cpp/tests/utilities/mg_utilities.cpp | 2 +- cpp/tests/utilities/mg_utilities.hpp | 2 +- .../property_generator_utilities.hpp | 4 +- 54 files changed, 352 insertions(+), 369 deletions(-) diff --git a/cpp/include/cugraph/dendrogram.hpp b/cpp/include/cugraph/dendrogram.hpp index 0b4a6613f4a..364e3755007 100644 --- a/cpp/include/cugraph/dendrogram.hpp +++ b/cpp/include/cugraph/dendrogram.hpp @@ -19,7 +19,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( diff --git a/cpp/include/cugraph/detail/utility_wrappers.hpp b/cpp/include/cugraph/detail/utility_wrappers.hpp index e8f7be6e3b3..062974dd42b 100644 --- a/cpp/include/cugraph/detail/utility_wrappers.hpp +++ b/cpp/include/cugraph/detail/utility_wrappers.hpp @@ -37,7 +37,7 @@ namespace detail { * */ template -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, @@ -58,7 +58,7 @@ void uniform_random_fill(rmm::cuda_stream_view const& stream_view, template void transform_increment_ints(raft::device_span values, value_t value, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); /** * @ingroup utility_wrappers_cpp @@ -76,7 +76,7 @@ template void transform_not_equal(raft::device_span values, raft::device_span result, value_t compare, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); /** * @ingroup utility_wrappers_cpp @@ -94,7 +94,7 @@ void transform_not_equal(raft::device_span values, * @param the maximum value occurring in the edge list */ template -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); @@ -114,7 +114,7 @@ vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view, * @param the maximum value occurring in the edge list */ template -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 const& d_edgelist_srcs, rmm::device_uvector const& d_edgelist_dsts) { diff --git a/cpp/include/cugraph/dynamic/memory_manager/block_array.hpp b/cpp/include/cugraph/dynamic/memory_manager/block_array.hpp index 8e5fbf13457..c2172340beb 100644 --- a/cpp/include/cugraph/dynamic/memory_manager/block_array.hpp +++ b/cpp/include/cugraph/dynamic/memory_manager/block_array.hpp @@ -31,7 +31,7 @@ class block_array_t { using buffer_type = dataframe_buffer_type_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(num_blocks * elements_per_block, stream)) { diff --git a/cpp/include/cugraph/dynamic/memory_manager/block_array_manager.hpp b/cpp/include/cugraph/dynamic/memory_manager/block_array_manager.hpp index a3c7ce2ba63..015beaaf24c 100644 --- a/cpp/include/cugraph/dynamic/memory_manager/block_array_manager.hpp +++ b/cpp/include/cugraph/dynamic/memory_manager/block_array_manager.hpp @@ -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_, diff --git a/cpp/include/cugraph/edge_partition_device_view.cuh b/cpp/include/cugraph/edge_partition_device_view.cuh index b990aaa12df..878e1dfcbf6 100644 --- a/cpp/include/cugraph/edge_partition_device_view.cuh +++ b/cpp/include/cugraph/edge_partition_device_view.cuh @@ -169,7 +169,7 @@ __host__ void compute_number_of_edges_with_mask_async_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { if (cuda::std::distance(major_first, major_last) == 0) { RAFT_CUDA_TRY(cudaMemsetAsync(count.data(), 0, sizeof(size_t), stream.get())); @@ -228,7 +228,7 @@ __host__ void compute_number_of_edges_with_mask_async_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template __host__ void compute_number_of_edges_with_mask_async_mg( @@ -239,7 +239,7 @@ __host__ void compute_number_of_edges_with_mask_async_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template __host__ void compute_number_of_edges_with_mask_async_mg( @@ -250,7 +250,7 @@ __host__ void compute_number_of_edges_with_mask_async_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( @@ -261,7 +261,7 @@ __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { rmm::device_uvector local_degrees(cuda::std::distance(major_first, major_last), stream); if (dcs_nzd_vertices) { @@ -293,7 +293,7 @@ __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( @@ -303,7 +303,7 @@ __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template __host__ void compute_number_of_edges_with_mask_async_sg( @@ -312,7 +312,7 @@ __host__ void compute_number_of_edges_with_mask_async_sg( MajorIterator major_last, raft::device_span count, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { if (cuda::std::distance(major_first, major_last) == 0) { RAFT_CUDA_TRY(cudaMemsetAsync(count.data(), 0, sizeof(size_t), stream.get())); @@ -350,7 +350,7 @@ __host__ void compute_number_of_edges_with_mask_async_sg( raft::device_span majors, raft::device_span count, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template __host__ void compute_number_of_edges_with_mask_async_sg( @@ -358,7 +358,7 @@ __host__ void compute_number_of_edges_with_mask_async_sg( std::tuple vertex_partition_range, raft::device_span count, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template __host__ rmm::device_uvector compute_local_degrees_with_mask_sg( @@ -366,7 +366,7 @@ __host__ rmm::device_uvector compute_local_degrees_with_mask_sg( MajorIterator major_first, MajorIterator major_last, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { rmm::device_uvector local_degrees(cuda::std::distance(major_first, major_last), stream); thrust::transform( @@ -387,14 +387,14 @@ __host__ rmm::device_uvector compute_local_degrees_with_mask_sg( cuda::std::optional edge_mask, raft::device_span majors, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template __host__ rmm::device_uvector compute_local_degrees_with_mask_sg( cuda::std::optional edge_mask, std::tuple vertex_partition_range, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace detail @@ -423,7 +423,7 @@ class edge_partition_device_view_t edge_mask, raft::device_span majors, raft::device_span count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_mg( cuda::std::optional{edge_mask.data()}, @@ -440,7 +440,7 @@ class edge_partition_device_view_t edge_mask, std::tuple vertex_partition_range, raft::device_span count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_mg( cuda::std::optional{edge_mask.data()}, @@ -458,7 +458,7 @@ class edge_partition_device_view_t count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_mg( cuda::std::optional{edge_mask.data()}, @@ -478,7 +478,7 @@ class edge_partition_device_view_t edge_mask, majors_from_offsets_t majors, raft::device_span count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_mg( cuda::std::optional{edge_mask.data()}, @@ -493,7 +493,7 @@ class edge_partition_device_view_t majors, raft::device_span count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_mg(cuda::std::nullopt, majors, @@ -508,7 +508,7 @@ class edge_partition_device_view_t __host__ void compute_number_of_edges_async(raft::device_span majors, raft::device_span count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_mg(cuda::std::nullopt, majors, @@ -522,7 +522,7 @@ class edge_partition_device_view_t vertex_partition_range, raft::device_span count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_mg(cuda::std::nullopt, vertex_partition_range, @@ -539,7 +539,7 @@ class edge_partition_device_view_t count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_mg(cuda::std::nullopt, major_first, @@ -555,7 +555,7 @@ class edge_partition_device_view_t __host__ size_t compute_number_of_edges_with_mask(raft::device_span edge_mask, raft::device_span majors, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -574,7 +574,7 @@ class edge_partition_device_view_t edge_mask, std::tuple vertex_partition_range, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -593,7 +593,7 @@ class edge_partition_device_view_t edge_mask, majors_from_offsets_t majors, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -614,7 +614,7 @@ class edge_partition_device_view_t edge_mask, MajorIterator major_first, MajorIterator major_last, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -633,7 +633,7 @@ class edge_partition_device_view_t __host__ size_t compute_number_of_edges(raft::device_span majors, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -642,7 +642,7 @@ class edge_partition_device_view_t vertex_partition_range, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -652,7 +652,7 @@ class edge_partition_device_view_t majors, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -671,7 +671,7 @@ class edge_partition_device_view_t, int> = 0> __host__ size_t compute_number_of_edges(MajorIterator major_first, MajorIterator major_last, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -681,7 +681,7 @@ class edge_partition_device_view_t compute_local_degrees_with_mask( - raft::device_span edge_mask, rmm::cuda_stream_view stream) const + raft::device_span edge_mask, cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_mg( cuda::std::optional{edge_mask.data()}, @@ -697,7 +697,7 @@ class edge_partition_device_view_t compute_local_degrees_with_mask( raft::device_span edge_mask, raft::device_span majors, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_mg( cuda::std::optional{edge_mask.data()}, @@ -712,7 +712,7 @@ class edge_partition_device_view_t compute_local_degrees_with_mask( raft::device_span edge_mask, std::tuple vertex_partition_range, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_mg( cuda::std::optional{edge_mask.data()}, @@ -730,7 +730,7 @@ class edge_partition_device_view_t edge_mask, MajorIterator major_first, MajorIterator major_last, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_mg( cuda::std::optional{edge_mask.data()}, @@ -745,7 +745,7 @@ class edge_partition_device_view_t __host__ rmm::device_uvector compute_local_degrees(raft::device_span majors, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_mg(cuda::std::nullopt, majors, @@ -757,7 +757,7 @@ class edge_partition_device_view_t compute_local_degrees( - std::tuple vertex_partition_range, rmm::cuda_stream_view stream) const + std::tuple vertex_partition_range, cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_mg(cuda::std::nullopt, vertex_partition_range, @@ -772,7 +772,7 @@ class edge_partition_device_view_t, int> = 0> __host__ rmm::device_uvector compute_local_degrees(MajorIterator major_first, MajorIterator major_last, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_mg(cuda::std::nullopt, major_first, @@ -930,7 +930,7 @@ class edge_partition_device_view_t edge_mask, raft::device_span majors, raft::device_span count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_sg( cuda::std::optional{edge_mask.data()}, @@ -944,7 +944,7 @@ class edge_partition_device_view_t edge_mask, std::tuple vertex_partition_range, raft::device_span count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_sg( cuda::std::optional{edge_mask.data()}, @@ -960,7 +960,7 @@ class edge_partition_device_view_t count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_sg( cuda::std::optional{edge_mask.data()}, @@ -974,7 +974,7 @@ class edge_partition_device_view_t __host__ void compute_number_of_edges_async(raft::device_span majors, raft::device_span count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_sg( cuda::std::nullopt, majors, count, this->offsets_, stream); @@ -982,7 +982,7 @@ class edge_partition_device_view_t vertex_partition_range, raft::device_span count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_sg( cuda::std::nullopt, vertex_partition_range, count, this->offsets_, stream); @@ -993,7 +993,7 @@ class edge_partition_device_view_t count, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { detail::compute_number_of_edges_with_mask_async_sg( cuda::std::nullopt, major_first, major_last, count, this->offsets_, stream); @@ -1002,7 +1002,7 @@ class edge_partition_device_view_t __host__ size_t compute_number_of_edges_with_mask(raft::device_span edge_mask, raft::device_span majors, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -1014,7 +1014,7 @@ class edge_partition_device_view_t edge_mask, std::tuple vertex_partition_range, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -1028,7 +1028,7 @@ class edge_partition_device_view_t edge_mask, MajorIterator major_first, MajorIterator major_last, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -1039,7 +1039,7 @@ class edge_partition_device_view_t __host__ size_t compute_number_of_edges(raft::device_span majors, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -1048,7 +1048,7 @@ class edge_partition_device_view_t vertex_partition_range, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -1061,7 +1061,7 @@ class edge_partition_device_view_t, int> = 0> __host__ size_t compute_number_of_edges(MajorIterator major_first, MajorIterator major_last, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { rmm::device_scalar count(stream); count.set_value_to_zero_async(stream); @@ -1071,7 +1071,7 @@ class edge_partition_device_view_t compute_local_degrees_with_mask( - raft::device_span edge_mask, rmm::cuda_stream_view stream) const + raft::device_span edge_mask, cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_sg( cuda::std::optional{edge_mask.data()}, @@ -1084,7 +1084,7 @@ class edge_partition_device_view_t compute_local_degrees_with_mask( raft::device_span edge_mask, raft::device_span majors, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_sg( cuda::std::optional{edge_mask.data()}, majors, this->offsets_, stream); @@ -1093,7 +1093,7 @@ class edge_partition_device_view_t compute_local_degrees_with_mask( raft::device_span edge_mask, std::tuple vertex_partition_range, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_sg( cuda::std::optional{edge_mask.data()}, @@ -1108,7 +1108,7 @@ class edge_partition_device_view_t edge_mask, MajorIterator major_first, MajorIterator major_last, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_sg( cuda::std::optional{edge_mask.data()}, @@ -1120,14 +1120,14 @@ class edge_partition_device_view_t __host__ rmm::device_uvector compute_local_degrees(raft::device_span majors, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_sg( cuda::std::nullopt, majors, this->offsets_, stream); } __host__ rmm::device_uvector compute_local_degrees( - std::tuple vertex_partition_range, rmm::cuda_stream_view stream) const + std::tuple vertex_partition_range, cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_sg( cuda::std::nullopt, vertex_partition_range, this->offsets_, stream); @@ -1137,7 +1137,7 @@ class edge_partition_device_view_t, int> = 0> __host__ rmm::device_uvector compute_local_degrees(MajorIterator major_first, MajorIterator major_last, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { return detail::compute_local_degrees_with_mask_sg( cuda::std::nullopt, major_first, major_last, this->offsets_, stream); diff --git a/cpp/include/cugraph/edge_src_dst_property.hpp b/cpp/include/cugraph/edge_src_dst_property.hpp index 55ff599a523..cb9884a6881 100644 --- a/cpp/include/cugraph/edge_src_dst_property.hpp +++ b/cpp/include/cugraph/edge_src_dst_property.hpp @@ -418,7 +418,7 @@ class edge_minor_property_t { key_chunk_start_offsets_.reset(); key_chunk_size_.reset(); - rmm::cuda_stream_view stream{}; + cuda::stream_ref stream{}; if constexpr (std::is_arithmetic_v) { stream = buffer_.stream(); } else { diff --git a/cpp/include/cugraph/host_staging_buffer_manager.hpp b/cpp/include/cugraph/host_staging_buffer_manager.hpp index f906a6bd43f..f13e534221e 100644 --- a/cpp/include/cugraph/host_staging_buffer_manager.hpp +++ b/cpp/include/cugraph/host_staging_buffer_manager.hpp @@ -47,7 +47,7 @@ class host_staging_buffer_manager { } template - static rmm::device_uvector allocate_staging_buffer(size_t size, rmm::cuda_stream_view stream) + static rmm::device_uvector allocate_staging_buffer(size_t size, cuda::stream_ref stream) { auto& s = state(); return rmm::device_uvector(size, stream, *s.pinned_pool_mr); diff --git a/cpp/include/cugraph/large_buffer_manager.hpp b/cpp/include/cugraph/large_buffer_manager.hpp index 1d4fcc2ed26..ad564acdaf7 100644 --- a/cpp/include/cugraph/large_buffer_manager.hpp +++ b/cpp/include/cugraph/large_buffer_manager.hpp @@ -52,15 +52,14 @@ enum class large_buffer_type_t { MEMORY, STORAGE, NUM_TYPES }; class large_buffer_manager { public: template - static dataframe_buffer_type_t allocate_memory_buffer(size_t size, - rmm::cuda_stream_view stream) + static dataframe_buffer_type_t allocate_memory_buffer(size_t size, cuda::stream_ref stream) { CUGRAPH_EXPECTS(memory_buffer_initialized(), "large memory buffer resource is not set."); return allocate_dataframe_buffer(size, stream, memory_buffer_resource()->get()); } template - static storage_buffer_t allocate_storage_buffer(size_t, rmm::cuda_stream_view) + static storage_buffer_t allocate_storage_buffer(size_t, cuda::stream_ref) { CUGRAPH_EXPECTS(storage_buffer_initialized(), "large storage buffer resource is not set."); return storage_buffer_t(); diff --git a/cpp/include/cugraph/mtmg/detail/per_device_edgelist.hpp b/cpp/include/cugraph/mtmg/detail/per_device_edgelist.hpp index 32b233157c1..c73ff7e9875 100644 --- a/cpp/include/cugraph/mtmg/detail/per_device_edgelist.hpp +++ b/cpp/include/cugraph/mtmg/detail/per_device_edgelist.hpp @@ -78,7 +78,7 @@ class per_device_edgelist_t { */ per_device_edgelist_t(size_t device_buffer_size, std::vector const& edge_property_types, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) : device_buffer_size_{device_buffer_size}, current_pos_{0}, src_{}, @@ -119,7 +119,7 @@ class per_device_edgelist_t { void append(raft::host_span src, raft::host_span dst, raft::host_span edge_properties, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { CUGRAPH_EXPECTS(edge_properties.size() == edge_property_buffers_.size(), "Edge property count mismatch"); @@ -198,7 +198,7 @@ class per_device_edgelist_t { * * @param stream_view CUDA stream view */ - void finalize_buffer(rmm::cuda_stream_view stream_view) + void finalize_buffer(cuda::stream_ref stream_view) { src_.back().resize(current_pos_, stream_view); dst_.back().resize(current_pos_, stream_view); @@ -295,7 +295,7 @@ class per_device_edgelist_t { std::vector resize_and_copy_buffers( std::vector&& buffer, size_t total_size, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { return cugraph::variant_type_dispatch(buffer[0], [&buffer, total_size, stream](auto& buffer0) { using T = typename std::decay_t::value_type; @@ -319,7 +319,7 @@ class per_device_edgelist_t { template std::vector> resize_and_copy_buffers( - std::vector>&& buffer, size_t total_size, rmm::cuda_stream_view stream) + std::vector>&& buffer, size_t total_size, cuda::stream_ref stream) { rmm::device_uvector new_buffer(total_size, stream); @@ -336,7 +336,7 @@ class per_device_edgelist_t { return result; } - void create_new_buffers(rmm::cuda_stream_view stream_view) + void create_new_buffers(cuda::stream_ref stream_view) { src_.emplace_back(device_buffer_size_, stream_view); dst_.emplace_back(device_buffer_size_, stream_view); diff --git a/cpp/include/cugraph/mtmg/handle.hpp b/cpp/include/cugraph/mtmg/handle.hpp index 09334cefc90..0930359845f 100644 --- a/cpp/include/cugraph/mtmg/handle.hpp +++ b/cpp/include/cugraph/mtmg/handle.hpp @@ -65,7 +65,7 @@ class handle_t { * * @param stream Which stream to synchronize (defaults to the stream for this handle) */ - void sync_stream(rmm::cuda_stream_view stream) const { raft_handle_.sync_stream(stream); } + void sync_stream(cuda::stream_ref stream) const { raft_handle_.sync_stream(stream); } /** * @brief Sync on the cuda stream for this handle @@ -84,7 +84,7 @@ class handle_t { * * @return exec policy using the current stream */ - rmm::exec_policy get_thrust_policy(rmm::cuda_stream_view stream) const + rmm::exec_policy get_thrust_policy(cuda::stream_ref stream) const { return rmm::exec_policy(stream); } diff --git a/cpp/include/cugraph/mtmg/per_thread_edgelist.hpp b/cpp/include/cugraph/mtmg/per_thread_edgelist.hpp index f9316cda80c..24fe57cad76 100644 --- a/cpp/include/cugraph/mtmg/per_thread_edgelist.hpp +++ b/cpp/include/cugraph/mtmg/per_thread_edgelist.hpp @@ -66,7 +66,7 @@ class per_thread_edgelist_t { void append(vertex_t src, vertex_t dst, std::vector edge_properties, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { if (current_pos_ == src_.size()) { flush(stream_view); } @@ -97,7 +97,7 @@ class per_thread_edgelist_t { void append(raft::host_span src, raft::host_span dst, std::vector> edge_properties, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { size_t count = src.size(); size_t pos = 0; @@ -134,7 +134,7 @@ class per_thread_edgelist_t { * @param sync If true, synchronize the asynchronous copy of data; * defaults to false. */ - void flush(rmm::cuda_stream_view stream_view, bool sync = false) + void flush(cuda::stream_ref stream_view, bool sync = false) { std::vector edge_properties_spans; std::for_each(edge_properties_.begin(), diff --git a/cpp/include/cugraph/prims/detail/multi_stream_utils.cuh b/cpp/include/cugraph/prims/detail/multi_stream_utils.cuh index d3c2e41220f..6f4c41e1b8a 100644 --- a/cpp/include/cugraph/prims/detail/multi_stream_utils.cuh +++ b/cpp/include/cugraph/prims/detail/multi_stream_utils.cuh @@ -54,7 +54,7 @@ void copy_if_nosync(InputIterator input_first, FlagIterator flag_first, OutputIterator output_first, raft::device_span count /* size = 1 */, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { CUGRAPH_EXPECTS( static_cast(cuda::std::distance(input_first, input_last)) <= @@ -92,7 +92,7 @@ void count_nosync(InputIterator input_first, InputIterator input_last, raft::device_span count /* size = 1 */, typename thrust::iterator_traits::value_type value, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { CUGRAPH_EXPECTS( static_cast(cuda::std::distance(input_first, input_last)) <= @@ -121,7 +121,7 @@ void sum_nosync( InputIterator input_first, InputIterator input_last, raft::device_span::value_type> sum /* size = 1 */, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { CUGRAPH_EXPECTS( static_cast(cuda::std::distance(input_first, input_last)) <= diff --git a/cpp/include/cugraph/prims/detail/optional_dataframe_buffer.hpp b/cpp/include/cugraph/prims/detail/optional_dataframe_buffer.hpp index 5a5d6a0da24..c6c672f0d0c 100644 --- a/cpp/include/cugraph/prims/detail/optional_dataframe_buffer.hpp +++ b/cpp/include/cugraph/prims/detail/optional_dataframe_buffer.hpp @@ -33,7 +33,7 @@ struct optional_dataframe_buffer_iterator_value_type_t< }; template -auto allocate_optional_dataframe_buffer(size_t size, rmm::cuda_stream_view stream) +auto allocate_optional_dataframe_buffer(size_t size, cuda::stream_ref stream) { if constexpr (std::is_same_v) { return std::byte{0}; // dummy @@ -44,7 +44,7 @@ auto allocate_optional_dataframe_buffer(size_t size, rmm::cuda_stream_view strea template struct optional_dataframe_buffer_type { - using type = decltype(allocate_optional_dataframe_buffer(size_t{0}, rmm::cuda_stream_view{})); + using type = decltype(allocate_optional_dataframe_buffer(size_t{0}, cuda::stream_ref{})); }; template @@ -98,7 +98,7 @@ template void reserve_optional_dataframe_buffer( optional_dataframe_buffer_type_t& optional_dataframe_buffer, size_t new_buffer_capacity, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { if constexpr (std::is_same_v) { return; @@ -111,7 +111,7 @@ template void resize_optional_dataframe_buffer( optional_dataframe_buffer_type_t& optional_dataframe_buffer, size_t new_buffer_size, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { if constexpr (std::is_same_v) { return; @@ -122,7 +122,7 @@ void resize_optional_dataframe_buffer( template void shrink_to_fit_optional_dataframe_buffer( - optional_dataframe_buffer_type_t& optional_dataframe_buffer, rmm::cuda_stream_view stream_view) + optional_dataframe_buffer_type_t& optional_dataframe_buffer, cuda::stream_ref stream_view) { if constexpr (std::is_same_v) { return; diff --git a/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh b/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh index 2ee142a33ed..759d88a5abe 100644 --- a/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh +++ b/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh @@ -896,7 +896,7 @@ void copy_valid_offset_value_pairs( raft::device_span::value_type const>> hypersparse_key_offsets, typename thrust::iterator_traits::value_type invalid_value, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { using offset_t = std::decay_t::value_type>; using value_t = std::decay_t::value_type>; diff --git a/cpp/include/cugraph/prims/key_store.cuh b/cpp/include/cugraph/prims/key_store.cuh index b5124d8d3e6..bc6838fad7e 100644 --- a/cpp/include/cugraph/prims/key_store.cuh +++ b/cpp/include/cugraph/prims/key_store.cuh @@ -116,7 +116,7 @@ class key_binary_search_store_view_t { void contains(QueryKeyIterator key_first, QueryKeyIterator key_last, ResultValueIterator value_first, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { thrust::transform( rmm::exec_policy(stream), @@ -157,7 +157,7 @@ class key_cuco_store_view_t { void contains(QueryKeyIterator key_first, QueryKeyIterator key_last, ResultValueIterator value_first, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { cuco_store_->contains(key_first, key_last, value_first, stream); } @@ -177,7 +177,7 @@ class key_binary_search_store_t { public: using key_type = key_t; - key_binary_search_store_t(rmm::cuda_stream_view stream) : store_keys_(0, stream) {} + key_binary_search_store_t(cuda::stream_ref stream) : store_keys_(0, stream) {} template key_binary_search_store_t( @@ -186,7 +186,7 @@ class key_binary_search_store_t { bool key_sorted /* if set to true, assume that the input data is sorted and skip sorting (which is necessary for binary-search) */ , - rmm::cuda_stream_view stream) + cuda::stream_ref stream) : store_keys_(static_cast(cuda::std::distance(key_first, key_last)), stream) { thrust::copy(rmm::exec_policy(stream), key_first, key_last, store_keys_.begin()); @@ -200,7 +200,7 @@ class key_binary_search_store_t { bool key_sorted /* if set to true, assume that the input data is sorted and skip sorting (which is necessary for binary-search) */ , - rmm::cuda_stream_view stream) + cuda::stream_ref stream) : store_keys_(std::move(keys)) { if (!key_sorted) { @@ -208,7 +208,7 @@ class key_binary_search_store_t { } } - auto release(rmm::cuda_stream_view stream) + auto release(cuda::stream_ref stream) { auto tmp_store_keys = std::move(store_keys_); store_keys_ = rmm::device_uvector(0, stream); @@ -241,9 +241,9 @@ class key_cuco_store_t { rmm::mr::polymorphic_allocator, cuco_storage_type>; - key_cuco_store_t(rmm::cuda_stream_view stream) {} + key_cuco_store_t(cuda::stream_ref stream) {} - key_cuco_store_t(size_t capacity, key_t invalid_key, rmm::cuda_stream_view stream) + key_cuco_store_t(size_t capacity, key_t invalid_key, cuda::stream_ref stream) { allocate(capacity, invalid_key, stream); capacity_ = capacity; @@ -254,7 +254,7 @@ class key_cuco_store_t { key_cuco_store_t(KeyIterator key_first, KeyIterator key_last, key_t invalid_key, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto num_keys = static_cast(cuda::std::distance(key_first, key_last)); allocate(num_keys, invalid_key, stream); @@ -265,7 +265,7 @@ class key_cuco_store_t { } template - void insert(KeyIterator key_first, KeyIterator key_last, rmm::cuda_stream_view stream) + void insert(KeyIterator key_first, KeyIterator key_last, cuda::stream_ref stream) { auto num_keys = static_cast(cuda::std::distance(key_first, key_last)); if (num_keys == 0) return; @@ -278,7 +278,7 @@ class key_cuco_store_t { KeyIterator key_last, StencilIterator stencil_first, PredOp pred_op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto num_keys = static_cast(cuda::std::distance(key_first, key_last)); if (num_keys == 0) return; @@ -286,7 +286,7 @@ class key_cuco_store_t { size_ += cuco_store_->insert_if(key_first, key_last, stencil_first, pred_op, stream.get()); } - auto release(rmm::cuda_stream_view stream) + auto release(cuda::stream_ref stream) { rmm::device_uvector keys(size(), stream); auto last = cuco_store_->retrieve_all(keys.begin(), stream.get()); @@ -307,7 +307,7 @@ class key_cuco_store_t { size_t capacity() const { return capacity_; } private: - void allocate(size_t num_keys, key_t invalid_key, rmm::cuda_stream_view stream) + void allocate(size_t num_keys, key_t invalid_key, cuda::stream_ref stream) { double constexpr load_factor = 0.7; auto cuco_size = std::max( @@ -344,7 +344,7 @@ class key_store_t { static_assert(std::is_arithmetic_v); - key_store_t(rmm::cuda_stream_view stream) : store_(stream) {} + key_store_t(cuda::stream_ref stream) : store_(stream) {} /* when use_binary_search = false */ template @@ -353,7 +353,7 @@ class key_store_t { capacity can be larger (for performance & correctness reasons) */ , key_t invalid_key /* invalid key shouldn't appear in any *iter in [key_first, key_last) */, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, std::enable_if_t = 0) : store_(capacity, invalid_key, stream) { @@ -366,7 +366,7 @@ class key_store_t { bool key_sorted /* if set to true, assume that the input data is sorted and skip sorting (which is necessary for binary-search) */ , - rmm::cuda_stream_view stream, + cuda::stream_ref stream, std::enable_if_t = 0) : store_(key_first, key_last, key_sorted, stream) { @@ -378,7 +378,7 @@ class key_store_t { KeyIterator key_first, KeyIterator key_last, key_t invalid_key /* invalid key shouldn't appear in any *iter in [key_first, key_last) */, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, std::enable_if_t = 0) : store_(key_first, key_last, invalid_key, stream) { @@ -390,7 +390,7 @@ class key_store_t { bool key_sorted /* if set to true, assume that the input data is sorted and skip sorting (which is necessary for binary-search) */ , - rmm::cuda_stream_view stream, + cuda::stream_ref stream, std::enable_if_t = 0) : store_(std::move(keys), key_sorted, stream) { @@ -400,7 +400,7 @@ class key_store_t { template std::enable_if_t insert(KeyIterator key_first, KeyIterator key_last, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { store_.insert(key_first, key_last, stream); } @@ -414,13 +414,13 @@ class key_store_t { KeyIterator key_last, StencilIterator stencil_first, PredOp pred_op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { store_.insert_if(key_first, key_last, stencil_first, pred_op, stream); } // key_store_t becomes empty after release - auto release(rmm::cuda_stream_view stream) { return store_.release(stream); } + auto release(cuda::stream_ref stream) { return store_.release(stream); } auto view() const { diff --git a/cpp/include/cugraph/prims/kv_store.cuh b/cpp/include/cugraph/prims/kv_store.cuh index f13f13aa462..fa1e8ca74ee 100644 --- a/cpp/include/cugraph/prims/kv_store.cuh +++ b/cpp/include/cugraph/prims/kv_store.cuh @@ -253,7 +253,7 @@ class kv_binary_search_store_view_t { void find(QueryKeyIterator key_first, QueryKeyIterator key_last, ResultValueIterator value_first, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { thrust::transform(rmm::exec_policy(stream), key_first, @@ -267,7 +267,7 @@ class kv_binary_search_store_view_t { void contains(QueryKeyIterator key_first, QueryKeyIterator key_last, ResultValueIterator value_first, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { thrust::transform( rmm::exec_policy(stream), @@ -333,7 +333,7 @@ class kv_cuco_store_view_t { void find(QueryKeyIterator key_first, QueryKeyIterator key_last, ResultValueIterator value_first, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { if constexpr (std::is_arithmetic_v) { cuco_store_->find(key_first, key_last, value_first, stream.get()); @@ -354,7 +354,7 @@ class kv_cuco_store_view_t { void contains(QueryKeyIterator key_first, QueryKeyIterator key_last, ResultValueIterator value_first, - rmm::cuda_stream_view stream) const + cuda::stream_ref stream) const { cuco_store_->contains(key_first, key_last, value_first, stream.get()); } @@ -393,7 +393,7 @@ class kv_binary_search_store_t { using key_type = key_t; using value_type = value_t; - kv_binary_search_store_t(rmm::cuda_stream_view stream) + kv_binary_search_store_t(cuda::stream_ref stream) : store_keys_(0, stream), store_values_(allocate_dataframe_buffer(0, stream)) { } @@ -407,7 +407,7 @@ class kv_binary_search_store_t { bool key_sorted /* if set to true, assume that the input data is sorted and skip sorting (which is necessary for binary-search) */ , - rmm::cuda_stream_view stream) + cuda::stream_ref stream) : store_keys_(static_cast(cuda::std::distance(key_first, key_last)), stream), store_values_(allocate_dataframe_buffer( static_cast(cuda::std::distance(key_first, key_last)), stream)), @@ -429,12 +429,12 @@ class kv_binary_search_store_t { kv_binary_search_store_t( rmm::device_uvector&& keys, - decltype(allocate_dataframe_buffer(0, rmm::cuda_stream_view{}))&& values, + decltype(allocate_dataframe_buffer(0, cuda::stream_ref{}))&& values, value_t invalid_value /* invalid_value is returned when match fails for the given key */, bool key_sorted /* if set to true, assume that the input data is sorted and skip sorting (which is necessary for binary-search) */ , - rmm::cuda_stream_view stream) + cuda::stream_ref stream) : store_keys_(std::move(keys)), store_values_(std::move(values)), invalid_value_(invalid_value) { if (!key_sorted) { @@ -445,7 +445,7 @@ class kv_binary_search_store_t { } } - auto retrieve_all(rmm::cuda_stream_view stream) + auto retrieve_all(cuda::stream_ref stream) { rmm::device_uvector tmp_store_keys(store_keys_.size(), stream); auto tmp_store_values = @@ -459,7 +459,7 @@ class kv_binary_search_store_t { return std::make_tuple(std::move(tmp_store_keys), std::move(tmp_store_values)); } - auto release(rmm::cuda_stream_view stream) + auto release(cuda::stream_ref stream) { auto tmp_store_keys = std::move(store_keys_); auto tmp_store_values = std::move(store_values_); @@ -482,7 +482,7 @@ class kv_binary_search_store_t { private: rmm::device_uvector store_keys_; - decltype(allocate_dataframe_buffer(0, rmm::cuda_stream_view{})) store_values_; + decltype(allocate_dataframe_buffer(0, cuda::stream_ref{})) store_values_; value_t invalid_value_{}; }; @@ -490,10 +490,9 @@ class kv_binary_search_store_t { template class kv_cuco_store_t { public: - using key_type = key_t; - using value_type = value_t; - using value_buffer_type = - decltype(allocate_dataframe_buffer(0, rmm::cuda_stream_view{})); + using key_type = key_t; + using value_type = value_t; + using value_buffer_type = decltype(allocate_dataframe_buffer(0, cuda::stream_ref{})); using const_value_iterator = std::invoke_result_t), value_buffer_type&>; @@ -509,7 +508,7 @@ class kv_cuco_store_t { rmm::mr::polymorphic_allocator, cuco_storage_type>; - kv_cuco_store_t(rmm::cuda_stream_view stream) + kv_cuco_store_t(cuda::stream_ref stream) : store_values_(allocate_optional_dataframe_buffer< std::conditional_t, value_t, void>>(0, stream)) { @@ -518,7 +517,7 @@ class kv_cuco_store_t { kv_cuco_store_t(size_t capacity, key_t invalid_key, value_t invalid_value, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) : store_values_(allocate_optional_dataframe_buffer< std::conditional_t, value_t, void>>(0, stream)) { @@ -534,7 +533,7 @@ class kv_cuco_store_t { ValueIterator value_first, key_t invalid_key, value_t invalid_value, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) : store_values_(allocate_optional_dataframe_buffer< std::conditional_t, value_t, void>>(0, stream)) { @@ -555,7 +554,7 @@ class kv_cuco_store_t { void insert(KeyIterator key_first, KeyIterator key_last, ValueIterator value_first, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { static_assert(std::is_same_v::value_type, key_t>); static_assert( @@ -599,7 +598,7 @@ class kv_cuco_store_t { ValueIterator value_first, StencilIterator stencil_first, PredOp pred_op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { static_assert(std::is_same_v::value_type, key_t>); static_assert( @@ -649,7 +648,7 @@ class kv_cuco_store_t { void insert_and_assign(KeyIterator key_first, KeyIterator key_last, ValueIterator value_first, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { static_assert(std::is_same_v::value_type, key_t>); static_assert( @@ -751,7 +750,7 @@ class kv_cuco_store_t { ValueIterator value_first, StencilIterator stencil_first, PredOp pred_op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto num_keys = static_cast(cuda::std::distance(key_first, key_last)); if (num_keys == 0) return; @@ -792,7 +791,7 @@ class kv_cuco_store_t { } } - auto retrieve_all(rmm::cuda_stream_view stream) + auto retrieve_all(cuda::stream_ref stream) { rmm::device_uvector keys(size_, stream); auto values = allocate_dataframe_buffer(0, stream); @@ -818,7 +817,7 @@ class kv_cuco_store_t { return std::make_tuple(std::move(keys), std::move(values)); } - auto release(rmm::cuda_stream_view stream) + auto release(cuda::stream_ref stream) { auto [retrieved_keys, retrieved_values] = retrieve_all(stream); allocate(0, invalid_key(), invalid_value(), stream); @@ -852,10 +851,7 @@ class kv_cuco_store_t { size_t capacity() const { return capacity_; } private: - void allocate(size_t num_keys, - key_t invalid_key, - value_t invalid_value, - rmm::cuda_stream_view stream) + void allocate(size_t num_keys, key_t invalid_key, value_t invalid_value, cuda::stream_ref stream) { double constexpr load_factor = 0.7; auto cuco_size = std::max( @@ -893,7 +889,7 @@ class kv_cuco_store_t { std::unique_ptr cuco_store_{nullptr}; decltype(allocate_optional_dataframe_buffer< std::conditional_t, value_t, void>>( - 0, rmm::cuda_stream_view{})) store_values_; + 0, cuda::stream_ref{})) store_values_; std::conditional_t, value_t, std::byte /* dummy */> invalid_value_{}; @@ -919,7 +915,7 @@ class kv_store_t { static_assert(std::is_arithmetic_v); static_assert(is_arithmetic_or_thrust_tuple_of_arithmetic::value); - kv_store_t(rmm::cuda_stream_view stream) : store_(stream) {} + kv_store_t(cuda::stream_ref stream) : store_(stream) {} /* when use_binary_search = false */ template @@ -932,7 +928,7 @@ class kv_store_t { value_first + cuda::std::distance(key_first, key_last)), invalid_value is returned when match fails for the given key */ , - rmm::cuda_stream_view stream, + cuda::stream_ref stream, std::enable_if_t = 0) : store_(capacity, invalid_key, invalid_value, stream) { @@ -948,7 +944,7 @@ class kv_store_t { bool key_sorted /* if set to true, assume that the input data is sorted and skip sorting (which is necessary for binary-search) */ , - rmm::cuda_stream_view stream, + cuda::stream_ref stream, std::enable_if_t = 0) : store_(key_first, key_last, value_first, invalid_value, key_sorted, stream) { @@ -965,7 +961,7 @@ class kv_store_t { value_first + cuda::std::distance(key_first, key_last)), invalid_value is returned when match fails for the given key */ , - rmm::cuda_stream_view stream, + cuda::stream_ref stream, std::enable_if_t = 0) : store_(key_first, key_last, value_first, invalid_key, invalid_value, stream) { @@ -975,12 +971,12 @@ class kv_store_t { template kv_store_t( rmm::device_uvector&& keys, - decltype(allocate_dataframe_buffer(0, rmm::cuda_stream_view{}))&& values, + decltype(allocate_dataframe_buffer(0, cuda::stream_ref{}))&& values, value_t invalid_value /* invalid_value is returned when match fails for the given key */, bool key_sorted /* if set to true, assume that the input data is sorted and skip sorting (which is necessary for binary-search) */ , - rmm::cuda_stream_view stream, + cuda::stream_ref stream, std::enable_if_t = 0) : store_(std::move(keys), std::move(values), invalid_value, key_sorted, stream) { @@ -991,7 +987,7 @@ class kv_store_t { std::enable_if_t insert(KeyIterator key_first, KeyIterator key_last, ValueIterator value_first, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { store_.insert(key_first, key_last, value_first, stream); } @@ -1007,7 +1003,7 @@ class kv_store_t { ValueIterator value_first, StencilIterator stencil_first, PredOp pred_op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { store_.insert_if(key_first, key_last, value_first, stencil_first, pred_op, stream); } @@ -1017,7 +1013,7 @@ class kv_store_t { std::enable_if_t insert_and_assign(KeyIterator key_first, KeyIterator key_last, ValueIterator value_first, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { store_.insert_and_assign(key_first, key_last, value_first, stream); } @@ -1033,15 +1029,15 @@ class kv_store_t { ValueIterator value_first, StencilIterator stencil_first, PredOp pred_op, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { store_.insert_and_assign_if(key_first, key_last, value_first, stencil_first, pred_op, stream); } - auto retrieve_all(rmm::cuda_stream_view stream) const { return store_.retrieve_all(stream); } + auto retrieve_all(cuda::stream_ref stream) const { return store_.retrieve_all(stream); } // kv_store_t becomes empty after release - auto release(rmm::cuda_stream_view stream) { return store_.release(stream); } + auto release(cuda::stream_ref stream) { return store_.release(stream); } auto view() const { diff --git a/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh b/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh index a5befeff366..8e3c2986023 100644 --- a/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh +++ b/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh @@ -206,7 +206,7 @@ void per_v_pair_transform_minor_nbr_intersection( auto num_input_pairs = static_cast(cuda::std::distance(vertex_pair_first, vertex_pair_last)); std::optional> sorted_unique_vertices{std::nullopt}; - std::optional(size_t{0}, rmm::cuda_stream_view{}))> + std::optional(size_t{0}, cuda::stream_ref{}))> property_buffer_for_sorted_unique_vertices{std::nullopt}; if constexpr (GraphViewType::is_multi_gpu) { auto& comm = handle.get_comms(); diff --git a/cpp/include/cugraph/prims/vertex_frontier.cuh b/cpp/include/cugraph/prims/vertex_frontier.cuh index a10c2c0a225..43e6ceccf13 100644 --- a/cpp/include/cugraph/prims/vertex_frontier.cuh +++ b/cpp/include/cugraph/prims/vertex_frontier.cuh @@ -53,7 +53,7 @@ template KeyIterator compute_key_lower_bound(KeyIterator sorted_unique_key_first, KeyIterator sorted_unique_key_last, vertex_t v_threshold, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { using key_t = typename thrust::iterator_traits::value_type; @@ -78,7 +78,7 @@ std::vector compute_key_segment_offsets(KeyIterator sorted_key_first, KeyIterator sorted_key_last, raft::host_span segment_offsets, vertex_t vertex_range_first, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { using key_t = typename thrust::iterator_traits::value_type; @@ -125,7 +125,7 @@ rmm::device_uvector compute_vertex_list_bitmap_info( VertexIterator sorted_unique_vertex_last, typename thrust::iterator_traits::value_type vertex_range_first, typename thrust::iterator_traits::value_type vertex_range_last, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { using vertex_t = typename thrust::iterator_traits::value_type; @@ -174,7 +174,7 @@ void device_bcast_vertex_list( typename thrust::iterator_traits::value_type vertex_range_last, size_t v_list_size, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { using vertex_t = typename thrust::iterator_traits::value_type; @@ -214,7 +214,7 @@ void retrieve_vertex_list_from_bitmap( raft::device_span count /* size = 1 */, typename thrust::iterator_traits::value_type vertex_range_first, typename thrust::iterator_traits::value_type vertex_range_last, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { using vertex_t = typename thrust::iterator_traits::value_type; diff --git a/cpp/include/cugraph/utilities/collect_comm.cuh b/cpp/include/cugraph/utilities/collect_comm.cuh index 4e3cfddc8cb..950780c45ea 100644 --- a/cpp/include/cugraph/utilities/collect_comm.cuh +++ b/cpp/include/cugraph/utilities/collect_comm.cuh @@ -51,7 +51,7 @@ void find_values_for_collect_keys( ValueIterator collect_value_first, typename KVStoreViewType::key_type invalid_key, typename KVStoreViewType::value_type invalid_value, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { using key_t = typename KVStoreViewType::key_type; using value_t = typename KVStoreViewType::value_type; @@ -109,7 +109,7 @@ collect_values_for_unique_keys( KVStoreViewType kv_store_view, rmm::device_uvector&& collect_unique_keys, KeyToCommRankOp key_to_comm_rank_op, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { using key_t = typename KVStoreViewType::key_type; using value_t = typename KVStoreViewType::value_type; @@ -147,7 +147,7 @@ dataframe_buffer_type_t collect_values_for KeyIterator collect_key_first, KeyIterator collect_key_last, KeyToCommRankOp key_to_comm_rank_op, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { using key_t = typename KVStoreViewType::key_type; static_assert(std::is_same_v::value_type, key_t>); diff --git a/cpp/include/cugraph/utilities/dataframe_buffer.hpp b/cpp/include/cugraph/utilities/dataframe_buffer.hpp index 80c1936ce3a..503ea5e0d90 100644 --- a/cpp/include/cugraph/utilities/dataframe_buffer.hpp +++ b/cpp/include/cugraph/utilities/dataframe_buffer.hpp @@ -25,7 +25,7 @@ template auto allocate_dataframe_buffer_tuple_impl( std::index_sequence, size_t buffer_size, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource_ref()) { return std::make_tuple( @@ -64,7 +64,7 @@ template < typename std::enable_if_t || std::is_arithmetic_v>* = nullptr> auto allocate_dataframe_buffer( size_t buffer_size, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource_ref()) { return rmm::device_uvector(buffer_size, stream_view, mr); @@ -73,7 +73,7 @@ auto allocate_dataframe_buffer( template ::value>* = nullptr> auto allocate_dataframe_buffer( size_t buffer_size, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource_ref()) { size_t constexpr tuple_size = cuda::std::tuple_size::value; @@ -83,7 +83,7 @@ auto allocate_dataframe_buffer( template struct dataframe_buffer_type { - using type = decltype(allocate_dataframe_buffer(size_t{0}, rmm::cuda_stream_view{})); + using type = decltype(allocate_dataframe_buffer(size_t{0}, cuda::stream_ref{})); }; template @@ -92,7 +92,7 @@ using dataframe_buffer_type_t = typename dataframe_buffer_type::type; template std::optional> try_allocate_dataframe_buffer( size_t buffer_size, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource_ref()) { try { @@ -134,7 +134,7 @@ using dataframe_buffer_const_iterator_type_t = template void reserve_dataframe_buffer(BufferType& buffer, size_t new_buffer_capacity, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert(is_std_tuple_of_arithmetic_vectors>::value || is_arithmetic_vector, rmm::device_uvector>::value || @@ -151,7 +151,7 @@ void reserve_dataframe_buffer(BufferType& buffer, template void resize_dataframe_buffer(BufferType& buffer, size_t new_buffer_size, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert(is_std_tuple_of_arithmetic_vectors>::value || is_arithmetic_vector, rmm::device_uvector>::value || @@ -166,7 +166,7 @@ void resize_dataframe_buffer(BufferType& buffer, } template -void shrink_to_fit_dataframe_buffer(BufferType& buffer, rmm::cuda_stream_view stream_view) +void shrink_to_fit_dataframe_buffer(BufferType& buffer, cuda::stream_ref stream_view) { static_assert(is_std_tuple_of_arithmetic_vectors>::value || is_arithmetic_vector, rmm::device_uvector>::value || diff --git a/cpp/include/cugraph/utilities/device_comm.hpp b/cpp/include/cugraph/utilities/device_comm.hpp index d4534289c4a..0b48ef67120 100644 --- a/cpp/include/cugraph/utilities/device_comm.hpp +++ b/cpp/include/cugraph/utilities/device_comm.hpp @@ -150,7 +150,7 @@ std::enable_if_t::value, void> device_sendre OutputIterator output_first, size_t rx_count, int src, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { // no-op } @@ -166,7 +166,7 @@ device_sendrecv_impl(raft::comms::comms_t const& comm, OutputIterator output_first, size_t rx_count, int src, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { using value_type = typename std::iterator_traits::value_type; static_assert( @@ -189,7 +189,7 @@ struct device_sendrecv_tuple_iterator_element_impl { OutputIterator output_first, size_t rx_count, int src, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { using output_value_t = cuda::std::tuple_element_t::value_type>; @@ -218,7 +218,7 @@ struct device_sendrecv_tuple_iterator_element_impl::value, void> device_multic raft::host_span rx_counts, raft::host_span rx_displs, raft::host_span rx_src_ranks, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { // no-op } @@ -252,7 +252,7 @@ device_multicast_sendrecv_impl(raft::comms::comms_t const& comm, raft::host_span rx_counts, raft::host_span rx_displs, raft::host_span rx_src_ranks, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { using value_type = typename std::iterator_traits::value_type; static_assert( @@ -279,7 +279,7 @@ struct device_multicast_sendrecv_tuple_iterator_element_impl { raft::host_span rx_counts, raft::host_span rx_displs, raft::host_span rx_src_ranks, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { using output_value_t = cuda::std::tuple_element_t::value_type>; @@ -321,7 +321,7 @@ struct device_multicast_sendrecv_tuple_iterator_element_impl rx_counts, raft::host_span rx_displs, raft::host_span rx_src_ranks, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { } }; @@ -332,7 +332,7 @@ std::enable_if_t::value, void> device_alltoa InputIterator input_first, OutputIterator output_first, size_t count_per_rank, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { // no-op } @@ -345,7 +345,7 @@ device_alltoall_impl(raft::comms::comms_t const& comm, InputIterator input_first, OutputIterator output_first, size_t count_per_rank, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { using value_type = typename std::iterator_traits::value_type; static_assert( @@ -379,7 +379,7 @@ struct device_alltoall_tuple_iterator_element_impl { InputIterator input_first, OutputIterator output_first, size_t count_per_rank, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { using output_value_t = typename cuda::std:: tuple_element::value_type>::type; @@ -398,7 +398,7 @@ struct device_alltoall_tuple_iterator_element_impl::value, void> device_bcast_ OutputIterator output_first, size_t count, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { // no-op } @@ -424,7 +424,7 @@ device_bcast_impl(raft::comms::comms_t const& comm, OutputIterator output_first, size_t count, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert(std::is_same_v::value_type, typename std::iterator_traits::value_type>); @@ -439,7 +439,7 @@ struct device_bcast_tuple_iterator_element_impl { OutputIterator output_first, size_t count, int root, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { device_bcast_impl(comm, cuda::std::get(input_first.get_iterator_tuple()), @@ -459,7 +459,7 @@ struct device_bcast_tuple_iterator_element_impl::value, void> device_allred OutputIterator output_first, size_t count, raft::comms::op_t op, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { // no-op } @@ -485,7 +485,7 @@ device_allreduce_impl(raft::comms::comms_t const& comm, OutputIterator output_first, size_t count, raft::comms::op_t op, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert(std::is_same_v::value_type, typename std::iterator_traits::value_type>); @@ -500,7 +500,7 @@ struct device_allreduce_tuple_iterator_element_impl { OutputIterator output_first, size_t count, raft::comms::op_t op, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { device_allreduce_impl(comm, cuda::std::get(input_first.get_iterator_tuple()), @@ -520,7 +520,7 @@ struct device_allreduce_tuple_iterator_element_impl::value, void> device_reduce size_t count, raft::comms::op_t op, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { // no-op } @@ -548,7 +548,7 @@ device_reduce_impl(raft::comms::comms_t const& comm, size_t count, raft::comms::op_t op, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert(std::is_same_v::value_type, typename std::iterator_traits::value_type>); @@ -568,7 +568,7 @@ struct device_reduce_tuple_iterator_element_impl { size_t count, raft::comms::op_t op, int root, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { device_reduce_impl(comm, cuda::std::get(input_first.get_iterator_tuple()), @@ -590,7 +590,7 @@ struct device_reduce_tuple_iterator_element_impl::value, void> device_allgat InputIterator input_first, OutputIterator output_first, size_t sendcount, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { // no-op } @@ -614,7 +614,7 @@ device_allgather_impl(raft::comms::comms_t const& comm, InputIterator input_first, OutputIterator output_first, size_t sendcount, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert(std::is_same_v::value_type, typename std::iterator_traits::value_type>); @@ -628,7 +628,7 @@ struct device_allgather_tuple_iterator_element_impl { InputIterator input_first, OutputIterator output_first, size_t sendcount, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { device_allgather_impl(comm, cuda::std::get(input_first.get_iterator_tuple()), @@ -646,7 +646,7 @@ struct device_allgather_tuple_iterator_element_impl::value, void> device_allgat OutputIterator output_first, raft::host_span recvcounts, raft::host_span displacements, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { // no-op } @@ -672,7 +672,7 @@ device_allgatherv_impl(raft::comms::comms_t const& comm, OutputIterator output_first, raft::host_span recvcounts, raft::host_span displacements, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert(std::is_same_v::value_type, typename std::iterator_traits::value_type>); @@ -690,7 +690,7 @@ struct device_allgatherv_tuple_iterator_element_impl { OutputIterator output_first, raft::host_span recvcounts, raft::host_span displacements, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { device_allgatherv_impl(comm, cuda::std::get(input_first.get_iterator_tuple()), @@ -710,7 +710,7 @@ struct device_allgatherv_tuple_iterator_element_impl recvcounts, raft::host_span displacements, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { } }; @@ -724,7 +724,7 @@ std::enable_if_t::value, void> device_gather raft::host_span recvcounts, raft::host_span displacements, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { // no-op } @@ -740,7 +740,7 @@ device_gatherv_impl(raft::comms::comms_t const& comm, raft::host_span recvcounts, raft::host_span displacements, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert(std::is_same_v::value_type, typename std::iterator_traits::value_type>); @@ -762,7 +762,7 @@ struct device_gatherv_tuple_iterator_element_impl { raft::host_span recvcounts, raft::host_span displacements, int root, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { device_gatherv_impl(comm, cuda::std::get(input_first.get_iterator_tuple()), @@ -786,7 +786,7 @@ struct device_gatherv_tuple_iterator_element_impl recvcounts, raft::host_span displacements, int root, - rmm::cuda_stream_view stream_view) const + cuda::stream_ref stream_view) const { } }; @@ -883,7 +883,7 @@ device_sendrecv(raft::comms::comms_t const& comm, OutputIterator output_first, size_t rx_count, int src, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { detail::device_sendrecv_impl( comm, input_first, tx_count, dst, output_first, rx_count, src, stream_view); @@ -901,7 +901,7 @@ device_sendrecv(raft::comms::comms_t const& comm, OutputIterator output_first, size_t rx_count, int src, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert( cuda::std::tuple_size::value_type>::value == @@ -930,7 +930,7 @@ device_multicast_sendrecv(raft::comms::comms_t const& comm, raft::host_span rx_counts, raft::host_span rx_displs, raft::host_span rx_src_ranks, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { detail::device_multicast_sendrecv_impl(comm, input_first, @@ -958,7 +958,7 @@ device_multicast_sendrecv(raft::comms::comms_t const& comm, raft::host_span rx_counts, raft::host_span rx_displs, raft::host_span rx_src_ranks, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert( cuda::std::tuple_size::value_type>::value == @@ -991,7 +991,7 @@ device_alltoall(raft::comms::comms_t const& comm, InputIterator input_first, OutputIterator output_first, size_t count_per_rank, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { detail::device_alltoall_impl( comm, input_first, output_first, count_per_rank, stream_view); @@ -1006,7 +1006,7 @@ device_alltoall(raft::comms::comms_t const& comm, InputIterator input_first, OutputIterator output_first, size_t count_per_rank, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert( cuda::std::tuple_size::value_type>::value == @@ -1031,7 +1031,7 @@ device_bcast(raft::comms::comms_t const& comm, OutputIterator output_first, size_t count, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { detail::device_bcast_impl(comm, input_first, output_first, count, root, stream_view); } @@ -1046,7 +1046,7 @@ device_bcast(raft::comms::comms_t const& comm, OutputIterator output_first, size_t count, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert( cuda::std::tuple_size::value_type>::value == @@ -1069,7 +1069,7 @@ device_allreduce(raft::comms::comms_t const& comm, OutputIterator output_first, size_t count, raft::comms::op_t op, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { detail::device_allreduce_impl(comm, input_first, output_first, count, op, stream_view); } @@ -1084,7 +1084,7 @@ device_allreduce(raft::comms::comms_t const& comm, OutputIterator output_first, size_t count, raft::comms::op_t op, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert( cuda::std::tuple_size::value_type>::value == @@ -1110,7 +1110,7 @@ device_reduce(raft::comms::comms_t const& comm, size_t count, raft::comms::op_t op, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { detail::device_reduce_impl(comm, input_first, output_first, count, op, root, stream_view); } @@ -1126,7 +1126,7 @@ device_reduce(raft::comms::comms_t const& comm, size_t count, raft::comms::op_t op, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert( cuda::std::tuple_size::value_type>::value == @@ -1150,7 +1150,7 @@ device_allgather(raft::comms::comms_t const& comm, InputIterator input_first, OutputIterator output_first, size_t sendcount, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { detail::device_allgather_impl(comm, input_first, output_first, sendcount, stream_view); } @@ -1164,7 +1164,7 @@ device_allgather(raft::comms::comms_t const& comm, InputIterator input_first, OutputIterator output_first, size_t sendcount, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert( cuda::std::tuple_size::value_type>::value == @@ -1189,7 +1189,7 @@ device_allgatherv(raft::comms::comms_t const& comm, OutputIterator output_first, raft::host_span recvcounts, raft::host_span displacements, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { detail::device_allgatherv_impl( comm, input_first, output_first, recvcounts, displacements, stream_view); @@ -1205,7 +1205,7 @@ device_allgatherv(raft::comms::comms_t const& comm, OutputIterator output_first, raft::host_span recvcounts, raft::host_span displacements, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert( cuda::std::tuple_size::value_type>::value == @@ -1232,7 +1232,7 @@ device_gatherv(raft::comms::comms_t const& comm, raft::host_span recvcounts, raft::host_span displacements, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { detail::device_gatherv_impl( comm, input_first, output_first, sendcount, recvcounts, displacements, root, stream_view); @@ -1250,7 +1250,7 @@ device_gatherv(raft::comms::comms_t const& comm, raft::host_span recvcounts, raft::host_span displacements, int root, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert( cuda::std::tuple_size::value_type>::value == diff --git a/cpp/include/cugraph/utilities/groupby_and_count.cuh b/cpp/include/cugraph/utilities/groupby_and_count.cuh index 5ce117ae62a..6482621aee9 100644 --- a/cpp/include/cugraph/utilities/groupby_and_count.cuh +++ b/cpp/include/cugraph/utilities/groupby_and_count.cuh @@ -85,7 +85,7 @@ compute_partition_permutation_map(KeyIterator key_first, KeyToGroupIdOp key_to_group_id_op, int group_first, int group_last, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { auto const num_keys = static_cast(cuda::std::distance(key_first, key_last)); auto const num_groups = group_last - group_first; @@ -123,7 +123,7 @@ void apply_multi_partition_permutation( std::tuple, rmm::device_uvector, rmm::device_uvector> const& permutation_map, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { auto const& group_id_offsets = std::get<0>(permutation_map); auto const& intra_partition_displs = std::get<1>(permutation_map); @@ -151,7 +151,7 @@ void multi_partition(ValueIterator value_first, ValueToGroupIdOp value_to_group_id_op, int group_first, int group_last, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { auto permutation_map = compute_partition_permutation_map( value_first, value_last, value_to_group_id_op, group_first, group_last, stream_view); @@ -170,7 +170,7 @@ void multi_partition(KeyIterator key_first, KeyToGroupIdOp key_to_group_id_op, int group_first, int group_last, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { auto const num_keys = static_cast(cuda::std::distance(key_first, key_last)); @@ -187,7 +187,7 @@ template void swap_partitions(ValueIterator value_first, ValueIterator value_last, size_t first_partition_size, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { using value_t = typename thrust::iterator_traits::value_type; @@ -245,7 +245,7 @@ void swap_partitions(KeyIterator key_first, KeyIterator key_last, ValueIterator value_first, size_t first_partition_size, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { using key_t = typename thrust::iterator_traits::value_type; @@ -339,7 +339,7 @@ void mem_frugal_groupby( int num_groups, size_t mem_frugal_threshold, // take the memory frugal approach (instead of thrust::sort) if # // elements to groupby is no smaller than this value - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { CUGRAPH_EXPECTS(!large_buffer_type || large_buffer_manager::memory_buffer_initialized(), @@ -445,7 +445,7 @@ void mem_frugal_groupby( int num_groups, size_t mem_frugal_threshold, // take the memory frugal approach (instead of thrust::sort) if # // elements to groupby is no smaller than this value - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { CUGRAPH_EXPECTS(!large_buffer_type || large_buffer_manager::memory_buffer_initialized(), @@ -563,7 +563,7 @@ rmm::device_uvector groupby_and_count( ValueToGroupIdOp value_to_group_id_op, int num_groups, size_t mem_frugal_threshold, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { CUGRAPH_EXPECTS(!large_buffer_type || large_buffer_manager::memory_buffer_initialized(), @@ -603,7 +603,7 @@ rmm::device_uvector groupby_and_count( KeyToGroupIdOp key_to_group_id_op, int num_groups, size_t mem_frugal_threshold, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { CUGRAPH_EXPECTS(!large_buffer_type || large_buffer_manager::memory_buffer_initialized(), diff --git a/cpp/include/cugraph/utilities/mask_utils.cuh b/cpp/include/cugraph/utilities/mask_utils.cuh index e520213fddd..028e1ce8c54 100644 --- a/cpp/include/cugraph/utilities/mask_utils.cuh +++ b/cpp/include/cugraph/utilities/mask_utils.cuh @@ -341,7 +341,7 @@ void partition_by_mask(InputIterator input_first, uint32_t const* mask_first, size_t first_size, size_t second_size, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { using element_t = typename thrust::iterator_traits::value_type; @@ -372,7 +372,7 @@ struct partition_by_mask_zip_split_impl { uint32_t const* mask_first, size_t first_size, size_t second_size, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type) { auto const& input_tuple = input_first.get_iterator_tuple(); @@ -397,7 +397,7 @@ struct partition_by_mask_zip_split_impl { uint32_t const*, size_t, size_t, - rmm::cuda_stream_view, + cuda::stream_ref, std::optional) { } @@ -410,7 +410,7 @@ void partition_by_mask_zip_split( uint32_t const* mask_first, size_t first_size, size_t second_size, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { constexpr size_t tuple_size = cuda::std::tuple_size::value; @@ -427,7 +427,7 @@ void partition_by_mask(ZipIterator input_first, uint32_t const* mask_first, size_t first_size, size_t second_size, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { partition_by_mask_zip_split( @@ -499,7 +499,7 @@ template std::tuple> mark_entries( size_t num_entries, comparison_t comparison, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { auto marked_entries = large_buffer_type ? large_buffer_manager::allocate_memory_buffer( @@ -556,7 +556,7 @@ void partition_by_mask(InputIterator input_first, uint32_t const* mask_first, size_t first_size, size_t second_size, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type) { detail::partition_by_mask( diff --git a/cpp/include/cugraph/utilities/mem_frugal_partition.cuh b/cpp/include/cugraph/utilities/mem_frugal_partition.cuh index 16e2af7f5eb..74741a77ba5 100644 --- a/cpp/include/cugraph/utilities/mem_frugal_partition.cuh +++ b/cpp/include/cugraph/utilities/mem_frugal_partition.cuh @@ -27,7 +27,7 @@ ValueIterator mem_frugal_partition( ValueIterator value_last, ValueToGroupIdOp value_to_group_id_op, int pivot, // group id less than pivot goes to the first partition - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { CUGRAPH_EXPECTS(!large_buffer_type || large_buffer_manager::memory_buffer_initialized(), @@ -64,7 +64,7 @@ std::tuple mem_frugal_partition( ValueIterator value_first, KeyToGroupIdOp key_to_group_id_op, int pivot, // group Id less than pivot goes to the first partition - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { CUGRAPH_EXPECTS(!large_buffer_type || large_buffer_manager::memory_buffer_initialized(), diff --git a/cpp/include/cugraph/utilities/misc_utils.cuh b/cpp/include/cugraph/utilities/misc_utils.cuh index a4d843c0240..58b9d8bd2ac 100644 --- a/cpp/include/cugraph/utilities/misc_utils.cuh +++ b/cpp/include/cugraph/utilities/misc_utils.cuh @@ -101,7 +101,7 @@ std::optional to_std_optional(cuda::std::optional val) template rmm::device_uvector expand_sparse_offsets(raft::device_span offsets, idx_t base_idx, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { assert(offsets.size() > 0); diff --git a/cpp/include/cugraph/utilities/partition_scatter_map_wrappers.cuh b/cpp/include/cugraph/utilities/partition_scatter_map_wrappers.cuh index e401c701e69..1b2484c1eee 100644 --- a/cpp/include/cugraph/utilities/partition_scatter_map_wrappers.cuh +++ b/cpp/include/cugraph/utilities/partition_scatter_map_wrappers.cuh @@ -27,14 +27,14 @@ CUGRAPH_EXPORT rmm::device_uvector compute_partition_scatter_map_impl( offset_t const* intra_partition_displs, size_t const* group_displacements, size_t num_elements, - rmm::cuda_stream_view stream_view); + cuda::stream_ref stream_view); template rmm::device_uvector compute_partition_scatter_map( rmm::device_uvector const& group_id_offsets, rmm::device_uvector const& intra_partition_displs, rmm::device_uvector const& group_displacements, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { static_assert(compute_partition_scatter_map_supported_v, "compute_partition_scatter_map is not explicitly instantiated for this " diff --git a/cpp/include/cugraph/utilities/permute_wrappers.cuh b/cpp/include/cugraph/utilities/permute_wrappers.cuh index d160dc9e34a..5b9724dd247 100644 --- a/cpp/include/cugraph/utilities/permute_wrappers.cuh +++ b/cpp/include/cugraph/utilities/permute_wrappers.cuh @@ -32,13 +32,13 @@ template void permute_in_place_impl(T* first, std::size_t const* map_first, std::size_t num_elements, - rmm::cuda_stream_view stream_view); + cuda::stream_ref stream_view); template void permute_scalar_in_place(Iterator first, std::size_t const* map_first, std::size_t num_elements, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { if constexpr (scatter_supported_scalar_value_v>) { permute_in_place_impl(first, map_first, num_elements, stream_view); @@ -58,7 +58,7 @@ struct permute_zip_in_place_split_impl { static void run(ZipIterator first, ZipIterator last, std::size_t const* map_first, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { auto const num_elements = static_cast(cuda::std::distance(first, last)); permute_scalar_in_place( @@ -70,12 +70,14 @@ struct permute_zip_in_place_split_impl { template struct permute_zip_in_place_split_impl { - static void run(ZipIterator, ZipIterator, std::size_t const*, rmm::cuda_stream_view) {} + static void run(ZipIterator, ZipIterator, std::size_t const*, cuda::stream_ref) {} }; template -std::enable_if_t> permute_in_place( - Iterator first, Iterator last, std::size_t const* map_first, rmm::cuda_stream_view stream_view) +std::enable_if_t> permute_in_place(Iterator first, + Iterator last, + std::size_t const* map_first, + cuda::stream_ref stream_view) { permute_zip_in_place_split_impl>::run( first, last, map_first, stream_view); @@ -83,7 +85,7 @@ std::enable_if_t> permute_in_place( template std::enable_if_t> permute_in_place( - Iterator first, Iterator last, std::size_t const* map_first, rmm::cuda_stream_view stream_view) + Iterator first, Iterator last, std::size_t const* map_first, cuda::stream_ref stream_view) { auto const num_elements = static_cast(cuda::std::distance(first, last)); permute_scalar_in_place(first, map_first, num_elements, stream_view); diff --git a/cpp/include/cugraph/utilities/shuffle_comm.cuh b/cpp/include/cugraph/utilities/shuffle_comm.cuh index 0dbf452a9ad..9b61fa6f10e 100644 --- a/cpp/include/cugraph/utilities/shuffle_comm.cuh +++ b/cpp/include/cugraph/utilities/shuffle_comm.cuh @@ -56,7 +56,7 @@ inline std::tuple, compute_tx_rx_counts_displs_ranks(raft::comms::comms_t const& comm, raft::device_span d_tx_value_counts, bool drop_empty_ranks, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { auto const comm_size = comm.get_size(); @@ -139,7 +139,7 @@ template auto shuffle_values(raft::comms::comms_t const& comm, TxValueIterator tx_value_first, raft::device_span d_tx_value_counts, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { using value_t = typename thrust::iterator_traits::value_type; @@ -188,7 +188,7 @@ template auto shuffle_values(raft::comms::comms_t const& comm, TxValueIterator tx_value_first, raft::host_span tx_value_counts, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { using value_t = typename thrust::iterator_traits::value_type; @@ -217,7 +217,7 @@ auto shuffle_values( raft::host_span tx_value_counts, size_t alignment, // # elements std::optional::value_type> fill_value, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { using value_t = typename thrust::iterator_traits::value_type; @@ -364,7 +364,7 @@ auto shuffle_and_unique_segment_sorted_values( // tx_value_counts[i], where i = [0, comm_size); and bettter be // unique to reduce communication volume raft::host_span tx_value_counts, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { using value_t = typename thrust::iterator_traits::value_type; @@ -469,7 +469,7 @@ auto groupby_gpu_id_and_shuffle_values( ValueIterator tx_value_first /* [INOUT */, ValueIterator tx_value_last /* [INOUT */, ValueToGPUIdOp value_to_gpu_id_op, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { using value_t = typename thrust::iterator_traits::value_type; @@ -536,7 +536,7 @@ auto groupby_gpu_id_and_shuffle_kv_pairs( KeyIterator tx_key_last /* [INOUT */, ValueIterator tx_value_first /* [INOUT */, KeyToGPUIdOp key_to_gpu_id_op, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, std::optional large_buffer_type = std::nullopt) { using key_t = typename thrust::iterator_traits::value_type; diff --git a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh index ead3107ce3e..f38141b2fdb 100644 --- a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh +++ b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh @@ -153,7 +153,7 @@ class concurrent_unordered_map { * storage */ static auto create(size_type capacity, - rmm::cuda_stream_view stream, + cuda::stream_ref stream, mapped_type const unused_element = std::numeric_limits::max(), key_type const unused_key = std::numeric_limits::max(), Hasher const& hash_function = hasher(), @@ -423,7 +423,7 @@ class concurrent_unordered_map { } } - void assign_async(concurrent_unordered_map const& other, rmm::cuda_stream_view stream) + void assign_async(concurrent_unordered_map const& other, cuda::stream_ref stream) { if (other.m_capacity <= m_capacity) { m_capacity = other.m_capacity; @@ -441,7 +441,7 @@ class concurrent_unordered_map { stream.get())); } - void clear_async(rmm::cuda_stream_view stream) + void clear_async(cuda::stream_ref stream) { constexpr int block_size = 128; init_hashtbl<<<((m_capacity - 1) / block_size) + 1, block_size, 0, stream.get()>>>( @@ -456,7 +456,7 @@ class concurrent_unordered_map { } } - void prefetch(int const dev_id, rmm::cuda_stream_view stream) + void prefetch(int const dev_id, cuda::stream_ref stream) { cudaPointerAttributes hashtbl_values_ptr_attributes; cudaError_t status = cudaPointerGetAttributes(&hashtbl_values_ptr_attributes, m_hashtbl_values); @@ -476,7 +476,7 @@ class concurrent_unordered_map { * * @param stream CUDA stream used for device memory operations and kernel launches. */ - void destroy(rmm::cuda_stream_view stream) + void destroy(cuda::stream_ref stream) { m_allocator.deallocate(m_hashtbl_values, m_capacity, stream); delete this; @@ -517,7 +517,7 @@ class concurrent_unordered_map { Hasher const& hash_function, Equality const& equal, allocator_type const& allocator, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) : m_hf(hash_function), m_equal(equal), m_allocator(allocator), diff --git a/cpp/src/c_api/array.hpp b/cpp/src/c_api/array.hpp index 95e54bd1353..e678c7770f1 100644 --- a/cpp/src/c_api/array.hpp +++ b/cpp/src/c_api/array.hpp @@ -44,7 +44,7 @@ struct cugraph_type_erased_device_array_t { cugraph_type_erased_device_array_t(size_t size, size_t num_bytes, cugraph_data_type_id_t type, - rmm::cuda_stream_view const& stream_view) + cuda::stream_ref const& stream_view) : size_(size), data_(num_bytes, stream_view), type_(type) { } diff --git a/cpp/src/c_api/graph_helper.hpp b/cpp/src/c_api/graph_helper.hpp index 936984fab92..19b83e0ff29 100644 --- a/cpp/src/c_api/graph_helper.hpp +++ b/cpp/src/c_api/graph_helper.hpp @@ -13,7 +13,7 @@ namespace c_api { template rmm::device_uvector expand_sparse_offsets(raft::device_span offsets, vertex_t base_vertex_id, - rmm::cuda_stream_view const& stream); + cuda::stream_ref const& stream); template edge_property_t create_constant_edge_property( @@ -34,7 +34,7 @@ edge_property_t create_constant_edge_prope template void copy_or_transform(raft::device_span output, cugraph_type_erased_device_array_view_t const* input, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); } // namespace c_api } // namespace cugraph diff --git a/cpp/src/c_api/graph_helper_impl.cuh b/cpp/src/c_api/graph_helper_impl.cuh index b10b8601d8d..22f25412c2d 100644 --- a/cpp/src/c_api/graph_helper_impl.cuh +++ b/cpp/src/c_api/graph_helper_impl.cuh @@ -17,7 +17,7 @@ namespace c_api { template rmm::device_uvector expand_sparse_offsets(raft::device_span offsets, vertex_t base_vertex_id, - rmm::cuda_stream_view const& stream) + cuda::stream_ref const& stream) { return cugraph::detail::expand_sparse_offsets(offsets, base_vertex_id, stream); } @@ -36,7 +36,7 @@ edge_property_t create_constant_edge_prope template void copy_or_transform(raft::device_span output, cugraph_type_erased_device_array_view_t const* input, - rmm::cuda_stream_view const& stream_view) + cuda::stream_ref const& stream_view) { if (((input->type_ == cugraph_data_type_id_t::INT8) && (std::is_same_v)) || ((input->type_ == cugraph_data_type_id_t::INT16) && (std::is_same_v)) || diff --git a/cpp/src/c_api/graph_helper_sg.cu b/cpp/src/c_api/graph_helper_sg.cu index be93fdc9f15..9e52780adb9 100644 --- a/cpp/src/c_api/graph_helper_sg.cu +++ b/cpp/src/c_api/graph_helper_sg.cu @@ -11,57 +11,47 @@ namespace cugraph { namespace c_api { template CUGRAPH_EXPORT rmm::device_uvector expand_sparse_offsets( - raft::device_span offsets, - int32_t base_vertex_id, - rmm::cuda_stream_view const& stream); + raft::device_span offsets, int32_t base_vertex_id, cuda::stream_ref const& stream); template CUGRAPH_EXPORT rmm::device_uvector expand_sparse_offsets( - raft::device_span offsets, - int32_t base_vertex_id, - rmm::cuda_stream_view const& stream); + raft::device_span offsets, int32_t base_vertex_id, cuda::stream_ref const& stream); template CUGRAPH_EXPORT rmm::device_uvector expand_sparse_offsets( - raft::device_span offsets, - int64_t base_vertex_id, - rmm::cuda_stream_view const& stream); + raft::device_span offsets, int64_t base_vertex_id, cuda::stream_ref const& stream); template CUGRAPH_EXPORT rmm::device_uvector expand_sparse_offsets( - raft::device_span offsets, - int32_t base_vertex_id, - rmm::cuda_stream_view const& stream); + raft::device_span offsets, int32_t base_vertex_id, cuda::stream_ref const& stream); template CUGRAPH_EXPORT rmm::device_uvector expand_sparse_offsets( - raft::device_span offsets, - int64_t base_vertex_id, - rmm::cuda_stream_view const& stream); + raft::device_span offsets, int64_t base_vertex_id, cuda::stream_ref const& stream); template CUGRAPH_EXPORT void copy_or_transform(raft::device_span output, cugraph_type_erased_device_array_view_t const* input, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); template CUGRAPH_EXPORT void copy_or_transform(raft::device_span output, cugraph_type_erased_device_array_view_t const* input, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); template CUGRAPH_EXPORT void copy_or_transform(raft::device_span output, cugraph_type_erased_device_array_view_t const* input, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); template CUGRAPH_EXPORT void copy_or_transform(raft::device_span output, cugraph_type_erased_device_array_view_t const* input, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); template CUGRAPH_EXPORT void copy_or_transform(raft::device_span output, cugraph_type_erased_device_array_view_t const* input, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); template CUGRAPH_EXPORT void copy_or_transform(raft::device_span output, cugraph_type_erased_device_array_view_t const* input, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); template CUGRAPH_EXPORT void copy_or_transform(raft::device_span output, cugraph_type_erased_device_array_view_t const* input, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); template CUGRAPH_EXPORT edge_property_t create_constant_edge_property( raft::handle_t const& handle, diff --git a/cpp/src/converters/legacy/COOtoCSR.cuh b/cpp/src/converters/legacy/COOtoCSR.cuh index d0f7ad0345e..4bcf3fec5ec 100644 --- a/cpp/src/converters/legacy/COOtoCSR.cuh +++ b/cpp/src/converters/legacy/COOtoCSR.cuh @@ -56,7 +56,7 @@ namespace detail { * @param[out] result Total number of vertices */ template -VT sort(legacy::GraphCOOView& graph, rmm::cuda_stream_view stream_view) +VT sort(legacy::GraphCOOView& graph, cuda::stream_ref stream_view) { VT max_src_id; VT max_dst_id; @@ -92,11 +92,8 @@ VT sort(legacy::GraphCOOView& graph, rmm::cuda_stream_view stream_vi } template -void fill_offset(VT* source, - ET* offsets, - VT number_of_vertices, - ET number_of_edges, - rmm::cuda_stream_view stream_view) +void fill_offset( + VT* source, ET* offsets, VT number_of_vertices, ET number_of_edges, cuda::stream_ref stream_view) { cugraph::fill( rmm::exec_policy(stream_view), offsets, offsets + number_of_vertices + 1, number_of_edges); @@ -120,7 +117,7 @@ template rmm::device_buffer create_offset(VT* source, VT number_of_vertices, ET number_of_edges, - rmm::cuda_stream_view stream_view, + cuda::stream_ref stream_view, rmm::device_async_resource_ref mr) { // Offset array needs an extra element at the end to contain the ending offsets @@ -139,7 +136,7 @@ template std::unique_ptr> coo_to_csr( legacy::GraphCOOView const& graph, rmm::device_async_resource_ref mr) { - rmm::cuda_stream_view stream_view; + cuda::stream_ref stream_view; legacy::GraphCOO temp_graph(graph, stream_view.get(), mr); legacy::GraphCOOView temp_graph_view = temp_graph.view(); diff --git a/cpp/src/detail/utility_wrappers_32_common.cu b/cpp/src/detail/utility_wrappers_32_common.cu index ee11f1a9636..ac915dcd132 100644 --- a/cpp/src/detail/utility_wrappers_32_common.cu +++ b/cpp/src/detail/utility_wrappers_32_common.cu @@ -28,14 +28,14 @@ namespace cugraph { namespace detail { -template CUGRAPH_EXPORT void uniform_random_fill(rmm::cuda_stream_view const& stream_view, +template CUGRAPH_EXPORT void uniform_random_fill(cuda::stream_ref const& stream_view, int32_t* d_value, size_t size, int32_t min_value, int32_t max_value, raft::random::RngState& rng_state); -template CUGRAPH_EXPORT void uniform_random_fill(rmm::cuda_stream_view const& stream_view, +template CUGRAPH_EXPORT void uniform_random_fill(cuda::stream_ref const& stream_view, float* d_value, size_t size, float min_value, @@ -44,14 +44,14 @@ template CUGRAPH_EXPORT void uniform_random_fill(rmm::cuda_stream_view const& st template CUGRAPH_EXPORT void transform_increment_ints(raft::device_span values, int32_t value, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); template CUGRAPH_EXPORT void transform_not_equal(raft::device_span values, raft::device_span result, int32_t compare, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); -template CUGRAPH_EXPORT int32_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view, +template CUGRAPH_EXPORT int32_t compute_maximum_vertex_id(cuda::stream_ref const& stream_view, int32_t const* d_edgelist_srcs, int32_t const* d_edgelist_dsts, size_t num_edges); diff --git a/cpp/src/detail/utility_wrappers_64_common.cu b/cpp/src/detail/utility_wrappers_64_common.cu index 621d88ad9a4..a356a6e577e 100644 --- a/cpp/src/detail/utility_wrappers_64_common.cu +++ b/cpp/src/detail/utility_wrappers_64_common.cu @@ -28,14 +28,14 @@ namespace cugraph { namespace detail { -template CUGRAPH_EXPORT void uniform_random_fill(rmm::cuda_stream_view const& stream_view, +template CUGRAPH_EXPORT void uniform_random_fill(cuda::stream_ref const& stream_view, int64_t* d_value, size_t size, int64_t min_value, int64_t max_value, raft::random::RngState& rng_state); -template CUGRAPH_EXPORT void uniform_random_fill(rmm::cuda_stream_view const& stream_view, +template CUGRAPH_EXPORT void uniform_random_fill(cuda::stream_ref const& stream_view, double* d_value, size_t size, double min_value, @@ -44,14 +44,14 @@ template CUGRAPH_EXPORT void uniform_random_fill(rmm::cuda_stream_view const& st template CUGRAPH_EXPORT void transform_increment_ints(raft::device_span values, int64_t value, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); template CUGRAPH_EXPORT void transform_not_equal(raft::device_span values, raft::device_span result, int64_t compare, - rmm::cuda_stream_view const& stream_view); + cuda::stream_ref const& stream_view); -template CUGRAPH_EXPORT int64_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view, +template CUGRAPH_EXPORT int64_t compute_maximum_vertex_id(cuda::stream_ref const& stream_view, int64_t const* d_edgelist_srcs, int64_t const* d_edgelist_dsts, size_t num_edges); diff --git a/cpp/src/detail/utility_wrappers_impl.cuh b/cpp/src/detail/utility_wrappers_impl.cuh index b41e11e01d9..6b43e81fcff 100644 --- a/cpp/src/detail/utility_wrappers_impl.cuh +++ b/cpp/src/detail/utility_wrappers_impl.cuh @@ -29,7 +29,7 @@ namespace cugraph { namespace detail { template -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, @@ -48,7 +48,7 @@ void uniform_random_fill(rmm::cuda_stream_view const& stream_view, template void transform_increment_ints(raft::device_span values, value_t incr, - rmm::cuda_stream_view const& stream_view) + cuda::stream_ref const& stream_view) { thrust::transform(rmm::exec_policy(stream_view), values.begin(), @@ -63,7 +63,7 @@ template void transform_not_equal(raft::device_span values, raft::device_span result, value_t compare, - rmm::cuda_stream_view const& stream_view) + cuda::stream_ref const& stream_view) { thrust::transform(rmm::exec_policy(stream_view), values.begin(), @@ -74,7 +74,7 @@ void transform_not_equal(raft::device_span values, } template -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) diff --git a/cpp/src/layout/legacy/barnes_hut.cuh b/cpp/src/layout/legacy/barnes_hut.cuh index 669cc3b13a7..de306126348 100644 --- a/cpp/src/layout/legacy/barnes_hut.cuh +++ b/cpp/src/layout/legacy/barnes_hut.cuh @@ -50,7 +50,7 @@ void barnes_hut(raft::handle_t const& handle, bool verbose = false, internals::GraphBasedDimRedCallback* callback = nullptr) { - rmm::cuda_stream_view stream_view(handle.get_stream()); + cuda::stream_ref stream_view(handle.get_stream()); const edge_t e = graph.number_of_edges; const vertex_t n = graph.number_of_vertices; diff --git a/cpp/src/structure/coarsen_graph_impl.cuh b/cpp/src/structure/coarsen_graph_impl.cuh index ad6cfe60d13..7e77b1be5c9 100644 --- a/cpp/src/structure/coarsen_graph_impl.cuh +++ b/cpp/src/structure/coarsen_graph_impl.cuh @@ -74,7 +74,7 @@ std::tuple, groupby_e_and_coarsen_edgelist(rmm::device_uvector&& edgelist_majors, rmm::device_uvector&& edgelist_minors, std::optional>&& edgelist_weights, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { auto pair_first = thrust::make_zip_iterator(edgelist_majors.begin(), edgelist_minors.begin()); diff --git a/cpp/src/structure/edge_partition_device_view_impl.cuh b/cpp/src/structure/edge_partition_device_view_impl.cuh index 0d473d2a32c..2f91a3da814 100644 --- a/cpp/src/structure/edge_partition_device_view_impl.cuh +++ b/cpp/src/structure/edge_partition_device_view_impl.cuh @@ -29,7 +29,7 @@ __host__ void compute_number_of_edges_with_mask_async_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { compute_number_of_edges_with_mask_async_mg(edge_mask, majors.begin(), @@ -51,7 +51,7 @@ __host__ void compute_number_of_edges_with_mask_async_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { compute_number_of_edges_with_mask_async_mg( edge_mask, @@ -74,7 +74,7 @@ __host__ void compute_number_of_edges_with_mask_async_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { auto major_first = cuda::make_transform_iterator(majors.offsets.data(), shift_right_t{majors.base_major}); @@ -97,7 +97,7 @@ __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { return compute_local_degrees_with_mask_mg(edge_mask, majors.begin(), @@ -117,7 +117,7 @@ __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { return compute_local_degrees_with_mask_mg( edge_mask, @@ -140,7 +140,7 @@ __host__ void compute_number_of_edges_with_mask_async_sg( raft::device_span majors, raft::device_span count, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { compute_number_of_edges_with_mask_async_sg( edge_mask, majors.begin(), majors.end(), count, offsets, stream); @@ -152,7 +152,7 @@ __host__ void compute_number_of_edges_with_mask_async_sg( std::tuple vertex_partition_range, raft::device_span count, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { compute_number_of_edges_with_mask_async_sg( edge_mask, @@ -168,7 +168,7 @@ __host__ rmm::device_uvector compute_local_degrees_with_mask_sg( cuda::std::optional edge_mask, raft::device_span majors, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { return compute_local_degrees_with_mask_sg( edge_mask, majors.begin(), majors.end(), offsets, stream); @@ -179,7 +179,7 @@ __host__ rmm::device_uvector compute_local_degrees_with_mask_sg( cuda::std::optional edge_mask, std::tuple vertex_partition_range, raft::device_span offsets, - rmm::cuda_stream_view stream) + cuda::stream_ref stream) { return compute_local_degrees_with_mask_sg( edge_mask, diff --git a/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v32_e32.cu b/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v32_e32.cu index d931e1040ee..59d95f2654c 100644 --- a/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v32_e32.cu +++ b/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v32_e32.cu @@ -25,7 +25,7 @@ template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degre cuda::std::optional edge_mask, raft::device_span majors, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( cuda::std::optional edge_mask, @@ -34,14 +34,14 @@ template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degre vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_sg( cuda::std::optional edge_mask, raft::device_span majors, raft::device_span count, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg( cuda::std::optional edge_mask, @@ -51,7 +51,7 @@ template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace detail } // namespace cugraph diff --git a/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v64_e64.cu b/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v64_e64.cu index 212c9d5ba43..5f4a50d949c 100644 --- a/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v64_e64.cu +++ b/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v64_e64.cu @@ -25,7 +25,7 @@ template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degre cuda::std::optional edge_mask, raft::device_span majors, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( cuda::std::optional edge_mask, @@ -34,14 +34,14 @@ template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degre vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_sg( cuda::std::optional edge_mask, raft::device_span majors, raft::device_span count, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg( cuda::std::optional edge_mask, @@ -51,7 +51,7 @@ template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace detail } // namespace cugraph diff --git a/cpp/src/structure/edge_partition_device_view_mg_v32_e32.cu b/cpp/src/structure/edge_partition_device_view_mg_v32_e32.cu index 43a980a03ed..c2e2fd38055 100644 --- a/cpp/src/structure/edge_partition_device_view_mg_v32_e32.cu +++ b/cpp/src/structure/edge_partition_device_view_mg_v32_e32.cu @@ -21,7 +21,7 @@ template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degre vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( cuda::std::optional edge_mask, @@ -30,7 +30,7 @@ template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degre vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg( cuda::std::optional edge_mask, @@ -40,7 +40,7 @@ template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg( cuda::std::optional edge_mask, @@ -50,7 +50,7 @@ template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg( cuda::std::optional edge_mask, @@ -60,7 +60,7 @@ template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace detail } // namespace cugraph diff --git a/cpp/src/structure/edge_partition_device_view_mg_v64_e64.cu b/cpp/src/structure/edge_partition_device_view_mg_v64_e64.cu index efb6bfa4351..ad23f5afb8e 100644 --- a/cpp/src/structure/edge_partition_device_view_mg_v64_e64.cu +++ b/cpp/src/structure/edge_partition_device_view_mg_v64_e64.cu @@ -22,7 +22,7 @@ template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg( cuda::std::optional edge_mask, @@ -32,7 +32,7 @@ template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( cuda::std::optional edge_mask, @@ -41,7 +41,7 @@ template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degre vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degrees_with_mask_mg( cuda::std::optional edge_mask, @@ -50,7 +50,7 @@ template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degre vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg( cuda::std::optional edge_mask, @@ -60,7 +60,7 @@ template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_mg vertex_t major_range_first, cuda::std::optional major_hypersparse_first, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace detail } // namespace cugraph diff --git a/cpp/src/structure/edge_partition_device_view_sg_v32_e32.cu b/cpp/src/structure/edge_partition_device_view_sg_v32_e32.cu index 8046e4b14fd..a7706b7dbb6 100644 --- a/cpp/src/structure/edge_partition_device_view_sg_v32_e32.cu +++ b/cpp/src/structure/edge_partition_device_view_sg_v32_e32.cu @@ -19,26 +19,26 @@ template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_sg raft::device_span majors, raft::device_span count, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_sg( cuda::std::optional edge_mask, std::tuple vertex_partition_range, raft::device_span count, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degrees_with_mask_sg( cuda::std::optional edge_mask, raft::device_span majors, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degrees_with_mask_sg( cuda::std::optional edge_mask, std::tuple vertex_partition_range, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace detail } // namespace cugraph diff --git a/cpp/src/structure/edge_partition_device_view_sg_v64_e64.cu b/cpp/src/structure/edge_partition_device_view_sg_v64_e64.cu index 9f8e41d38d9..bcd87a8f45a 100644 --- a/cpp/src/structure/edge_partition_device_view_sg_v64_e64.cu +++ b/cpp/src/structure/edge_partition_device_view_sg_v64_e64.cu @@ -19,26 +19,26 @@ template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_sg raft::device_span majors, raft::device_span count, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ void compute_number_of_edges_with_mask_async_sg( cuda::std::optional edge_mask, std::tuple vertex_partition_range, raft::device_span count, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degrees_with_mask_sg( cuda::std::optional edge_mask, raft::device_span majors, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); template CUGRAPH_EXPORT __host__ rmm::device_uvector compute_local_degrees_with_mask_sg( cuda::std::optional edge_mask, std::tuple vertex_partition_range, raft::device_span offsets, - rmm::cuda_stream_view stream); + cuda::stream_ref stream); } // namespace detail } // namespace cugraph diff --git a/cpp/src/structure/legacy/graph.cu b/cpp/src/structure/legacy/graph.cu index f0b03d5541a..84efcd7e7ad 100644 --- a/cpp/src/structure/legacy/graph.cu +++ b/cpp/src/structure/legacy/graph.cu @@ -26,7 +26,7 @@ template void degree_from_offsets(vertex_t number_of_vertices, edge_t const* offsets, edge_t* degree, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { // Computes out-degree for x = 0 and x = 2 thrust::for_each( @@ -42,7 +42,7 @@ void degree_from_vertex_ids(const raft::handle_t* handle, edge_t number_of_edges, vertex_t const* indices, edge_t* degree, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { thrust::for_each( rmm::exec_policy(stream_view), @@ -75,7 +75,7 @@ template void GraphCompressedSparseBaseView::get_source_indices(VT* src_indices) const { CUGRAPH_EXPECTS(offsets != nullptr, "No graph specified"); - rmm::cuda_stream_view stream_view; + cuda::stream_ref stream_view; raft::device_span indices_span(src_indices, GraphViewBase::number_of_edges); @@ -145,7 +145,7 @@ void GraphCompressedSparseBaseView::degree(ET* degree, DegreeDirecti // (e.g. if you have a CSC and you want in-degree (x=1) then pass // the offsets/indices and request an out-degree (x=2)) // - rmm::cuda_stream_view stream_view; + cuda::stream_ref stream_view; if (direction != DegreeDirection::IN) { if ((GraphViewBase::handle != nullptr) && diff --git a/cpp/src/utilities/partition_scatter_map_wrappers.cu b/cpp/src/utilities/partition_scatter_map_wrappers.cu index 60420546d1b..2954bd73687 100644 --- a/cpp/src/utilities/partition_scatter_map_wrappers.cu +++ b/cpp/src/utilities/partition_scatter_map_wrappers.cu @@ -28,7 +28,7 @@ rmm::device_uvector compute_partition_scatter_map_impl( offset_t const* intra_partition_displs, size_t const* group_displacements, size_t num_elements, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { rmm::device_uvector scatter_map(num_elements, stream_view); thrust::transform( @@ -51,7 +51,7 @@ rmm::device_uvector compute_partition_scatter_map_impl( offset_t const* intra_partition_displs, \ size_t const* group_displacements, \ size_t num_elements, \ - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) CUGRAPH_PARTITION_SCATTER_MAP_INST(std::uint8_t, std::uint32_t); CUGRAPH_PARTITION_SCATTER_MAP_INST(int, std::size_t); diff --git a/cpp/src/utilities/permute_wrappers.cu b/cpp/src/utilities/permute_wrappers.cu index 436ae7edf6b..44883929b99 100644 --- a/cpp/src/utilities/permute_wrappers.cu +++ b/cpp/src/utilities/permute_wrappers.cu @@ -24,7 +24,7 @@ template void permute_in_place_impl(T* first, std::size_t const* map_first, std::size_t num_elements, - rmm::cuda_stream_view stream_view) + cuda::stream_ref stream_view) { auto const policy = rmm::exec_policy(stream_view); rmm::device_uvector tmp(num_elements, stream_view); @@ -32,12 +32,11 @@ void permute_in_place_impl(T* first, thrust::copy(policy, tmp.begin(), tmp.end(), first); } -#define CUGRAPH_PERMUTE_IN_PLACE_SCALAR_INST(ScalarType) \ - template CUGRAPH_EXPORT void permute_in_place_impl( \ - ScalarType * first, \ - std::size_t const* map_first, \ - std::size_t num_elements, \ - rmm::cuda_stream_view stream_view) +#define CUGRAPH_PERMUTE_IN_PLACE_SCALAR_INST(ScalarType) \ + template CUGRAPH_EXPORT void permute_in_place_impl(ScalarType * first, \ + std::size_t const* map_first, \ + std::size_t num_elements, \ + cuda::stream_ref stream_view) CUGRAPH_PERMUTE_IN_PLACE_SCALAR_INST(std::int32_t); CUGRAPH_PERMUTE_IN_PLACE_SCALAR_INST(std::int64_t); diff --git a/cpp/tests/prims/mg_per_v_transform_reduce_dst_key_aggregated_outgoing_e.cu b/cpp/tests/prims/mg_per_v_transform_reduce_dst_key_aggregated_outgoing_e.cu index c8344afbbeb..363791284cf 100644 --- a/cpp/tests/prims/mg_per_v_transform_reduce_dst_key_aggregated_outgoing_e.cu +++ b/cpp/tests/prims/mg_per_v_transform_reduce_dst_key_aggregated_outgoing_e.cu @@ -174,7 +174,7 @@ class Tests_MGPerVTransformReduceDstKeyAggregatedOutgoingE std::array reduction_types = { reduction_type_t::PLUS, reduction_type_t::ELEMWISE_MIN, reduction_type_t::ELEMWISE_MAX}; - std::vector(0, rmm::cuda_stream_view{}))> + std::vector(0, cuda::stream_ref{}))> mg_results{}; mg_results.reserve(reduction_types.size()); diff --git a/cpp/tests/prims/mg_per_v_transform_reduce_incoming_outgoing_e.cu b/cpp/tests/prims/mg_per_v_transform_reduce_incoming_outgoing_e.cu index b71cfe453af..5cdbf117f0b 100644 --- a/cpp/tests/prims/mg_per_v_transform_reduce_incoming_outgoing_e.cu +++ b/cpp/tests/prims/mg_per_v_transform_reduce_incoming_outgoing_e.cu @@ -141,9 +141,9 @@ class Tests_MGPerVTransformReduceIncomingOutgoingE std::array reduction_types = { reduction_type_t::PLUS, reduction_type_t::ELEMWISE_MIN, reduction_type_t::ELEMWISE_MAX}; - std::vector(0, rmm::cuda_stream_view{}))> + std::vector(0, cuda::stream_ref{}))> mg_in_results{}; - std::vector(0, rmm::cuda_stream_view{}))> + std::vector(0, cuda::stream_ref{}))> mg_out_results{}; mg_in_results.reserve(reduction_types.size()); mg_out_results.reserve(reduction_types.size()); diff --git a/cpp/tests/utilities/mg_utilities.cpp b/cpp/tests/utilities/mg_utilities.cpp index 048c18d2698..8e7c00434da 100644 --- a/cpp/tests/utilities/mg_utilities.cpp +++ b/cpp/tests/utilities/mg_utilities.cpp @@ -56,7 +56,7 @@ std::unique_ptr initialize_mg_handle(size_t pool_size) return std::move(handle); } -void enforce_p2p_initialization(raft::comms::comms_t const& comm, rmm::cuda_stream_view stream) +void enforce_p2p_initialization(raft::comms::comms_t const& comm, cuda::stream_ref stream) { auto const comm_size = comm.get_size(); diff --git a/cpp/tests/utilities/mg_utilities.hpp b/cpp/tests/utilities/mg_utilities.hpp index 63fe4a8390c..647bbc72667 100644 --- a/cpp/tests/utilities/mg_utilities.hpp +++ b/cpp/tests/utilities/mg_utilities.hpp @@ -23,7 +23,7 @@ std::unique_ptr initialize_mg_handle( // NCCL lazily initializes for P2P, and this enforces P2P initialization for better performance // measurements -void enforce_p2p_initialization(raft::comms::comms_t const& comm, rmm::cuda_stream_view stream); +void enforce_p2p_initialization(raft::comms::comms_t const& comm, cuda::stream_ref stream); } // namespace test } // namespace cugraph diff --git a/cpp/tests/utilities/property_generator_utilities.hpp b/cpp/tests/utilities/property_generator_utilities.hpp index f6f51fa88b2..77bcacc2070 100644 --- a/cpp/tests/utilities/property_generator_utilities.hpp +++ b/cpp/tests/utilities/property_generator_utilities.hpp @@ -27,8 +27,8 @@ struct generate { using edge_type = typename GraphViewType::edge_type; using edge_type_t = int32_t; - using property_buffer_type = std::decay_t( - size_t{0}, rmm::cuda_stream_view{}))>; + using property_buffer_type = + std::decay_t(size_t{0}, cuda::stream_ref{}))>; public: static property_t initial_value(int32_t init); From 6a56a562d55f285d7f7a0b6825605e25dcc492c9 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 2 Sep 2026 16:40:16 -0500 Subject: [PATCH 03/10] Replace RMM stream constants with CUDA stream references Signed-off-by: Bradley Dice --- cpp/docs/DEVELOPER_GUIDE.md | 2 +- cpp/include/cugraph/dendrogram.hpp | 4 +++- cpp/include/cugraph/detail/utility_wrappers.hpp | 4 +++- cpp/include/cugraph/dynamic/memory_manager/block_array.hpp | 5 ++--- .../cugraph/dynamic/memory_manager/block_array_manager.hpp | 4 ++-- cpp/include/cugraph/edge_partition_device_view.cuh | 2 +- cpp/include/cugraph/edge_src_dst_property.hpp | 3 ++- cpp/include/cugraph/host_staging_buffer_manager.hpp | 5 +++-- cpp/include/cugraph/large_buffer_manager.hpp | 5 +++-- cpp/include/cugraph/mtmg/detail/per_device_edgelist.hpp | 2 ++ cpp/include/cugraph/mtmg/per_thread_edgelist.hpp | 2 ++ cpp/include/cugraph/prims/detail/multi_stream_utils.cuh | 2 +- .../cugraph/prims/detail/optional_dataframe_buffer.hpp | 4 +++- cpp/include/cugraph/prims/key_store.cuh | 1 + cpp/include/cugraph/prims/kv_store.cuh | 1 + .../prims/per_v_pair_transform_src_dst_nbr_intersection.cuh | 1 + cpp/include/cugraph/prims/vertex_frontier.cuh | 1 + cpp/include/cugraph/utilities/collect_comm.cuh | 3 ++- cpp/include/cugraph/utilities/dataframe_buffer.hpp | 4 ++-- cpp/include/cugraph/utilities/device_comm.hpp | 2 +- cpp/include/cugraph/utilities/groupby_and_count.cuh | 3 ++- cpp/include/cugraph/utilities/mask_utils.cuh | 1 + cpp/include/cugraph/utilities/mem_frugal_partition.cuh | 3 ++- cpp/include/cugraph/utilities/misc_utils.cuh | 3 ++- .../cugraph/utilities/partition_scatter_map_wrappers.cuh | 5 +++-- cpp/include/cugraph/utilities/permute_wrappers.cuh | 4 ++-- cpp/include/cugraph/utilities/shuffle_comm.cuh | 1 + cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh | 2 +- cpp/src/c_api/array.hpp | 4 +++- cpp/src/c_api/graph_helper.hpp | 2 ++ cpp/src/c_api/graph_helper_impl.cuh | 1 + cpp/src/c_api/graph_helper_sg.cu | 2 ++ cpp/src/community/egonet_impl.cuh | 1 - cpp/src/converters/legacy/COOtoCSR.cuh | 1 + cpp/src/detail/utility_wrappers_32_common.cu | 3 ++- cpp/src/detail/utility_wrappers_64_common.cu | 3 ++- cpp/src/detail/utility_wrappers_impl.cuh | 1 + cpp/src/layout/legacy/barnes_hut.cuh | 1 + cpp/src/structure/coarsen_graph_impl.cuh | 3 ++- cpp/src/structure/edge_partition_device_view_impl.cuh | 4 ++-- ...edge_partition_device_view_mask_degrees_common_v32_e32.cu | 2 ++ ...edge_partition_device_view_mask_degrees_common_v64_e64.cu | 2 ++ cpp/src/structure/edge_partition_device_view_mg_v32_e32.cu | 4 +++- cpp/src/structure/edge_partition_device_view_mg_v64_e64.cu | 4 +++- cpp/src/structure/edge_partition_device_view_sg_v32_e32.cu | 4 +++- cpp/src/structure/edge_partition_device_view_sg_v64_e64.cu | 4 +++- cpp/src/structure/legacy/graph.cu | 1 + cpp/src/utilities/partition_scatter_map_wrappers.cu | 3 ++- cpp/src/utilities/permute_wrappers.cu | 3 ++- ...g_per_v_transform_reduce_dst_key_aggregated_outgoing_e.cu | 3 ++- .../prims/mg_per_v_transform_reduce_incoming_outgoing_e.cu | 3 ++- cpp/tests/utilities/mg_utilities.hpp | 4 +++- cpp/tests/utilities/property_generator_utilities.hpp | 4 +++- 53 files changed, 101 insertions(+), 45 deletions(-) diff --git a/cpp/docs/DEVELOPER_GUIDE.md b/cpp/docs/DEVELOPER_GUIDE.md index 50d4bc63e9f..91275558ade 100644 --- a/cpp/docs/DEVELOPER_GUIDE.md +++ b/cpp/docs/DEVELOPER_GUIDE.md @@ -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 diff --git a/cpp/include/cugraph/dendrogram.hpp b/cpp/include/cugraph/dendrogram.hpp index 364e3755007..8c0cbea3542 100644 --- a/cpp/include/cugraph/dendrogram.hpp +++ b/cpp/include/cugraph/dendrogram.hpp @@ -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 @@ -9,6 +9,8 @@ #include #include +#include + #include #include diff --git a/cpp/include/cugraph/detail/utility_wrappers.hpp b/cpp/include/cugraph/detail/utility_wrappers.hpp index 062974dd42b..75a152eaa78 100644 --- a/cpp/include/cugraph/detail/utility_wrappers.hpp +++ b/cpp/include/cugraph/detail/utility_wrappers.hpp @@ -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 @@ -12,6 +12,8 @@ #include +#include + namespace CUGRAPH_EXPORT cugraph { namespace detail { diff --git a/cpp/include/cugraph/dynamic/memory_manager/block_array.hpp b/cpp/include/cugraph/dynamic/memory_manager/block_array.hpp index c2172340beb..3cbfc4883f0 100644 --- a/cpp/include/cugraph/dynamic/memory_manager/block_array.hpp +++ b/cpp/include/cugraph/dynamic/memory_manager/block_array.hpp @@ -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 @@ -8,9 +8,8 @@ #include #include -#include - #include +#include #include #include diff --git a/cpp/include/cugraph/dynamic/memory_manager/block_array_manager.hpp b/cpp/include/cugraph/dynamic/memory_manager/block_array_manager.hpp index 015beaaf24c..5d616e27f10 100644 --- a/cpp/include/cugraph/dynamic/memory_manager/block_array_manager.hpp +++ b/cpp/include/cugraph/dynamic/memory_manager/block_array_manager.hpp @@ -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 -#include +#include #include #include diff --git a/cpp/include/cugraph/edge_partition_device_view.cuh b/cpp/include/cugraph/edge_partition_device_view.cuh index 878e1dfcbf6..7f8759a0739 100644 --- a/cpp/include/cugraph/edge_partition_device_view.cuh +++ b/cpp/include/cugraph/edge_partition_device_view.cuh @@ -14,7 +14,6 @@ #include -#include #include #include #include @@ -23,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/include/cugraph/edge_src_dst_property.hpp b/cpp/include/cugraph/edge_src_dst_property.hpp index cb9884a6881..e36c6adca57 100644 --- a/cpp/include/cugraph/edge_src_dst_property.hpp +++ b/cpp/include/cugraph/edge_src_dst_property.hpp @@ -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 */ @@ -17,6 +17,7 @@ #include #include +#include #include #include diff --git a/cpp/include/cugraph/host_staging_buffer_manager.hpp b/cpp/include/cugraph/host_staging_buffer_manager.hpp index f13e534221e..03f4ff71b37 100644 --- a/cpp/include/cugraph/host_staging_buffer_manager.hpp +++ b/cpp/include/cugraph/host_staging_buffer_manager.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -9,11 +9,12 @@ #include -#include #include #include #include +#include + #include #include diff --git a/cpp/include/cugraph/large_buffer_manager.hpp b/cpp/include/cugraph/large_buffer_manager.hpp index ad564acdaf7..6d53639d1fc 100644 --- a/cpp/include/cugraph/large_buffer_manager.hpp +++ b/cpp/include/cugraph/large_buffer_manager.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -10,11 +10,12 @@ #include -#include #include #include #include +#include + #include namespace CUGRAPH_EXPORT cugraph { diff --git a/cpp/include/cugraph/mtmg/detail/per_device_edgelist.hpp b/cpp/include/cugraph/mtmg/detail/per_device_edgelist.hpp index c73ff7e9875..ddbd7e87dec 100644 --- a/cpp/include/cugraph/mtmg/detail/per_device_edgelist.hpp +++ b/cpp/include/cugraph/mtmg/detail/per_device_edgelist.hpp @@ -15,6 +15,8 @@ #include +#include + namespace CUGRAPH_EXPORT cugraph { namespace mtmg { diff --git a/cpp/include/cugraph/mtmg/per_thread_edgelist.hpp b/cpp/include/cugraph/mtmg/per_thread_edgelist.hpp index 24fe57cad76..b214dd682a4 100644 --- a/cpp/include/cugraph/mtmg/per_thread_edgelist.hpp +++ b/cpp/include/cugraph/mtmg/per_thread_edgelist.hpp @@ -9,6 +9,8 @@ #include #include +#include + namespace CUGRAPH_EXPORT cugraph { namespace mtmg { diff --git a/cpp/include/cugraph/prims/detail/multi_stream_utils.cuh b/cpp/include/cugraph/prims/detail/multi_stream_utils.cuh index 6f4c41e1b8a..b16d9b489ad 100644 --- a/cpp/include/cugraph/prims/detail/multi_stream_utils.cuh +++ b/cpp/include/cugraph/prims/detail/multi_stream_utils.cuh @@ -10,12 +10,12 @@ #include #include -#include #include #include #include #include +#include #include #include diff --git a/cpp/include/cugraph/prims/detail/optional_dataframe_buffer.hpp b/cpp/include/cugraph/prims/detail/optional_dataframe_buffer.hpp index c6c672f0d0c..65199330c45 100644 --- a/cpp/include/cugraph/prims/detail/optional_dataframe_buffer.hpp +++ b/cpp/include/cugraph/prims/detail/optional_dataframe_buffer.hpp @@ -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 @@ -7,6 +7,8 @@ #include #include +#include + #include namespace CUGRAPH_EXPORT cugraph { diff --git a/cpp/include/cugraph/prims/key_store.cuh b/cpp/include/cugraph/prims/key_store.cuh index bc6838fad7e..c0b0fcb5574 100644 --- a/cpp/include/cugraph/prims/key_store.cuh +++ b/cpp/include/cugraph/prims/key_store.cuh @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/include/cugraph/prims/kv_store.cuh b/cpp/include/cugraph/prims/kv_store.cuh index fa1e8ca74ee..c3d4e1e0cf5 100644 --- a/cpp/include/cugraph/prims/kv_store.cuh +++ b/cpp/include/cugraph/prims/kv_store.cuh @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh b/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh index 8e3c2986023..ccd5ce7867b 100644 --- a/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh +++ b/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/include/cugraph/prims/vertex_frontier.cuh b/cpp/include/cugraph/prims/vertex_frontier.cuh index 43e6ceccf13..0e74743ca56 100644 --- a/cpp/include/cugraph/prims/vertex_frontier.cuh +++ b/cpp/include/cugraph/prims/vertex_frontier.cuh @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/include/cugraph/utilities/collect_comm.cuh b/cpp/include/cugraph/utilities/collect_comm.cuh index 950780c45ea..d06a33364b2 100644 --- a/cpp/include/cugraph/utilities/collect_comm.cuh +++ b/cpp/include/cugraph/utilities/collect_comm.cuh @@ -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 @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/cpp/include/cugraph/utilities/dataframe_buffer.hpp b/cpp/include/cugraph/utilities/dataframe_buffer.hpp index 503ea5e0d90..c061210d99b 100644 --- a/cpp/include/cugraph/utilities/dataframe_buffer.hpp +++ b/cpp/include/cugraph/utilities/dataframe_buffer.hpp @@ -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 @@ -9,10 +9,10 @@ #include -#include #include #include +#include #include #include diff --git a/cpp/include/cugraph/utilities/device_comm.hpp b/cpp/include/cugraph/utilities/device_comm.hpp index 0b48ef67120..02351ef9559 100644 --- a/cpp/include/cugraph/utilities/device_comm.hpp +++ b/cpp/include/cugraph/utilities/device_comm.hpp @@ -11,10 +11,10 @@ #include #include -#include #include #include +#include #include #include diff --git a/cpp/include/cugraph/utilities/groupby_and_count.cuh b/cpp/include/cugraph/utilities/groupby_and_count.cuh index 6482621aee9..169fadc4cd6 100644 --- a/cpp/include/cugraph/utilities/groupby_and_count.cuh +++ b/cpp/include/cugraph/utilities/groupby_and_count.cuh @@ -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 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/include/cugraph/utilities/mask_utils.cuh b/cpp/include/cugraph/utilities/mask_utils.cuh index 028e1ce8c54..432fde29afd 100644 --- a/cpp/include/cugraph/utilities/mask_utils.cuh +++ b/cpp/include/cugraph/utilities/mask_utils.cuh @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/include/cugraph/utilities/mem_frugal_partition.cuh b/cpp/include/cugraph/utilities/mem_frugal_partition.cuh index 74741a77ba5..b657fcecbdb 100644 --- a/cpp/include/cugraph/utilities/mem_frugal_partition.cuh +++ b/cpp/include/cugraph/utilities/mem_frugal_partition.cuh @@ -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 @@ -12,6 +12,7 @@ #include #include +#include namespace CUGRAPH_EXPORT cugraph { diff --git a/cpp/include/cugraph/utilities/misc_utils.cuh b/cpp/include/cugraph/utilities/misc_utils.cuh index 58b9d8bd2ac..06b76f5cb79 100644 --- a/cpp/include/cugraph/utilities/misc_utils.cuh +++ b/cpp/include/cugraph/utilities/misc_utils.cuh @@ -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 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/include/cugraph/utilities/partition_scatter_map_wrappers.cuh b/cpp/include/cugraph/utilities/partition_scatter_map_wrappers.cuh index 1b2484c1eee..8c5db5d26f4 100644 --- a/cpp/include/cugraph/utilities/partition_scatter_map_wrappers.cuh +++ b/cpp/include/cugraph/utilities/partition_scatter_map_wrappers.cuh @@ -1,14 +1,15 @@ /* - * 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 -#include #include +#include + #include #include #include diff --git a/cpp/include/cugraph/utilities/permute_wrappers.cuh b/cpp/include/cugraph/utilities/permute_wrappers.cuh index 5b9724dd247..d402eb1d7aa 100644 --- a/cpp/include/cugraph/utilities/permute_wrappers.cuh +++ b/cpp/include/cugraph/utilities/permute_wrappers.cuh @@ -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 @@ -9,10 +9,10 @@ #include #include -#include #include #include +#include #include #include diff --git a/cpp/include/cugraph/utilities/shuffle_comm.cuh b/cpp/include/cugraph/utilities/shuffle_comm.cuh index 9b61fa6f10e..28c7996dd4d 100644 --- a/cpp/include/cugraph/utilities/shuffle_comm.cuh +++ b/cpp/include/cugraph/utilities/shuffle_comm.cuh @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh index f38141b2fdb..d2e8097373b 100644 --- a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh +++ b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh @@ -13,12 +13,12 @@ #include #include -#include #include #include #include #include +#include #include #include diff --git a/cpp/src/c_api/array.hpp b/cpp/src/c_api/array.hpp index e678c7770f1..a2e1f269207 100644 --- a/cpp/src/c_api/array.hpp +++ b/cpp/src/c_api/array.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -9,6 +9,8 @@ #include #include +#include + #include namespace cugraph { diff --git a/cpp/src/c_api/graph_helper.hpp b/cpp/src/c_api/graph_helper.hpp index 19b83e0ff29..4e9ee29ed1a 100644 --- a/cpp/src/c_api/graph_helper.hpp +++ b/cpp/src/c_api/graph_helper.hpp @@ -7,6 +7,8 @@ #include +#include + namespace cugraph { namespace c_api { diff --git a/cpp/src/c_api/graph_helper_impl.cuh b/cpp/src/c_api/graph_helper_impl.cuh index 22f25412c2d..d4923e58add 100644 --- a/cpp/src/c_api/graph_helper_impl.cuh +++ b/cpp/src/c_api/graph_helper_impl.cuh @@ -10,6 +10,7 @@ #include #include +#include namespace cugraph { namespace c_api { diff --git a/cpp/src/c_api/graph_helper_sg.cu b/cpp/src/c_api/graph_helper_sg.cu index 9e52780adb9..948d6ce876d 100644 --- a/cpp/src/c_api/graph_helper_sg.cu +++ b/cpp/src/c_api/graph_helper_sg.cu @@ -7,6 +7,8 @@ #include +#include + namespace cugraph { namespace c_api { diff --git a/cpp/src/community/egonet_impl.cuh b/cpp/src/community/egonet_impl.cuh index 3cc1c3eaf74..bc33adc845c 100644 --- a/cpp/src/community/egonet_impl.cuh +++ b/cpp/src/community/egonet_impl.cuh @@ -17,7 +17,6 @@ #endif #include -#include #include #include diff --git a/cpp/src/converters/legacy/COOtoCSR.cuh b/cpp/src/converters/legacy/COOtoCSR.cuh index 4bcf3fec5ec..b82c440e643 100644 --- a/cpp/src/converters/legacy/COOtoCSR.cuh +++ b/cpp/src/converters/legacy/COOtoCSR.cuh @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/src/detail/utility_wrappers_32_common.cu b/cpp/src/detail/utility_wrappers_32_common.cu index ac915dcd132..e43ccbfb9a3 100644 --- a/cpp/src/detail/utility_wrappers_32_common.cu +++ b/cpp/src/detail/utility_wrappers_32_common.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 */ @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/src/detail/utility_wrappers_64_common.cu b/cpp/src/detail/utility_wrappers_64_common.cu index a356a6e577e..109a429dd76 100644 --- a/cpp/src/detail/utility_wrappers_64_common.cu +++ b/cpp/src/detail/utility_wrappers_64_common.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 */ @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/src/detail/utility_wrappers_impl.cuh b/cpp/src/detail/utility_wrappers_impl.cuh index 6b43e81fcff..7e6d6274be7 100644 --- a/cpp/src/detail/utility_wrappers_impl.cuh +++ b/cpp/src/detail/utility_wrappers_impl.cuh @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/src/layout/legacy/barnes_hut.cuh b/cpp/src/layout/legacy/barnes_hut.cuh index de306126348..22c46e58e31 100644 --- a/cpp/src/layout/legacy/barnes_hut.cuh +++ b/cpp/src/layout/legacy/barnes_hut.cuh @@ -20,6 +20,7 @@ #include #include +#include #include #include diff --git a/cpp/src/structure/coarsen_graph_impl.cuh b/cpp/src/structure/coarsen_graph_impl.cuh index 7e77b1be5c9..5217a90f0ad 100644 --- a/cpp/src/structure/coarsen_graph_impl.cuh +++ b/cpp/src/structure/coarsen_graph_impl.cuh @@ -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 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/src/structure/edge_partition_device_view_impl.cuh b/cpp/src/structure/edge_partition_device_view_impl.cuh index 2f91a3da814..795a50407d6 100644 --- a/cpp/src/structure/edge_partition_device_view_impl.cuh +++ b/cpp/src/structure/edge_partition_device_view_impl.cuh @@ -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 @@ -8,9 +8,9 @@ #include -#include #include +#include #include namespace cugraph { diff --git a/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v32_e32.cu b/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v32_e32.cu index 59d95f2654c..b1421f95d54 100644 --- a/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v32_e32.cu +++ b/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v32_e32.cu @@ -15,6 +15,8 @@ #include #include +#include + namespace cugraph { namespace detail { diff --git a/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v64_e64.cu b/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v64_e64.cu index 5f4a50d949c..18ba1347578 100644 --- a/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v64_e64.cu +++ b/cpp/src/structure/edge_partition_device_view_mask_degrees_common_v64_e64.cu @@ -15,6 +15,8 @@ #include #include +#include + namespace cugraph { namespace detail { diff --git a/cpp/src/structure/edge_partition_device_view_mg_v32_e32.cu b/cpp/src/structure/edge_partition_device_view_mg_v32_e32.cu index c2e2fd38055..faba5548fcc 100644 --- a/cpp/src/structure/edge_partition_device_view_mg_v32_e32.cu +++ b/cpp/src/structure/edge_partition_device_view_mg_v32_e32.cu @@ -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 */ #include "edge_partition_device_view_impl.cuh" @@ -8,6 +8,8 @@ #include #include +#include + namespace cugraph { namespace detail { diff --git a/cpp/src/structure/edge_partition_device_view_mg_v64_e64.cu b/cpp/src/structure/edge_partition_device_view_mg_v64_e64.cu index ad23f5afb8e..f75b539cc3d 100644 --- a/cpp/src/structure/edge_partition_device_view_mg_v64_e64.cu +++ b/cpp/src/structure/edge_partition_device_view_mg_v64_e64.cu @@ -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 */ #include "edge_partition_device_view_impl.cuh" @@ -8,6 +8,8 @@ #include #include +#include + namespace cugraph { namespace detail { diff --git a/cpp/src/structure/edge_partition_device_view_sg_v32_e32.cu b/cpp/src/structure/edge_partition_device_view_sg_v32_e32.cu index a7706b7dbb6..5524323358a 100644 --- a/cpp/src/structure/edge_partition_device_view_sg_v32_e32.cu +++ b/cpp/src/structure/edge_partition_device_view_sg_v32_e32.cu @@ -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 */ #include "edge_partition_device_view_impl.cuh" @@ -8,6 +8,8 @@ #include #include +#include + namespace cugraph { namespace detail { diff --git a/cpp/src/structure/edge_partition_device_view_sg_v64_e64.cu b/cpp/src/structure/edge_partition_device_view_sg_v64_e64.cu index bcd87a8f45a..a1c51a0ba04 100644 --- a/cpp/src/structure/edge_partition_device_view_sg_v64_e64.cu +++ b/cpp/src/structure/edge_partition_device_view_sg_v64_e64.cu @@ -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 */ #include "edge_partition_device_view_impl.cuh" @@ -8,6 +8,8 @@ #include #include +#include + namespace cugraph { namespace detail { diff --git a/cpp/src/structure/legacy/graph.cu b/cpp/src/structure/legacy/graph.cu index 84efcd7e7ad..c9fc8d2806d 100644 --- a/cpp/src/structure/legacy/graph.cu +++ b/cpp/src/structure/legacy/graph.cu @@ -15,6 +15,7 @@ #include #include +#include #include #include #include diff --git a/cpp/src/utilities/partition_scatter_map_wrappers.cu b/cpp/src/utilities/partition_scatter_map_wrappers.cu index 2954bd73687..b67e57ed3d4 100644 --- a/cpp/src/utilities/partition_scatter_map_wrappers.cu +++ b/cpp/src/utilities/partition_scatter_map_wrappers.cu @@ -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 * * Explicit instantiations for cugraph/utilities/partition_scatter_map_wrappers.cuh. @@ -13,6 +13,7 @@ #include #include +#include #include #include diff --git a/cpp/src/utilities/permute_wrappers.cu b/cpp/src/utilities/permute_wrappers.cu index 44883929b99..3784aa98ec8 100644 --- a/cpp/src/utilities/permute_wrappers.cu +++ b/cpp/src/utilities/permute_wrappers.cu @@ -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 * * Explicit instantiations for cugraph/utilities/permute_wrappers.cuh. @@ -12,6 +12,7 @@ #include #include +#include #include #include diff --git a/cpp/tests/prims/mg_per_v_transform_reduce_dst_key_aggregated_outgoing_e.cu b/cpp/tests/prims/mg_per_v_transform_reduce_dst_key_aggregated_outgoing_e.cu index 363791284cf..aab408ff49c 100644 --- a/cpp/tests/prims/mg_per_v_transform_reduce_dst_key_aggregated_outgoing_e.cu +++ b/cpp/tests/prims/mg_per_v_transform_reduce_dst_key_aggregated_outgoing_e.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 */ @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/tests/prims/mg_per_v_transform_reduce_incoming_outgoing_e.cu b/cpp/tests/prims/mg_per_v_transform_reduce_incoming_outgoing_e.cu index 5cdbf117f0b..57e1fd8c27e 100644 --- a/cpp/tests/prims/mg_per_v_transform_reduce_incoming_outgoing_e.cu +++ b/cpp/tests/prims/mg_per_v_transform_reduce_incoming_outgoing_e.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 */ @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/cpp/tests/utilities/mg_utilities.hpp b/cpp/tests/utilities/mg_utilities.hpp index 647bbc72667..2197fb7147b 100644 --- a/cpp/tests/utilities/mg_utilities.hpp +++ b/cpp/tests/utilities/mg_utilities.hpp @@ -1,11 +1,13 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include +#include + #include namespace cugraph { diff --git a/cpp/tests/utilities/property_generator_utilities.hpp b/cpp/tests/utilities/property_generator_utilities.hpp index 77bcacc2070..244166f81b8 100644 --- a/cpp/tests/utilities/property_generator_utilities.hpp +++ b/cpp/tests/utilities/property_generator_utilities.hpp @@ -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 */ @@ -14,6 +14,8 @@ #include +#include + #include #include From 1f4400078ba8068bcb92d9b4077c82691bb2ab9a Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Sat, 5 Sep 2026 17:25:44 -0500 Subject: [PATCH 04/10] Preserve stream references through conditionals --- cpp/include/cugraph/mtmg/handle.hpp | 2 +- .../extract_transform_if_v_frontier_e.cuh | 22 +++++++-------- .../prims/detail/per_v_transform_reduce_e.cuh | 28 +++++++++---------- .../prims/fill_edge_src_dst_property.cuh | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/cpp/include/cugraph/mtmg/handle.hpp b/cpp/include/cugraph/mtmg/handle.hpp index 0930359845f..fc124dd2d97 100644 --- a/cpp/include/cugraph/mtmg/handle.hpp +++ b/cpp/include/cugraph/mtmg/handle.hpp @@ -57,7 +57,7 @@ class handle_t { { return raft_handle_.is_stream_pool_initialized() ? raft_handle_.get_stream_from_stream_pool(thread_rank_) - : static_cast(raft_handle_.get_stream()); + : raft_handle_.get_stream(); } /** diff --git a/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh b/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh index 79ec2d1f1ad..12fa599a683 100644 --- a/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh +++ b/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh @@ -558,7 +558,7 @@ void extract_transform_if_v_frontier_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[0 % stream_pool_size]) - : static_cast(handle.get_stream()); + : handle.get_stream(); raft::grid_1d_thread_t update_grid((*high_segment_edge_count), extract_transform_if_v_frontier_e_kernel_block_size, @@ -583,7 +583,7 @@ void extract_transform_if_v_frontier_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[1 % stream_pool_size]) - : static_cast(handle.get_stream()); + : handle.get_stream(); raft::grid_1d_warp_t update_grid((*key_segment_offsets)[2] - (*key_segment_offsets)[1], extract_transform_if_v_frontier_e_kernel_block_size, handle.get_device_properties().maxGridSize[0]); @@ -606,7 +606,7 @@ void extract_transform_if_v_frontier_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[2 % stream_pool_size]) - : static_cast(handle.get_stream()); + : handle.get_stream(); raft::grid_1d_thread_t update_grid((*key_segment_offsets)[3] - (*key_segment_offsets)[2], extract_transform_if_v_frontier_e_kernel_block_size, handle.get_device_properties().maxGridSize[0]); @@ -630,7 +630,7 @@ void extract_transform_if_v_frontier_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[3 % stream_pool_size]) - : static_cast(handle.get_stream()); + : handle.get_stream(); raft::grid_1d_thread_t update_grid((*key_segment_offsets)[4] - (*key_segment_offsets)[3], extract_transform_if_v_frontier_e_kernel_block_size, handle.get_device_properties().maxGridSize[0]); @@ -653,7 +653,7 @@ void extract_transform_if_v_frontier_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[0 % stream_pool_size]) - : static_cast(handle.get_stream()); + : handle.get_stream(); auto frontier_size = static_cast( cuda::std::distance(edge_partition_frontier_key_first, edge_partition_frontier_key_last)); @@ -1325,7 +1325,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); std::variant, rmm::device_uvector> keys = rmm::device_uvector(0, loop_stream); @@ -1429,7 +1429,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, auto partition_idx = i + j; auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); if ((static_cast(partition_idx) != minor_comm_rank) && nonzero_key_lists[j]) { auto edge_partition = @@ -1525,7 +1525,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, for (size_t j = 0; j < loop_count; ++j) { auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); output_key_buffers.push_back(allocate_optional_dataframe_buffer( edge_partition_max_push_counts[j], loop_stream)); @@ -1548,7 +1548,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, auto partition_idx = i + j; auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); auto edge_partition = edge_partition_device_view_t( @@ -1767,7 +1767,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, for (size_t j = 0; j < loop_count; ++j) { auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); auto tmp_buffer_size = h_counts[j]; if (tmp_buffer_size > 0) { @@ -1821,7 +1821,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, for (size_t i = 0; i < key_buffers.size(); ++i) { auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[i]) - : static_cast(handle.get_stream()); + : handle.get_stream(); if constexpr (!std::is_same_v) { thrust::copy( rmm::exec_policy_nosync(loop_stream), diff --git a/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh b/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh index 759d88a5abe..a75869e7911 100644 --- a/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh +++ b/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh @@ -1004,7 +1004,7 @@ void per_v_transform_reduce_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[0 % stream_pool_size]) - : static_cast(handle.get_stream()); + : handle.get_stream(); if constexpr (update_major && !use_input_key) { // this is necessary as we don't visit // every vertex in the hypersparse segment @@ -1053,7 +1053,7 @@ void per_v_transform_reduce_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[1 % stream_pool_size]) - : static_cast(handle.get_stream()); + : handle.get_stream(); raft::grid_1d_thread_t update_grid((*key_segment_offsets)[3] - (*key_segment_offsets)[2], detail::per_v_transform_reduce_e_kernel_block_size, handle.get_device_properties().maxGridSize[0]); @@ -1087,7 +1087,7 @@ void per_v_transform_reduce_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[2 % stream_pool_size]) - : static_cast(handle.get_stream()); + : handle.get_stream(); raft::grid_1d_warp_t update_grid((*key_segment_offsets)[2] - (*key_segment_offsets)[1], detail::per_v_transform_reduce_e_kernel_block_size, handle.get_device_properties().maxGridSize[0]); @@ -1122,7 +1122,7 @@ void per_v_transform_reduce_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[3 % stream_pool_size]) - : static_cast(handle.get_stream()); + : handle.get_stream(); raft::grid_1d_block_t update_grid( (*key_segment_offsets)[1], std::is_same_v> @@ -1157,7 +1157,7 @@ void per_v_transform_reduce_e_edge_partition( auto exec_stream = edge_partition_stream_pool_indices ? handle.get_stream_from_stream_pool( (*edge_partition_stream_pool_indices)[0 % stream_pool_size]) - : static_cast(handle.get_stream()); + : handle.get_stream(); size_t num_keys{}; if constexpr (use_input_key) { @@ -2033,7 +2033,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); std::variant, rmm::device_uvector> keys = rmm::device_uvector(0, loop_stream); @@ -2132,7 +2132,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); auto const& key_segment_offsets = (*key_segment_offset_vectors)[partition_idx]; @@ -2210,7 +2210,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); rmm::device_uvector input_count_offsets(0, loop_stream); if (nonzero_key_lists[j] && process_local_edges[j]) { @@ -2273,7 +2273,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); rmm::device_uvector filtered_bitmap(0, loop_stream); rmm::device_uvector output_count_offsets(0, loop_stream); @@ -2368,7 +2368,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); auto const& key_segment_offsets = (*key_segment_offset_vectors)[partition_idx]; @@ -2613,7 +2613,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); auto const& key_segment_offsets = (*key_segment_offset_vectors)[partition_idx]; @@ -2800,7 +2800,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); if (nonzero_key_lists[j] && process_local_edges[j]) { auto const& key_segment_offsets = (*key_segment_offset_vectors)[partition_idx]; @@ -2845,7 +2845,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, auto partition_idx = i + j; auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); size_t buffer_size{0}; if (process_local_edges[j]) { @@ -3107,7 +3107,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, for (size_t j = 0; j < loop_count; ++j) { auto loop_stream = loop_stream_pool_indices ? handle.get_stream_from_stream_pool((*loop_stream_pool_indices)[j]) - : static_cast(handle.get_stream()); + : handle.get_stream(); auto const& output_buffer = edge_partition_major_output_buffers[j]; if (nonzero_key_lists[j] && process_local_edges[j]) { diff --git a/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh b/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh index 33441b35c78..5ad39f15cf4 100644 --- a/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh +++ b/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh @@ -951,7 +951,7 @@ void fill_edge_minor_property(raft::handle_t const& handle, auto loop_stream = stream_pool_indices ? handle.get_stream_from_stream_pool((*stream_pool_indices)[i % stream_pool_size]) - : static_cast(handle.get_stream()); + : handle.get_stream(); std::optional> rx_vertices{std::nullopt}; if (v_list_bitmap_size) { From 9dd777ae3d8b1e7c54789c256cf9d3f117dc6a48 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Sat, 5 Sep 2026 18:09:40 -0500 Subject: [PATCH 05/10] Preserve stream references through host scalar helpers --- cpp/include/cugraph/partition_manager.hpp | 7 +- cpp/include/cugraph/prims/count_if_v.cuh | 6 +- .../extract_transform_if_v_frontier_e.cuh | 2 +- .../cugraph/prims/detail/nbr_intersection.cuh | 6 +- .../prims/detail/per_v_select_transform_e.cuh | 7 +- .../prims/detail/per_v_transform_reduce_e.cuh | 2 +- .../sample_and_compute_local_nbr_indices.cuh | 12 +-- .../prims/fill_edge_src_dst_property.cuh | 6 +- ...air_transform_src_dst_nbr_intersection.cuh | 2 +- ...m_reduce_dst_key_aggregated_outgoing_e.cuh | 7 +- cpp/include/cugraph/prims/reduce_v.cuh | 4 +- .../cugraph/prims/transform_reduce_e.cuh | 2 +- ...reduce_if_v_frontier_outgoing_e_by_dst.cuh | 5 +- ...t_nbr_intersection_of_e_endpoints_by_v.cuh | 2 +- .../prims/update_edge_src_dst_property.cuh | 19 ++-- cpp/include/cugraph/prims/vertex_frontier.cuh | 2 +- .../cugraph/utilities/error_check_utils.cuh | 6 +- .../cugraph/utilities/host_scalar_comm.hpp | 94 +++++++++++-------- .../cugraph/utilities/shuffle_comm.cuh | 4 +- cpp/src/c_api/bfs.cpp | 2 +- cpp/src/c_api/extract_ego.cpp | 4 +- cpp/src/c_api/graph_generators.cpp | 2 +- cpp/src/c_api/graph_mg.cpp | 32 +++---- cpp/src/c_api/neighbor_sample.cpp | 2 +- cpp/src/c_api/random.cpp | 2 +- .../betweenness_centrality_impl.cuh | 20 ++-- .../approx_weighted_matching_impl.cuh | 8 +- cpp/src/community/detail/common_methods.cuh | 4 +- .../detail/maximal_independent_moves.cuh | 4 +- cpp/src/community/detail/refine_impl.cuh | 10 +- .../community/edge_triangle_count_impl.cuh | 2 +- cpp/src/community/egonet_impl.cuh | 2 +- cpp/src/community/leiden_impl.cuh | 6 +- cpp/src/community/triangle_count_impl.cuh | 18 ++-- cpp/src/components/mis_impl.cuh | 4 +- .../strongly_connected_components_impl.cuh | 16 ++-- .../weakly_connected_components_impl.cuh | 19 ++-- cpp/src/cores/core_number_impl.cuh | 8 +- cpp/src/dag/topological_sort_impl.cuh | 8 +- cpp/src/detail/device_comm_wrapper.cuh | 2 +- cpp/src/detail/permute_range.cuh | 12 +-- cpp/src/link_analysis/pagerank_impl.cuh | 20 ++-- .../detail/similarity_impl.cuh | 18 ++-- cpp/src/lookup/lookup_src_dst_impl.cuh | 2 +- .../detail/check_edge_bias_values.cuh | 12 +-- .../deduplicate_edges_by_minor_impl.cuh | 2 +- cpp/src/sampling/detail/output_labels.cuh | 2 +- .../detail/prepare_next_frontier_impl.cuh | 4 +- .../detail/sample_outgoing_edges_impl.cuh | 2 +- cpp/src/sampling/negative_sampling_impl.cuh | 17 ++-- cpp/src/sampling/neighbor_sampling_impl.cuh | 6 +- cpp/src/sampling/random_walks_impl.cuh | 4 +- cpp/src/sampling/temporal_sampling_impl.cuh | 2 +- .../create_graph_from_edgelist_impl.cuh | 10 +- cpp/src/structure/graph_impl.cuh | 4 +- cpp/src/structure/graph_view_impl.cuh | 8 +- cpp/src/structure/graph_weight_utils_impl.cuh | 10 +- cpp/src/structure/renumber_edgelist_impl.cuh | 44 ++++----- cpp/src/structure/renumber_utils_impl.cuh | 2 +- .../structure/select_random_vertices_impl.cuh | 4 +- cpp/src/traversal/bfs_impl.cuh | 34 +++---- cpp/src/traversal/extract_bfs_paths_impl.cuh | 2 +- cpp/src/traversal/k_hop_nbrs_impl.cuh | 10 +- cpp/src/traversal/sssp_impl.cuh | 2 +- cpp/src/utilities/shuffle_vertex_pairs.cuh | 2 +- cpp/src/utilities/validation_checks_impl.cuh | 2 +- cpp/tests/c_api/test_utils.cpp | 2 +- .../nbr_sampling_validate_empty_result.cuh | 4 +- cpp/tests/utilities/test_graphs.hpp | 5 +- 69 files changed, 291 insertions(+), 327 deletions(-) diff --git a/cpp/include/cugraph/partition_manager.hpp b/cpp/include/cugraph/partition_manager.hpp index 6e11e933ffa..1c6411bfb18 100644 --- a/cpp/include/cugraph/partition_manager.hpp +++ b/cpp/include/cugraph/partition_manager.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -125,8 +125,7 @@ class partition_manager { auto const minor_comm_rank = minor_comm.get_rank(); #if 1 // FIXME: we should add host_allgather to raft - auto vertex_counts = - host_scalar_allgather(comm, local_partition_size, handle.get_stream().get()); + auto vertex_counts = host_scalar_allgather(comm, local_partition_size, handle.get_stream()); #else std::vector vertex_counts(comm_size, 0); vertex_counts[comm_rank] = local_partition_size; @@ -137,7 +136,7 @@ class partition_manager { host_scalar_allgather(comm, partition_manager::compute_vertex_partition_id_from_graph_subcomm_ranks( major_comm_size, minor_comm_size, major_comm_rank, minor_comm_rank), - handle.get_stream().get()); + handle.get_stream()); #else std::vector vertex_partition_ids(comm_size, 0); vertex_partition_ids[comm_rank] = diff --git a/cpp/include/cugraph/prims/count_if_v.cuh b/cpp/include/cugraph/prims/count_if_v.cuh index 75890d074d1..be056239e9f 100644 --- a/cpp/include/cugraph/prims/count_if_v.cuh +++ b/cpp/include/cugraph/prims/count_if_v.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -82,8 +82,8 @@ typename GraphViewType::vertex_type count_if_v(raft::handle_t const& handle, it + graph_view.local_vertex_partition_range_size(), vertex_t{0}); if (GraphViewType::is_multi_gpu) { - count = host_scalar_allreduce( - handle.get_comms(), count, raft::comms::op_t::SUM, handle.get_stream().get()); + count = + host_scalar_allreduce(handle.get_comms(), count, raft::comms::op_t::SUM, handle.get_stream()); } return count; } diff --git a/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh b/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh index 12fa599a683..3fcc667cfa5 100644 --- a/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh +++ b/cpp/include/cugraph/prims/detail/extract_transform_if_v_frontier_e.cuh @@ -794,7 +794,7 @@ extract_transform_if_v_frontier_e(raft::handle_t const& handle, if constexpr (GraphViewType::is_multi_gpu) { #if 1 // FIXME: we should add host_allreduce to raft num_invalid_keys = host_scalar_allreduce( - handle.get_comms(), num_invalid_keys, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), num_invalid_keys, raft::comms::op_t::SUM, handle.get_stream()); #else handle.get_comms().host_allreduce(std::addressof(num_invalid_keys), std::addressof(num_invalid_keys), diff --git a/cpp/include/cugraph/prims/detail/nbr_intersection.cuh b/cpp/include/cugraph/prims/detail/nbr_intersection.cuh index 56b79b27ce0..a4d494d96c1 100644 --- a/cpp/include/cugraph/prims/detail/nbr_intersection.cuh +++ b/cpp/include/cugraph/prims/detail/nbr_intersection.cuh @@ -716,7 +716,7 @@ nbr_intersection(raft::handle_t const& handle, if constexpr (GraphViewType::is_multi_gpu) { auto& comm = handle.get_comms(); is_sorted = static_cast(host_scalar_allreduce( - comm, static_cast(is_sorted), raft::comms::op_t::MIN, handle.get_stream().get())); + comm, static_cast(is_sorted), raft::comms::op_t::MIN, handle.get_stream())); } CUGRAPH_EXPECTS(is_sorted, "Invalid input arguments: input vertex pairs should be sorted."); @@ -778,7 +778,7 @@ nbr_intersection(raft::handle_t const& handle, // calls, perform local sort and unique, and call multiple broadcasts rather than // performing sort and unique for the entire range in every GPU in minor_comm. auto rx_counts = - host_scalar_allgather(minor_comm, unique_majors.size(), handle.get_stream().get()); + host_scalar_allgather(minor_comm, unique_majors.size(), handle.get_stream()); std::vector rx_displacements(rx_counts.size()); std::exclusive_scan( rx_counts.begin(), rx_counts.end(), rx_displacements.begin(), size_t{0}); @@ -1155,7 +1155,7 @@ nbr_intersection(raft::handle_t const& handle, for (size_t i = 0; i < graph_view.number_of_local_edge_partitions(); ++i) { auto rx_v_pair_counts = - host_scalar_allgather(minor_comm, input_counts[i], handle.get_stream().get()); + host_scalar_allgather(minor_comm, input_counts[i], handle.get_stream()); std::vector rx_v_pair_displacements(rx_v_pair_counts.size()); std::exclusive_scan(rx_v_pair_counts.begin(), rx_v_pair_counts.end(), diff --git a/cpp/include/cugraph/prims/detail/per_v_select_transform_e.cuh b/cpp/include/cugraph/prims/detail/per_v_select_transform_e.cuh index 28e5ac2aa31..59c3ba08f10 100644 --- a/cpp/include/cugraph/prims/detail/per_v_select_transform_e.cuh +++ b/cpp/include/cugraph/prims/detail/per_v_select_transform_e.cuh @@ -567,7 +567,7 @@ per_v_select_transform_e( graph_view.local_vertex_partition_range_last()}); if constexpr (GraphViewType::is_multi_gpu) { num_invalid_keys = host_scalar_allreduce( - handle.get_comms(), num_invalid_keys, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), num_invalid_keys, raft::comms::op_t::SUM, handle.get_stream()); } CUGRAPH_EXPECTS(num_invalid_keys == size_t{0}, "Invalid input argument: key_list includes out-of-range keys."); @@ -575,9 +575,8 @@ per_v_select_transform_e( std::vector local_key_list_sizes{}; if (minor_comm_size > 1) { - auto& minor_comm = handle.get_subcomm(cugraph::partition_manager::minor_comm_name()); - local_key_list_sizes = - host_scalar_allgather(minor_comm, key_list.size(), handle.get_stream().get()); + auto& minor_comm = handle.get_subcomm(cugraph::partition_manager::minor_comm_name()); + local_key_list_sizes = host_scalar_allgather(minor_comm, key_list.size(), handle.get_stream()); } else { local_key_list_sizes = std::vector{key_list.size()}; } diff --git a/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh b/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh index a75869e7911..6de843d3674 100644 --- a/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh +++ b/cpp/include/cugraph/prims/detail/per_v_transform_reduce_e.cuh @@ -3080,7 +3080,7 @@ void per_v_transform_reduce_e(raft::handle_t const& handle, } #if 1 // FIXME: we should add host_allreduce to raft max_size = host_scalar_allreduce( - minor_comm, max_size, raft::comms::op_t::MAX, handle.get_stream().get()); + minor_comm, max_size, raft::comms::op_t::MAX, handle.get_stream()); #else minor_comm.host_allreduce( std::addressof(max_size), std::addressof(max_size), size_t{1}, raft::comms::op_t::MAX); diff --git a/cpp/include/cugraph/prims/detail/sample_and_compute_local_nbr_indices.cuh b/cpp/include/cugraph/prims/detail/sample_and_compute_local_nbr_indices.cuh index b8fe8b8991f..b4d05ce1ee4 100644 --- a/cpp/include/cugraph/prims/detail/sample_and_compute_local_nbr_indices.cuh +++ b/cpp/include/cugraph/prims/detail/sample_and_compute_local_nbr_indices.cuh @@ -2636,7 +2636,7 @@ compute_aggregate_local_frontier_biases(raft::handle_t const& handle, check_out_of_range_t{bias_t{0.0}, std::numeric_limits::max()}); if constexpr (GraphViewType::is_multi_gpu) { num_invalid_biases = host_scalar_allreduce( - handle.get_comms(), num_invalid_biases, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), num_invalid_biases, raft::comms::op_t::SUM, handle.get_stream()); } CUGRAPH_EXPECTS(num_invalid_biases == 0, "invalid_input_argument: bias_e_op return values should be non-negative and " @@ -2808,7 +2808,7 @@ compute_aggregate_local_frontier_bias_type_pairs( check_out_of_range_t{bias_t{0.0}, std::numeric_limits::max()}); if constexpr (GraphViewType::is_multi_gpu) { num_invalid_biases = host_scalar_allreduce( - handle.get_comms(), num_invalid_biases, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), num_invalid_biases, raft::comms::op_t::SUM, handle.get_stream()); } CUGRAPH_EXPECTS(num_invalid_biases == 0, "invalid_input_argument: bias_e_op return values should be non-negative and " @@ -3619,7 +3619,7 @@ homogeneous_biased_sample_without_replacement( auto mid_frontier_size = frontier_partition_offsets[2] - frontier_partition_offsets[1]; std::vector mid_local_frontier_sizes{}; mid_local_frontier_sizes = - host_scalar_allgather(minor_comm, mid_frontier_size, handle.get_stream().get()); + host_scalar_allgather(minor_comm, mid_frontier_size, handle.get_stream()); std::vector mid_local_frontier_offsets(mid_local_frontier_sizes.size() + 1); mid_local_frontier_offsets[0] = 0; std::inclusive_scan(mid_local_frontier_sizes.begin(), @@ -3854,7 +3854,7 @@ homogeneous_biased_sample_without_replacement( auto high_frontier_size = frontier_partition_offsets[3] - frontier_partition_offsets[2]; std::vector high_local_frontier_sizes{}; high_local_frontier_sizes = - host_scalar_allgather(minor_comm, high_frontier_size, handle.get_stream().get()); + host_scalar_allgather(minor_comm, high_frontier_size, handle.get_stream()); std::vector high_local_frontier_offsets(high_local_frontier_sizes.size() + 1); high_local_frontier_offsets[0] = 0; @@ -4237,7 +4237,7 @@ heterogeneous_biased_sample_without_replacement( auto mid_frontier_size = frontier_partition_offsets[2] - frontier_partition_offsets[1]; auto mid_local_frontier_sizes = - host_scalar_allgather(minor_comm, mid_frontier_size, handle.get_stream().get()); + host_scalar_allgather(minor_comm, mid_frontier_size, handle.get_stream()); std::vector mid_local_frontier_offsets(mid_local_frontier_sizes.size() + 1); mid_local_frontier_offsets[0] = 0; std::inclusive_scan(mid_local_frontier_sizes.begin(), @@ -4517,7 +4517,7 @@ heterogeneous_biased_sample_without_replacement( auto high_frontier_size = frontier_partition_offsets[3] - frontier_partition_offsets[2]; auto high_local_frontier_sizes = - host_scalar_allgather(minor_comm, high_frontier_size, handle.get_stream().get()); + host_scalar_allgather(minor_comm, high_frontier_size, handle.get_stream()); std::vector high_local_frontier_offsets(high_local_frontier_sizes.size() + 1); high_local_frontier_offsets[0] = 0; std::inclusive_scan(high_local_frontier_sizes.begin(), diff --git a/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh b/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh index 5ad39f15cf4..e892b375af1 100644 --- a/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh +++ b/cpp/include/cugraph/prims/fill_edge_src_dst_property.cuh @@ -172,7 +172,7 @@ void fill_edge_major_property(raft::handle_t const& handle, host_scalar_allgather(minor_comm, static_cast(cuda::std::distance(sorted_unique_vertex_first, sorted_unique_vertex_last)), - handle.get_stream().get()); + handle.get_stream()); #else std::vector local_v_list_sizes(minor_comm_size, 0); local_v_list_sizes[minor_comm_rank] = static_cast( @@ -1388,8 +1388,8 @@ void fill_edge_dst_property(raft::handle_t const& handle, if constexpr (GraphViewType::is_multi_gpu) { auto& comm = handle.get_comms(); #if 1 // FIXME: we should add host_allreduce to raft - num_invalids = host_scalar_allreduce( - comm, num_invalids, raft::comms::op_t::SUM, handle.get_stream().get()); + num_invalids = + host_scalar_allreduce(comm, num_invalids, raft::comms::op_t::SUM, handle.get_stream()); #else comm.host_allreduce(std::addressof(num_invalids), std::addressof(num_invalids), diff --git a/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh b/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh index ccd5ce7867b..f427a249333 100644 --- a/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh +++ b/cpp/include/cugraph/prims/per_v_pair_transform_src_dst_nbr_intersection.cuh @@ -307,7 +307,7 @@ void per_v_pair_transform_minor_nbr_intersection( auto max_num_chunks = (h_edge_partition_group_sizes[i] + max_chunk_size - 1) / max_chunk_size; if constexpr (GraphViewType::is_multi_gpu) { max_num_chunks = host_scalar_allreduce( - handle.get_comms(), max_num_chunks, raft::comms::op_t::MAX, handle.get_stream().get()); + handle.get_comms(), max_num_chunks, raft::comms::op_t::MAX, handle.get_stream()); } std::vector h_chunk_sizes(max_num_chunks); diff --git a/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh b/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh index 3884a83ba60..580e88787ea 100644 --- a/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh +++ b/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -767,7 +767,7 @@ void per_v_transform_reduce_dst_key_aggregated_outgoing_e( host_scalar_allreduce(minor_comm, tmp_majors.size() > mem_frugal_threshold ? int{1} : int{0}, raft::comms::op_t::MAX, - handle.get_stream().get()); + handle.get_stream()); if (mem_frugal_flag) { // trade-off potential parallelism to lower peak memory std::tie(rx_majors, std::ignore) = shuffle_values( minor_comm, @@ -1058,8 +1058,7 @@ void per_v_transform_reduce_dst_key_aggregated_outgoing_e( // reduce_op cannot be mapped to ncclRedOp_t, we need to implement our own multi-GPU reduce // function. - auto rx_sizes = - host_scalar_gather(minor_comm, tmp_majors.size(), i, handle.get_stream().get()); + auto rx_sizes = host_scalar_gather(minor_comm, tmp_majors.size(), i, handle.get_stream()); std::vector rx_displs{}; rmm::device_uvector rx_majors(0, handle.get_stream()); if (static_cast(minor_comm_rank) == i) { diff --git a/cpp/include/cugraph/prims/reduce_v.cuh b/cpp/include/cugraph/prims/reduce_v.cuh index 06de6a6d0aa..3643cffc0d6 100644 --- a/cpp/include/cugraph/prims/reduce_v.cuh +++ b/cpp/include/cugraph/prims/reduce_v.cuh @@ -86,7 +86,7 @@ T reduce_v(raft::handle_t const& handle, ? handle.get_comms().get_rank() : std::numeric_limits::max(), raft::comms::op_t::MIN, - handle.get_stream().get()); + handle.get_stream()); ret = host_scalar_bcast(handle.get_comms(), ret, root, handle.get_stream()); } } else { @@ -131,7 +131,7 @@ T reduce_v(raft::handle_t const& handle, ret = host_scalar_allreduce(handle.get_comms(), *local_result, ReduceOp::compatible_raft_comms_op, - handle.get_stream().get()); + handle.get_stream()); } else { auto rets = host_scalar_gather(handle.get_comms(), *local_result, int{0}, handle.get_stream()); diff --git a/cpp/include/cugraph/prims/transform_reduce_e.cuh b/cpp/include/cugraph/prims/transform_reduce_e.cuh index f66db12950b..f0e86dde60a 100644 --- a/cpp/include/cugraph/prims/transform_reduce_e.cuh +++ b/cpp/include/cugraph/prims/transform_reduce_e.cuh @@ -595,7 +595,7 @@ T transform_reduce_e(raft::handle_t const& handle, if constexpr (GraphViewType::is_multi_gpu) { #if 1 // FIXME: we should add host_allreduce to raft result = host_scalar_allreduce( - handle.get_comms(), result, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), result, raft::comms::op_t::SUM, handle.get_stream()); #else handle.get_comms().host_allreduce( std::addressof(result), std::addressof(result), size_t{1}, raft::comms::op_t::SUM); diff --git a/cpp/include/cugraph/prims/transform_reduce_if_v_frontier_outgoing_e_by_dst.cuh b/cpp/include/cugraph/prims/transform_reduce_if_v_frontier_outgoing_e_by_dst.cuh index 774b70da4c8..f9cb05026b8 100644 --- a/cpp/include/cugraph/prims/transform_reduce_if_v_frontier_outgoing_e_by_dst.cuh +++ b/cpp/include/cugraph/prims/transform_reduce_if_v_frontier_outgoing_e_by_dst.cuh @@ -736,7 +736,7 @@ transform_reduce_if_v_frontier_outgoing_e_by_dst(raft::handle_t const& handle, if (major_comm_size > 1) { #if 1 // FIXME: we should add host_allreduce to raft aggregate_key_buffer_size = host_scalar_allreduce( - major_comm, aggregate_key_buffer_size, raft::comms::op_t::SUM, handle.get_stream().get()); + major_comm, aggregate_key_buffer_size, raft::comms::op_t::SUM, handle.get_stream()); #else major_comm.host_allreduce(std::addressof(aggregate_key_buffer_size), std::addressof(aggregate_key_buffer_size), @@ -1149,8 +1149,7 @@ size_t compute_num_out_nbrs_from_frontier(raft::handle_t const& handle, if constexpr (GraphViewType::is_multi_gpu) { auto& minor_comm = handle.get_subcomm(cugraph::partition_manager::minor_comm_name()); #if 1 // FIXME: we should add host_allgather to raft - local_frontier_sizes = - host_scalar_allgather(minor_comm, frontier.size(), handle.get_stream().get()); + local_frontier_sizes = host_scalar_allgather(minor_comm, frontier.size(), handle.get_stream()); #else local_frontier_sizes = std::vector(minor_comm.get_size(), 0); local_frontier_sizes[minor_comm.get_rank()] = frontier.size(); diff --git a/cpp/include/cugraph/prims/transform_reduce_src_dst_nbr_intersection_of_e_endpoints_by_v.cuh b/cpp/include/cugraph/prims/transform_reduce_src_dst_nbr_intersection_of_e_endpoints_by_v.cuh index bd85fdadd42..b842ef78c9b 100644 --- a/cpp/include/cugraph/prims/transform_reduce_src_dst_nbr_intersection_of_e_endpoints_by_v.cuh +++ b/cpp/include/cugraph/prims/transform_reduce_src_dst_nbr_intersection_of_e_endpoints_by_v.cuh @@ -280,7 +280,7 @@ void transform_reduce_minor_nbr_intersection_of_e_endpoints_by_v( auto max_num_chunks = (majors.size() + max_chunk_size - 1) / max_chunk_size; if constexpr (GraphViewType::is_multi_gpu) { max_num_chunks = host_scalar_allreduce( - handle.get_comms(), max_num_chunks, raft::comms::op_t::MAX, handle.get_stream().get()); + handle.get_comms(), max_num_chunks, raft::comms::op_t::MAX, handle.get_stream()); } std::vector h_chunk_sizes(max_num_chunks); diff --git a/cpp/include/cugraph/prims/update_edge_src_dst_property.cuh b/cpp/include/cugraph/prims/update_edge_src_dst_property.cuh index a6de6bd0cb0..4b1b337ee9a 100644 --- a/cpp/include/cugraph/prims/update_edge_src_dst_property.cuh +++ b/cpp/include/cugraph/prims/update_edge_src_dst_property.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -283,7 +283,7 @@ void update_edge_major_property( host_scalar_allgather(minor_comm, static_cast(cuda::std::distance(sorted_unique_vertex_first, sorted_unique_vertex_last)), - handle.get_stream().get()); + handle.get_stream()); auto max_rx_size = std::reduce( local_v_list_sizes.begin(), local_v_list_sizes.end(), size_t{0}, [](auto lhs, auto rhs) { return std::max(lhs, rhs); @@ -707,12 +707,11 @@ void update_edge_minor_property( handle.sync_stream(); } - auto local_v_list_sizes = - host_scalar_allgather(major_comm, v_list_size, handle.get_stream().get()); + auto local_v_list_sizes = host_scalar_allgather(major_comm, v_list_size, handle.get_stream()); auto local_v_list_range_firsts = - host_scalar_allgather(major_comm, v_list_range[0], handle.get_stream().get()); + host_scalar_allgather(major_comm, v_list_range[0], handle.get_stream()); auto local_v_list_range_lasts = - host_scalar_allgather(major_comm, v_list_range[1], handle.get_stream().get()); + host_scalar_allgather(major_comm, v_list_range[1], handle.get_stream()); std::optional> v_list_bitmap{std::nullopt}; if (major_comm_size > 1) { @@ -988,8 +987,8 @@ void update_edge_src_property(raft::handle_t const& handle, if constexpr (GraphViewType::is_multi_gpu) { auto& comm = handle.get_comms(); #if 1 // FIXME: we should add host_allreduce to raft - num_invalids = host_scalar_allreduce( - comm, num_invalids, raft::comms::op_t::SUM, handle.get_stream().get()); + num_invalids = + host_scalar_allreduce(comm, num_invalids, raft::comms::op_t::SUM, handle.get_stream()); #else comm.host_allreduce(std::addressof(num_invalids), std::addressof(num_invalids), @@ -1117,8 +1116,8 @@ void update_edge_dst_property(raft::handle_t const& handle, if constexpr (GraphViewType::is_multi_gpu) { auto& comm = handle.get_comms(); #if 1 // FIXME: we should add host_allreduce to raft - num_invalids = host_scalar_allreduce( - comm, num_invalids, raft::comms::op_t::SUM, handle.get_stream().get()); + num_invalids = + host_scalar_allreduce(comm, num_invalids, raft::comms::op_t::SUM, handle.get_stream()); #else comm.host_allreduce(std::addressof(num_invalids), std::addressof(num_invalids), diff --git a/cpp/include/cugraph/prims/vertex_frontier.cuh b/cpp/include/cugraph/prims/vertex_frontier.cuh index 0e74743ca56..f086dd5daed 100644 --- a/cpp/include/cugraph/prims/vertex_frontier.cuh +++ b/cpp/include/cugraph/prims/vertex_frontier.cuh @@ -445,7 +445,7 @@ class key_bucket_t { size_t ret = vertices_.size(); #if 1 // FIXME: we should add host_allreduce to raft ret = host_scalar_allreduce( - handle_ptr_->get_comms(), ret, raft::comms::op_t::SUM, handle_ptr_->get_stream().get()); + handle_ptr_->get_comms(), ret, raft::comms::op_t::SUM, handle_ptr_->get_stream()); #else handle_ptr_->get_comms().host_allreduce( std::addressof(ret), std::addressof(ret), size_t{1}, raft::comms::op_t::SUM); diff --git a/cpp/include/cugraph/utilities/error_check_utils.cuh b/cpp/include/cugraph/utilities/error_check_utils.cuh index e55d7ad6ede..77dcca86d7e 100644 --- a/cpp/include/cugraph/utilities/error_check_utils.cuh +++ b/cpp/include/cugraph/utilities/error_check_utils.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -120,8 +120,8 @@ size_t count_invalid_vertex_pairs(raft::handle_t const& handle, if constexpr (GraphViewType::is_multi_gpu) { auto& comm = handle.get_comms(); #if 1 // FIXME: we should add host_allreduce to raft - num_invalid_pairs = host_scalar_allreduce( - comm, num_invalid_pairs, raft::comms::op_t::SUM, handle.get_stream().get()); + num_invalid_pairs = + host_scalar_allreduce(comm, num_invalid_pairs, raft::comms::op_t::SUM, handle.get_stream()); #else comm.host_allreduce(std::addressof(num_invalid_pairs), std::addressof(num_invalid_pairs), diff --git a/cpp/include/cugraph/utilities/host_scalar_comm.hpp b/cpp/include/cugraph/utilities/host_scalar_comm.hpp index 902a1b6796c..4f3640f51a1 100644 --- a/cpp/include/cugraph/utilities/host_scalar_comm.hpp +++ b/cpp/include/cugraph/utilities/host_scalar_comm.hpp @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -65,12 +66,12 @@ struct host_allreduce_tuple_scalar_element_impl { void run(raft::comms::comms_t const& comm, int64_t* tuple_scalar_elements, raft::comms::op_t op, - cudaStream_t stream) const + cuda::stream_ref stream) const { using element_t = typename cuda::std::tuple_element::type; static_assert(sizeof(element_t) <= sizeof(int64_t)); auto ptr = reinterpret_cast(tuple_scalar_elements + I); - comm.allreduce(ptr, ptr, 1, op, stream); + comm.allreduce(ptr, ptr, 1, op, stream.get()); host_allreduce_tuple_scalar_element_impl().run( comm, tuple_scalar_elements, op, stream); } @@ -81,7 +82,7 @@ struct host_allreduce_tuple_scalar_element_impl { void run(raft::comms::comms_t const& comm, int64_t* tuple_scalar_elements, raft::comms::op_t op, - cudaStream_t stream) const + cuda::stream_ref stream) const { } }; @@ -92,12 +93,12 @@ struct host_reduce_tuple_scalar_element_impl { int64_t* tuple_scalar_elements, raft::comms::op_t op, int root, - cudaStream_t stream) const + cuda::stream_ref stream) const { using element_t = typename cuda::std::tuple_element::type; static_assert(sizeof(element_t) <= sizeof(int64_t)); auto ptr = reinterpret_cast(tuple_scalar_elements + I); - comm.reduce(ptr, ptr, 1, op, root, stream); + comm.reduce(ptr, ptr, 1, op, root, stream.get()); host_reduce_tuple_scalar_element_impl().run( comm, tuple_scalar_elements, op, root, stream); } @@ -109,7 +110,7 @@ struct host_reduce_tuple_scalar_element_impl { int64_t* tuple_scalar_elements, raft::comms::op_t op, int root, - cudaStream_t stream) const + cuda::stream_ref stream) const { } }; @@ -118,7 +119,7 @@ struct host_reduce_tuple_scalar_element_impl { template std::enable_if_t::value, T> host_scalar_allreduce( - raft::comms::comms_t const& comm, T input, raft::comms::op_t op, cudaStream_t stream) + raft::comms::comms_t const& comm, T input, raft::comms::op_t op, cuda::stream_ref stream) { std::variant, rmm::device_uvector> h_tmp_buffer{}; raft::host_span h_tmp_buffer_view{}; @@ -134,9 +135,9 @@ std::enable_if_t::value, T> host_scalar_allreduce( T* d_staging_buffer = d_tmp_buffer.data(); h_staging_buffer[0] = input; raft::update_device(d_staging_buffer, h_staging_buffer, 1, stream); - comm.allreduce(d_staging_buffer, d_staging_buffer, 1, op, stream); + comm.allreduce(d_staging_buffer, d_staging_buffer, 1, op, stream.get()); raft::update_host(h_staging_buffer, d_staging_buffer, 1, stream); - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); auto h_input = h_staging_buffer[0]; @@ -145,7 +146,7 @@ std::enable_if_t::value, T> host_scalar_allreduce( template std::enable_if_t::value, T> host_scalar_allreduce( - raft::comms::comms_t const& comm, T input, raft::comms::op_t op, cudaStream_t stream) + raft::comms::comms_t const& comm, T input, raft::comms::op_t op, cuda::stream_ref stream) { size_t constexpr tuple_size = cuda::std::tuple_size::value; @@ -169,7 +170,7 @@ std::enable_if_t::value, T> host_scala detail::host_allreduce_tuple_scalar_element_impl().run( comm, d_staging_buffer, op, stream); raft::update_host(h_staging_buffer, d_staging_buffer, tuple_size, stream); - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); T ret{}; @@ -181,7 +182,11 @@ std::enable_if_t::value, T> host_scala // Return value is valid only in root (return value may better be std::optional in C++17 or later) template std::enable_if_t::value, T> host_scalar_reduce( - raft::comms::comms_t const& comm, T input, raft::comms::op_t op, int root, cudaStream_t stream) + raft::comms::comms_t const& comm, + T input, + raft::comms::op_t op, + int root, + cuda::stream_ref stream) { std::variant, rmm::device_uvector> h_tmp_buffer{}; raft::host_span h_tmp_buffer_view{}; @@ -197,9 +202,9 @@ std::enable_if_t::value, T> host_scalar_reduce( T* d_staging_buffer = d_tmp_buffer.data(); h_staging_buffer[0] = input; raft::update_device(d_staging_buffer, h_staging_buffer, 1, stream); - comm.reduce(d_staging_buffer, d_staging_buffer, 1, op, stream); + comm.reduce(d_staging_buffer, d_staging_buffer, 1, op, stream.get()); if (comm.get_rank() == root) { raft::update_host(h_staging_buffer, d_staging_buffer, 1, stream); } - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); T h_input{}; @@ -210,7 +215,11 @@ std::enable_if_t::value, T> host_scalar_reduce( // Return value is valid only in root (return value may better be std::optional in C++17 or later) template std::enable_if_t::value, T> host_scalar_reduce( - raft::comms::comms_t const& comm, T input, raft::comms::op_t op, int root, cudaStream_t stream) + raft::comms::comms_t const& comm, + T input, + raft::comms::op_t op, + int root, + cuda::stream_ref stream) { size_t constexpr tuple_size = cuda::std::tuple_size::value; @@ -236,7 +245,7 @@ std::enable_if_t::value, T> host_scala if (comm.get_rank() == root) { raft::update_host(h_staging_buffer, d_staging_buffer, tuple_size, stream); } - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); T ret{}; @@ -249,7 +258,7 @@ std::enable_if_t::value, T> host_scala template std::enable_if_t::value, T> host_scalar_bcast( - raft::comms::comms_t const& comm, T input, int root, cudaStream_t stream) + raft::comms::comms_t const& comm, T input, int root, cuda::stream_ref stream) { std::variant, rmm::device_uvector> h_tmp_buffer{}; raft::host_span h_tmp_buffer_view{}; @@ -267,9 +276,9 @@ std::enable_if_t::value, T> host_scalar_bcast( h_staging_buffer[0] = input; raft::update_device(d_staging_buffer, h_staging_buffer, 1, stream); } - comm.bcast(d_staging_buffer, 1, root, stream); + comm.bcast(d_staging_buffer, 1, root, stream.get()); if (comm.get_rank() != root) { raft::update_host(h_staging_buffer, d_staging_buffer, 1, stream); } - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); auto h_input = h_staging_buffer[0]; @@ -278,7 +287,7 @@ std::enable_if_t::value, T> host_scalar_bcast( template std::enable_if_t::value, T> host_scalar_bcast( - raft::comms::comms_t const& comm, T input, int root, cudaStream_t stream) + raft::comms::comms_t const& comm, T input, int root, cuda::stream_ref stream) { size_t constexpr tuple_size = cuda::std::tuple_size::value; @@ -301,11 +310,11 @@ std::enable_if_t::value, T> host_scala .update(h_staging_buffer, input); raft::update_device(d_staging_buffer, h_staging_buffer, tuple_size, stream); } - comm.bcast(d_staging_buffer, tuple_size, root, stream); + comm.bcast(d_staging_buffer, tuple_size, root, stream.get()); if (comm.get_rank() != root) { raft::update_host(h_staging_buffer, d_staging_buffer, tuple_size, stream); } - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); T ret{}; @@ -316,7 +325,7 @@ std::enable_if_t::value, T> host_scala template std::enable_if_t::value, std::vector> host_scalar_allgather( - raft::comms::comms_t const& comm, T input, cudaStream_t stream) + raft::comms::comms_t const& comm, T input, cuda::stream_ref stream) { std::variant, rmm::device_uvector> h_tmp_buffer{}; raft::host_span h_tmp_buffer_view{}; @@ -333,9 +342,9 @@ std::enable_if_t::value, std::vector> host_scalar_allga h_staging_buffer[comm.get_rank()] = input; raft::update_device( d_staging_buffer + comm.get_rank(), h_staging_buffer + comm.get_rank(), 1, stream); - comm.allgather(d_staging_buffer + comm.get_rank(), d_staging_buffer, size_t{1}, stream); + comm.allgather(d_staging_buffer + comm.get_rank(), d_staging_buffer, size_t{1}, stream.get()); raft::update_host(h_staging_buffer, d_staging_buffer, comm.get_size(), stream); - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); std::vector h_outputs(h_staging_buffer, h_staging_buffer + comm.get_size()); @@ -344,7 +353,7 @@ std::enable_if_t::value, std::vector> host_scalar_allga template std::enable_if_t::value, std::vector> -host_scalar_allgather(raft::comms::comms_t const& comm, T input, cudaStream_t stream) +host_scalar_allgather(raft::comms::comms_t const& comm, T input, cuda::stream_ref stream) { size_t constexpr tuple_size = cuda::std::tuple_size::value; @@ -369,9 +378,9 @@ host_scalar_allgather(raft::comms::comms_t const& comm, T input, cudaStream_t st tuple_size, stream); comm.allgather( - d_staging_buffer + comm.get_rank() * tuple_size, d_staging_buffer, tuple_size, stream); + d_staging_buffer + comm.get_rank() * tuple_size, d_staging_buffer, tuple_size, stream.get()); raft::update_host(h_staging_buffer, d_staging_buffer, comm.get_size() * tuple_size, stream); - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); std::vector ret(comm.get_size()); @@ -387,7 +396,7 @@ std::enable_if_t::value, T> host_scalar_scatter( raft::comms::comms_t const& comm, std::vector const& inputs, // relevant only in root int root, - cudaStream_t stream) + cuda::stream_ref stream) { CUGRAPH_EXPECTS( ((comm.get_rank() == root) && (inputs.size() == static_cast(comm.get_size()))) || @@ -410,12 +419,12 @@ std::enable_if_t::value, T> host_scalar_scatter( std::copy(inputs.begin(), inputs.end(), h_staging_buffer); raft::update_device(d_staging_buffer, h_staging_buffer, comm.get_size(), stream); } - comm.bcast(d_staging_buffer, comm.get_size(), root, stream); + comm.bcast(d_staging_buffer, comm.get_size(), root, stream.get()); if (comm.get_rank() != root) { raft::update_host( h_staging_buffer + comm.get_rank(), d_staging_buffer + comm.get_rank(), 1, stream); } - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); auto h_output = h_staging_buffer[comm.get_rank()]; @@ -427,7 +436,7 @@ std::enable_if_t::value, T> host_scala raft::comms::comms_t const& comm, std::vector const& inputs, // relevant only in root int root, - cudaStream_t stream) + cuda::stream_ref stream) { size_t constexpr tuple_size = cuda::std::tuple_size::value; CUGRAPH_EXPECTS( @@ -456,14 +465,14 @@ std::enable_if_t::value, T> host_scala } raft::update_device(d_staging_buffer, h_staging_buffer, comm.get_size() * tuple_size, stream); } - comm.bcast(d_staging_buffer, comm.get_size() * tuple_size, root, stream); + comm.bcast(d_staging_buffer, comm.get_size() * tuple_size, root, stream.get()); if (comm.get_rank() != root) { raft::update_host(h_staging_buffer + comm.get_rank() * tuple_size, d_staging_buffer + comm.get_rank() * tuple_size, tuple_size, stream); } - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); T ret{}; @@ -476,7 +485,7 @@ std::enable_if_t::value, T> host_scala // Return value is valid only in root (return value may better be std::optional in C++17 or later) template std::enable_if_t::value, std::vector> host_scalar_gather( - raft::comms::comms_t const& comm, T input, int root, cudaStream_t stream) + raft::comms::comms_t const& comm, T input, int root, cuda::stream_ref stream) { std::variant, rmm::device_uvector> h_tmp_buffer{}; raft::host_span h_tmp_buffer_view{}; @@ -493,11 +502,11 @@ std::enable_if_t::value, std::vector> host_scalar_gathe h_staging_buffer[comm.get_rank()] = input; raft::update_device( d_staging_buffer + comm.get_rank(), h_staging_buffer + comm.get_rank(), 1, stream); - comm.gather(d_staging_buffer + comm.get_rank(), d_staging_buffer, size_t{1}, root, stream); + comm.gather(d_staging_buffer + comm.get_rank(), d_staging_buffer, size_t{1}, root, stream.get()); if (comm.get_rank() == root) { raft::update_host(h_staging_buffer, d_staging_buffer, comm.get_size(), stream); } - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); std::vector h_outputs{}; @@ -510,7 +519,7 @@ std::enable_if_t::value, std::vector> host_scalar_gathe // Return value is valid only in root (return value may better be std::optional in C++17 or later) template std::enable_if_t::value, std::vector> -host_scalar_gather(raft::comms::comms_t const& comm, T input, int root, cudaStream_t stream) +host_scalar_gather(raft::comms::comms_t const& comm, T input, int root, cuda::stream_ref stream) { size_t constexpr tuple_size = cuda::std::tuple_size::value; @@ -534,12 +543,15 @@ host_scalar_gather(raft::comms::comms_t const& comm, T input, int root, cudaStre h_staging_buffer + comm.get_rank() * tuple_size, tuple_size, stream); - comm.gather( - d_staging_buffer + comm.get_rank() * tuple_size, d_staging_buffer, tuple_size, root, stream); + comm.gather(d_staging_buffer + comm.get_rank() * tuple_size, + d_staging_buffer, + tuple_size, + root, + stream.get()); if (comm.get_rank() == root) { raft::update_host(h_staging_buffer, d_staging_buffer, comm.get_size() * tuple_size, stream); } - auto status = comm.sync_stream(stream); + auto status = comm.sync_stream(stream.get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); std::vector ret(comm.get_size()); diff --git a/cpp/include/cugraph/utilities/shuffle_comm.cuh b/cpp/include/cugraph/utilities/shuffle_comm.cuh index 28c7996dd4d..7b570b852c7 100644 --- a/cpp/include/cugraph/utilities/shuffle_comm.cuh +++ b/cpp/include/cugraph/utilities/shuffle_comm.cuh @@ -75,8 +75,8 @@ compute_tx_rx_counts_displs_ranks(raft::comms::comms_t const& comm, rmm::device_uvector d_rx_value_counts(comm_size, stream_view); device_alltoall(comm, d_tx_value_counts.data(), d_rx_value_counts.data(), size_t{1}, stream_view); - raft::update_host(tx_counts.data(), d_tx_value_counts.data(), comm_size, stream_view.get()); - raft::update_host(rx_counts.data(), d_rx_value_counts.data(), comm_size, stream_view.get()); + raft::update_host(tx_counts.data(), d_tx_value_counts.data(), comm_size, stream_view); + raft::update_host(rx_counts.data(), d_rx_value_counts.data(), comm_size, stream_view); stream_view.sync(); std::partial_sum(tx_counts.begin(), tx_counts.end() - 1, tx_displs.begin() + 1); diff --git a/cpp/src/c_api/bfs.cpp b/cpp/src/c_api/bfs.cpp index 6af771a6fa5..1325a405eb0 100644 --- a/cpp/src/c_api/bfs.cpp +++ b/cpp/src/c_api/bfs.cpp @@ -110,7 +110,7 @@ struct bfs_functor : public abstract_functor { if constexpr (multi_gpu) { invalid_count = cugraph::host_scalar_allreduce( - handle_.get_comms(), invalid_count, raft::comms::op_t::SUM, handle_.get_stream().get()); + handle_.get_comms(), invalid_count, raft::comms::op_t::SUM, handle_.get_stream()); } if (invalid_count != 0) { diff --git a/cpp/src/c_api/extract_ego.cpp b/cpp/src/c_api/extract_ego.cpp index 0cdc9e1a723..f4b9dc4e722 100644 --- a/cpp/src/c_api/extract_ego.cpp +++ b/cpp/src/c_api/extract_ego.cpp @@ -91,7 +91,7 @@ struct extract_ego_functor : public cugraph::c_api::abstract_functor { if constexpr (multi_gpu) { auto displacements = cugraph::host_scalar_allgather( - handle_.get_comms(), source_vertices.size(), handle_.get_stream().get()); + handle_.get_comms(), source_vertices.size(), handle_.get_stream()); std::exclusive_scan( displacements.begin(), displacements.end(), displacements.begin(), size_t{0}); source_indices = rmm::device_uvector(source_vertices.size(), handle_.get_stream()); @@ -143,7 +143,7 @@ struct extract_ego_functor : public cugraph::c_api::abstract_functor { if constexpr (multi_gpu) { auto recvcounts = cugraph::host_scalar_allgather( - handle_.get_comms(), (*source_indices).size(), handle_.get_stream().get()); + handle_.get_comms(), (*source_indices).size(), handle_.get_stream()); std::vector displacements(recvcounts.size()); std::exclusive_scan(recvcounts.begin(), recvcounts.end(), displacements.begin(), size_t{0}); rmm::device_uvector allgathered_indices(displacements.back() + recvcounts.back(), diff --git a/cpp/src/c_api/graph_generators.cpp b/cpp/src/c_api/graph_generators.cpp index 930f0cfd348..66d3f3b6e26 100644 --- a/cpp/src/c_api/graph_generators.cpp +++ b/cpp/src/c_api/graph_generators.cpp @@ -347,7 +347,7 @@ extern "C" cugraph_error_code_t cugraph_generate_edge_ids(const cugraph_resource if (multi_gpu) { auto edge_counts = cugraph::host_scalar_allgather( - local_handle.get_comms(), num_edges, local_handle.get_stream().get()); + local_handle.get_comms(), num_edges, local_handle.get_stream()); std::vector edge_starts(edge_counts.size()); std::exclusive_scan(edge_counts.begin(), edge_counts.end(), edge_starts.begin(), size_t{0}); diff --git a/cpp/src/c_api/graph_mg.cpp b/cpp/src/c_api/graph_mg.cpp index 005096ef28b..98b6ce6459b 100644 --- a/cpp/src/c_api/graph_mg.cpp +++ b/cpp/src/c_api/graph_mg.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -426,7 +426,7 @@ extern "C" cugraph_error_code_t cugraph_graph_create_mg( size_t num_edges = cugraph::host_scalar_allreduce(p_handle->handle_->get_comms(), local_num_edges, raft::comms::op_t::SUM, - p_handle->handle_->get_stream().get()); + p_handle->handle_->get_stream()); cugraph_data_type_id_t edge_type{vertex_type}; @@ -436,13 +436,11 @@ extern "C" cugraph_error_code_t cugraph_graph_create_mg( "Number of edges won't fit in 32-bit integer, using 32-bit type", *error); - auto vertex_types = cugraph::host_scalar_allgather(p_handle->handle_->get_comms(), - static_cast(vertex_type), - p_handle->handle_->get_stream().get()); + auto vertex_types = cugraph::host_scalar_allgather( + p_handle->handle_->get_comms(), static_cast(vertex_type), p_handle->handle_->get_stream()); - auto weight_types = cugraph::host_scalar_allgather(p_handle->handle_->get_comms(), - static_cast(weight_type), - p_handle->handle_->get_stream().get()); + auto weight_types = cugraph::host_scalar_allgather( + p_handle->handle_->get_comms(), static_cast(weight_type), p_handle->handle_->get_stream()); if (vertex_type == cugraph_data_type_id_t::NTYPES) { // Only true if this GPU had no vertex arrays @@ -500,7 +498,7 @@ extern "C" cugraph_error_code_t cugraph_graph_create_mg( auto edge_type_id_types = cugraph::host_scalar_allgather(p_handle->handle_->get_comms(), static_cast(edge_type_id_type), - p_handle->handle_->get_stream().get()); + p_handle->handle_->get_stream()); if (edge_type_id_type == cugraph_data_type_id_t::NTYPES) { // Only true if this GPU had no edge_type_id arrays @@ -684,7 +682,7 @@ extern "C" cugraph_error_code_t cugraph_graph_create_with_times_mg( size_t num_edges = cugraph::host_scalar_allreduce(p_handle->handle_->get_comms(), local_num_edges, raft::comms::op_t::SUM, - p_handle->handle_->get_stream().get()); + p_handle->handle_->get_stream()); cugraph_data_type_id_t edge_type{vertex_type}; @@ -694,17 +692,15 @@ extern "C" cugraph_error_code_t cugraph_graph_create_with_times_mg( "Number of edges won't fit in 32-bit integer, using 32-bit type", *error); - auto vertex_types = cugraph::host_scalar_allgather(p_handle->handle_->get_comms(), - static_cast(vertex_type), - p_handle->handle_->get_stream().get()); + auto vertex_types = cugraph::host_scalar_allgather( + p_handle->handle_->get_comms(), static_cast(vertex_type), p_handle->handle_->get_stream()); - auto weight_types = cugraph::host_scalar_allgather(p_handle->handle_->get_comms(), - static_cast(weight_type), - p_handle->handle_->get_stream().get()); + auto weight_types = cugraph::host_scalar_allgather( + p_handle->handle_->get_comms(), static_cast(weight_type), p_handle->handle_->get_stream()); auto time_types = cugraph::host_scalar_allgather(p_handle->handle_->get_comms(), static_cast(edge_time_type), - p_handle->handle_->get_stream().get()); + p_handle->handle_->get_stream()); if (vertex_type == cugraph_data_type_id_t::NTYPES) { // Only true if this GPU had no vertex arrays @@ -790,7 +786,7 @@ extern "C" cugraph_error_code_t cugraph_graph_create_with_times_mg( auto edge_type_id_types = cugraph::host_scalar_allgather(p_handle->handle_->get_comms(), static_cast(edge_type_id_type), - p_handle->handle_->get_stream().get()); + p_handle->handle_->get_stream()); if (edge_type_id_type == cugraph_data_type_id_t::NTYPES) { // Only true if this GPU had no edge_type_id arrays diff --git a/cpp/src/c_api/neighbor_sample.cpp b/cpp/src/c_api/neighbor_sample.cpp index ab69d3a1ecd..f92b93ef453 100644 --- a/cpp/src/c_api/neighbor_sample.cpp +++ b/cpp/src/c_api/neighbor_sample.cpp @@ -207,7 +207,7 @@ struct neighbor_sampling_functor : public cugraph::c_api::abstract_functor { // count, so a rank's displacement into that space is both the offset to apply to its own // labels and its displacement into the concatenated label to rank mapping below. auto recvcounts = cugraph::host_scalar_allgather( - handle_.get_comms(), num_local_labels, handle_.get_stream().get()); + handle_.get_comms(), num_local_labels, handle_.get_stream()); std::vector displacements(recvcounts.size()); std::exclusive_scan( diff --git a/cpp/src/c_api/random.cpp b/cpp/src/c_api/random.cpp index c0e47ec4086..168d1abd3b2 100644 --- a/cpp/src/c_api/random.cpp +++ b/cpp/src/c_api/random.cpp @@ -102,7 +102,7 @@ extern "C" cugraph_error_code_t cugraph_rng_state_create(const cugraph_resource_ if (p_handle->handle_->comms_initialized()) { // need to verify that every seed is different auto seed_v = cugraph::host_scalar_allgather( - p_handle->handle_->get_comms(), seed, p_handle->handle_->get_stream().get()); + p_handle->handle_->get_comms(), seed, p_handle->handle_->get_stream()); std::sort(seed_v.begin(), seed_v.end()); if (std::unique(seed_v.begin(), seed_v.end()) != seed_v.end()) { *error = reinterpret_cast( diff --git a/cpp/src/centrality/betweenness_centrality_impl.cuh b/cpp/src/centrality/betweenness_centrality_impl.cuh index 06b5d266a1a..cfef2c414d2 100644 --- a/cpp/src/centrality/betweenness_centrality_impl.cuh +++ b/cpp/src/centrality/betweenness_centrality_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -334,7 +334,7 @@ void accumulate_vertex_results( vertex_t frontier_count = h_bounds[d] - h_bounds[d - 1]; if constexpr (multi_gpu) { frontier_count = host_scalar_allreduce( - handle.get_comms(), frontier_count, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), frontier_count, raft::comms::op_t::SUM, handle.get_stream()); } if (frontier_count > 0) { @@ -1318,10 +1318,8 @@ rmm::device_uvector betweenness_centrality( vertex_partition.in_local_vertex_partition_range_nocheck(val)); }); if constexpr (multi_gpu) { - num_invalid_vertices = host_scalar_allreduce(handle.get_comms(), - num_invalid_vertices, - raft::comms::op_t::SUM, - handle.get_stream().get()); + num_invalid_vertices = host_scalar_allreduce( + handle.get_comms(), num_invalid_vertices, raft::comms::op_t::SUM, handle.get_stream()); } CUGRAPH_EXPECTS(num_invalid_vertices == 0, "Invalid input argument: sources have invalid vertex IDs."); @@ -1340,7 +1338,7 @@ rmm::device_uvector betweenness_centrality( if constexpr (multi_gpu) { auto source_counts = - host_scalar_allgather(handle.get_comms(), num_sources, handle.get_stream().get()); + host_scalar_allgather(handle.get_comms(), num_sources, handle.get_stream()); num_sources = std::accumulate(source_counts.begin(), source_counts.end(), 0); source_offsets.resize(source_counts.size() + 1); @@ -1516,10 +1514,8 @@ edge_property_t edge_betweenness_centrality( vertex_partition.in_local_vertex_partition_range_nocheck(val)); }); if constexpr (multi_gpu) { - num_invalid_vertices = host_scalar_allreduce(handle.get_comms(), - num_invalid_vertices, - raft::comms::op_t::SUM, - handle.get_stream().get()); + num_invalid_vertices = host_scalar_allreduce( + handle.get_comms(), num_invalid_vertices, raft::comms::op_t::SUM, handle.get_stream()); } CUGRAPH_EXPECTS(num_invalid_vertices == 0, "Invalid input argument: sources have invalid vertex IDs."); @@ -1534,7 +1530,7 @@ edge_property_t edge_betweenness_centrality( if constexpr (multi_gpu) { auto source_counts = - host_scalar_allgather(handle.get_comms(), num_sources, handle.get_stream().get()); + host_scalar_allgather(handle.get_comms(), num_sources, handle.get_stream()); num_sources = std::accumulate(source_counts.begin(), source_counts.end(), 0); source_offsets.resize(source_counts.size() + 1); diff --git a/cpp/src/community/approx_weighted_matching_impl.cuh b/cpp/src/community/approx_weighted_matching_impl.cuh index 8832d6506d6..86cda764e2d 100644 --- a/cpp/src/community/approx_weighted_matching_impl.cuh +++ b/cpp/src/community/approx_weighted_matching_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -359,10 +359,8 @@ std::tuple, weight_t> approximate_weighted_matchin handle.get_thrust_policy(), offers_from_partners.begin(), offers_from_partners.end()); if constexpr (multi_gpu) { - sum_matched_edge_weights = host_scalar_allreduce(handle.get_comms(), - sum_matched_edge_weights, - raft::comms::op_t::SUM, - handle.get_stream().get()); + sum_matched_edge_weights = host_scalar_allreduce( + handle.get_comms(), sum_matched_edge_weights, raft::comms::op_t::SUM, handle.get_stream()); } return std::make_tuple(std::move(partners), sum_matched_edge_weights / 2.0); diff --git a/cpp/src/community/detail/common_methods.cuh b/cpp/src/community/detail/common_methods.cuh index af98956e88a..6b539d3cb9d 100644 --- a/cpp/src/community/detail/common_methods.cuh +++ b/cpp/src/community/detail/common_methods.cuh @@ -198,7 +198,7 @@ weight_t compute_modularity( if constexpr (multi_gpu) { sum_degree_squared = host_scalar_allreduce( - handle.get_comms(), sum_degree_squared, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), sum_degree_squared, raft::comms::op_t::SUM, handle.get_stream()); } // Sum(Sigma_in_c), over all clusters c @@ -433,7 +433,7 @@ rmm::device_uvector update_clustering_by_delta_modularity( if constexpr (multi_gpu) { nr_moves = host_scalar_allreduce( - handle.get_comms(), nr_moves, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), nr_moves, raft::comms::op_t::SUM, handle.get_stream()); } if (nr_moves == 0) { up_down = !up_down; } diff --git a/cpp/src/community/detail/maximal_independent_moves.cuh b/cpp/src/community/detail/maximal_independent_moves.cuh index fd3bd959e8d..4daba99fa0c 100644 --- a/cpp/src/community/detail/maximal_independent_moves.cuh +++ b/cpp/src/community/detail/maximal_independent_moves.cuh @@ -95,7 +95,7 @@ rmm::device_uvector maximal_independent_moves( nr_remaining_vertices_to_check = host_scalar_allreduce(handle.get_comms(), nr_remaining_vertices_to_check, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); } vertex_t nr_candidates = (nr_remaining_vertices_to_check < 1024) @@ -272,7 +272,7 @@ rmm::device_uvector maximal_independent_moves( nr_remaining_vertices_to_check = host_scalar_allreduce(handle.get_comms(), nr_remaining_vertices_to_check, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); } if (nr_remaining_vertices_to_check == 0) { break; } diff --git a/cpp/src/community/detail/refine_impl.cuh b/cpp/src/community/detail/refine_impl.cuh index 6ad3c037fe6..8e0938f1f90 100644 --- a/cpp/src/community/detail/refine_impl.cuh +++ b/cpp/src/community/detail/refine_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -317,7 +317,7 @@ refine_clustering(raft::handle_t const& handle, nr_remaining_active_vertices = host_scalar_allreduce(handle.get_comms(), nr_remaining_active_vertices, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); } if (nr_remaining_active_vertices == 0) { break; } @@ -580,10 +580,8 @@ refine_clustering(raft::handle_t const& handle, vertex_t total_nr_valid_tuples = nr_valid_tuples; if constexpr (multi_gpu) { - total_nr_valid_tuples = host_scalar_allreduce(handle.get_comms(), - total_nr_valid_tuples, - raft::comms::op_t::SUM, - handle.get_stream().get()); + total_nr_valid_tuples = host_scalar_allreduce( + handle.get_comms(), total_nr_valid_tuples, raft::comms::op_t::SUM, handle.get_stream()); } if (total_nr_valid_tuples == 0) { diff --git a/cpp/src/community/edge_triangle_count_impl.cuh b/cpp/src/community/edge_triangle_count_impl.cuh index 013a491ec6a..d996376b216 100644 --- a/cpp/src/community/edge_triangle_count_impl.cuh +++ b/cpp/src/community/edge_triangle_count_impl.cuh @@ -169,7 +169,7 @@ edge_property_t edge_triangle_count_impl( // auto my_rank = handle.get_comms().get_rank(); if constexpr (multi_gpu) { num_chunks = host_scalar_allreduce( - handle.get_comms(), num_chunks, raft::comms::op_t::MAX, handle.get_stream().get()); + handle.get_comms(), num_chunks, raft::comms::op_t::MAX, handle.get_stream()); } // Need to ensure that the vector has its values initialized to 0 before incrementing diff --git a/cpp/src/community/egonet_impl.cuh b/cpp/src/community/egonet_impl.cuh index bc33adc845c..514a6cf4e43 100644 --- a/cpp/src/community/egonet_impl.cuh +++ b/cpp/src/community/egonet_impl.cuh @@ -68,7 +68,7 @@ extract(raft::handle_t const& handle, if constexpr (multi_gpu) { source_start = - cugraph::host_scalar_allgather(handle.get_comms(), num_sources, handle.get_stream().get()); + cugraph::host_scalar_allgather(handle.get_comms(), num_sources, handle.get_stream()); num_sources = std::reduce(source_start.begin(), source_start.end()); std::exclusive_scan(source_start.begin(), source_start.end(), source_start.begin(), size_t{0}); } diff --git a/cpp/src/community/leiden_impl.cuh b/cpp/src/community/leiden_impl.cuh index da2b73b81bc..c30d15081dd 100644 --- a/cpp/src/community/leiden_impl.cuh +++ b/cpp/src/community/leiden_impl.cuh @@ -61,7 +61,7 @@ vertex_t remove_duplicates(raft::handle_t const& handle, rmm::device_uvector>, weight_t> leiden( auto nr_unique_leiden = static_cast(leiden_to_louvain_map.first.size()); if (graph_view_t::is_multi_gpu) { nr_unique_leiden = host_scalar_allreduce( - handle.get_comms(), nr_unique_leiden, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), nr_unique_leiden, raft::comms::op_t::SUM, handle.get_stream()); } terminate = terminate || (nr_unique_leiden == current_graph_view.number_of_vertices()); @@ -617,7 +617,7 @@ void relabel_cluster_ids(raft::handle_t const& handle, if constexpr (multi_gpu) { auto cluster_ids_size_per_rank = cugraph::host_scalar_allgather( - handle.get_comms(), unique_cluster_ids.size(), handle.get_stream().get()); + handle.get_comms(), unique_cluster_ids.size(), handle.get_stream()); std::vector cluster_ids_starts(cluster_ids_size_per_rank.size()); std::exclusive_scan(cluster_ids_size_per_rank.begin(), diff --git a/cpp/src/community/triangle_count_impl.cuh b/cpp/src/community/triangle_count_impl.cuh index 219117b39e8..a08977efb48 100644 --- a/cpp/src/community/triangle_count_impl.cuh +++ b/cpp/src/community/triangle_count_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -158,9 +158,9 @@ void triangle_count(raft::handle_t const& handle, graph_view.local_vertex_partition_range_last()}); if constexpr (multi_gpu) { - auto& comm = handle.get_comms(); - num_invalids = host_scalar_allreduce( - comm, num_invalids, raft::comms::op_t::SUM, handle.get_stream().get()); + auto& comm = handle.get_comms(); + num_invalids = + host_scalar_allreduce(comm, num_invalids, raft::comms::op_t::SUM, handle.get_stream()); } CUGRAPH_EXPECTS(num_invalids == 0, "Invalid input arguments: invalid vertex IDs in *vertices."); @@ -168,11 +168,11 @@ void triangle_count(raft::handle_t const& handle, } if (vertices.has_value()) { - auto aggregate_vertex_count = multi_gpu ? host_scalar_allreduce(handle.get_comms(), - (*vertices).size(), - raft::comms::op_t::SUM, - handle.get_stream().get()) - : (*vertices).size(); + auto aggregate_vertex_count = + multi_gpu + ? host_scalar_allreduce( + handle.get_comms(), (*vertices).size(), raft::comms::op_t::SUM, handle.get_stream()) + : (*vertices).size(); if (aggregate_vertex_count == 0) { return; } } diff --git a/cpp/src/components/mis_impl.cuh b/cpp/src/components/mis_impl.cuh index 8d6fe43abc0..a48ca07703e 100644 --- a/cpp/src/components/mis_impl.cuh +++ b/cpp/src/components/mis_impl.cuh @@ -105,7 +105,7 @@ rmm::device_uvector maximal_independent_set( nr_remaining_vertices_to_check = host_scalar_allreduce(handle.get_comms(), nr_remaining_vertices_to_check, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); } vertex_t nr_candidates = (nr_remaining_vertices_to_check < 1024) @@ -282,7 +282,7 @@ rmm::device_uvector maximal_independent_set( nr_remaining_vertices_to_check = host_scalar_allreduce(handle.get_comms(), nr_remaining_vertices_to_check, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); } if (nr_remaining_vertices_to_check == 0) { break; } diff --git a/cpp/src/components/strongly_connected_components_impl.cuh b/cpp/src/components/strongly_connected_components_impl.cuh index cd32f2ea6b2..18a8070a3c5 100644 --- a/cpp/src/components/strongly_connected_components_impl.cuh +++ b/cpp/src/components/strongly_connected_components_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -123,7 +123,7 @@ rmm::device_uvector find_trivial_singleton_ num_aggregate_candidate_vertices = host_scalar_allreduce(handle.get_comms(), num_aggregate_candidate_vertices, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); } if (num_aggregate_candidate_vertices == 0) { @@ -167,10 +167,8 @@ rmm::device_uvector find_trivial_singleton_ while (true) { aggregate_frontier_size = frontier_vertices.size(); if constexpr (multi_gpu) { - aggregate_frontier_size = host_scalar_allreduce(handle.get_comms(), - aggregate_frontier_size, - raft::comms::op_t::SUM, - handle.get_stream().get()); + aggregate_frontier_size = host_scalar_allreduce( + handle.get_comms(), aggregate_frontier_size, raft::comms::op_t::SUM, handle.get_stream()); } if (aggregate_frontier_size == 0) { break; } @@ -630,7 +628,7 @@ rmm::device_uvector find_trivial_singleton_ if constexpr (multi_gpu) { new_trivial_size = host_scalar_allreduce( - handle.get_comms(), new_trivial_size, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), new_trivial_size, raft::comms::op_t::SUM, handle.get_stream()); } if (new_trivial_size == 0) { break; } @@ -991,7 +989,7 @@ reachable_sets( auto aggregated_size = remaining_vertices.size(); if constexpr (GraphViewType::is_multi_gpu) { aggregated_size = host_scalar_allreduce( - handle.get_comms(), aggregated_size, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), aggregated_size, raft::comms::op_t::SUM, handle.get_stream()); } if (aggregated_size == size_t{0}) { break; } @@ -1874,7 +1872,7 @@ forward_backward_intersect( auto num_aggregate_pivots = pivots.size(); if constexpr (GraphViewType::is_multi_gpu) { num_aggregate_pivots = host_scalar_allreduce( - handle.get_comms(), num_aggregate_pivots, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), num_aggregate_pivots, raft::comms::op_t::SUM, handle.get_stream()); } rmm::device_uvector forward_set_offsets(0, handle.get_stream()); diff --git a/cpp/src/components/weakly_connected_components_impl.cuh b/cpp/src/components/weakly_connected_components_impl.cuh index 6d4cc3c623f..e413ec874f5 100644 --- a/cpp/src/components/weakly_connected_components_impl.cuh +++ b/cpp/src/components/weakly_connected_components_impl.cuh @@ -311,7 +311,7 @@ void weakly_connected_components_impl(raft::handle_t const& handle, auto const comm_size = comm.get_size(); #if 1 // FIXME: we should add host_allreduce to raft degree_sum_threshold = host_scalar_allreduce( - comm, degree_sum_threshold, raft::comms::op_t::SUM, handle.get_stream().get()); + comm, degree_sum_threshold, raft::comms::op_t::SUM, handle.get_stream()); #else comm.host_allreduce(std::addressof(degree_sum_threshold), std::addressof(degree_sum_threshold), @@ -389,8 +389,8 @@ void weakly_connected_components_impl(raft::handle_t const& handle, auto const comm_size = comm.get_size(); auto local_max_degree = max_degree; #if 1 // FIXME: we should add host_allreduce to raft - max_degree = host_scalar_allreduce( - comm, max_degree, raft::comms::op_t::MAX, handle.get_stream().get()); + max_degree = + host_scalar_allreduce(comm, max_degree, raft::comms::op_t::MAX, handle.get_stream()); #else comm.host_allreduce(std::addressof(max_degree), std::addressof(max_degree), @@ -399,8 +399,7 @@ void weakly_connected_components_impl(raft::handle_t const& handle, #endif max_v = (local_max_degree == max_degree) ? max_v : std::numeric_limits::max(); #if 1 // FIXME: we should add host_allreduce to raft - max_v = - host_scalar_allreduce(comm, max_v, raft::comms::op_t::MIN, handle.get_stream().get()); + max_v = host_scalar_allreduce(comm, max_v, raft::comms::op_t::MIN, handle.get_stream()); #else comm.host_allreduce( std::addressof(max_v), std::addressof(max_v), size_t{1}, raft::comms::op_t::MIN); @@ -589,7 +588,7 @@ void weakly_connected_components_impl(raft::handle_t const& handle, #if 1 // FIXME: we should add host_gather to raft auto first_candidate_degrees = - host_scalar_gather(comm, first_candidate_degree, 0, handle.get_stream().get()); + host_scalar_gather(comm, first_candidate_degree, 0, handle.get_stream()); #else std::vector first_candidate_degrees(comm_rank == 0 ? comm_size : 0, 0); comm.host_gather(std::addressof(first_candidate_degree), @@ -602,7 +601,7 @@ void weakly_connected_components_impl(raft::handle_t const& handle, auto new_root_candidate_count = new_root_candidates.size(); #if 1 // FIXME: we should add host_gather to raft new_root_candidate_counts = - host_scalar_gather(comm, new_root_candidate_count, 0, handle.get_stream().get()); + host_scalar_gather(comm, new_root_candidate_count, 0, handle.get_stream()); #else comm.host_gather(std::addressof(new_root_candidate_count), new_root_candidate_counts.data(), @@ -657,7 +656,7 @@ void weakly_connected_components_impl(raft::handle_t const& handle, #if 1 // FIXME: we should add host_scatter to raft init_max_new_roots = - host_scalar_scatter(comm, init_max_new_root_counts, 0, handle.get_stream().get()); + host_scalar_scatter(comm, init_max_new_root_counts, 0, handle.get_stream()); #else comm.host_scatter( init_max_new_root_counts.data(), std::addressof(init_max_new_roots), size_t{1}, int{0}); @@ -665,7 +664,7 @@ void weakly_connected_components_impl(raft::handle_t const& handle, } else { #if 1 // FIXME: we should add host_scatter to raft init_max_new_roots = - host_scalar_scatter(comm, std::vector{}, 0, handle.get_stream().get()); + host_scalar_scatter(comm, std::vector{}, 0, handle.get_stream()); #else comm.host_scatter(static_cast(nullptr), std::addressof(init_max_new_roots), @@ -884,7 +883,7 @@ void weakly_connected_components_impl(raft::handle_t const& handle, auto& comm = handle.get_comms(); #if 1 // FIXME: we should add host_allreduce to raft aggregate_num_inserts = host_scalar_allreduce( - comm, aggregate_num_inserts, raft::comms::op_t::SUM, handle.get_stream().get()); + comm, aggregate_num_inserts, raft::comms::op_t::SUM, handle.get_stream()); #else comm.host_allreduce(std::addressof(aggregate_num_inserts), std::addressof(aggregate_num_inserts), diff --git a/cpp/src/cores/core_number_impl.cuh b/cpp/src/cores/core_number_impl.cuh index a15f3fc955f..5d4d976a592 100644 --- a/cpp/src/cores/core_number_impl.cuh +++ b/cpp/src/cores/core_number_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -203,7 +203,7 @@ void core_number(raft::handle_t const& handle, auto& comm = handle.get_comms(); #if 1 // FIXME: we should add host_allreduce to raft aggregate_num_remaining_vertices = host_scalar_allreduce( - comm, aggregate_num_remaining_vertices, raft::comms::op_t::SUM, handle.get_stream().get()); + comm, aggregate_num_remaining_vertices, raft::comms::op_t::SUM, handle.get_stream()); #else comm.host_allreduce(std::addressof(aggregate_num_remaining_vertices), std::addressof(aggregate_num_remaining_vertices), @@ -347,8 +347,8 @@ void core_number(raft::handle_t const& handle, if constexpr (multi_gpu) { auto& comm = handle.get_comms(); #if 1 // FIXME: we should add host_allreduce to raft - min_core_number = host_scalar_allreduce( - comm, min_core_number, raft::comms::op_t::MIN, handle.get_stream().get()); + min_core_number = + host_scalar_allreduce(comm, min_core_number, raft::comms::op_t::MIN, handle.get_stream()); #else comm.host_allreduce(std::addressof(min_core_number), std::addressof(min_core_number), diff --git a/cpp/src/dag/topological_sort_impl.cuh b/cpp/src/dag/topological_sort_impl.cuh index ff6a36dfba8..9f2164f0fb5 100644 --- a/cpp/src/dag/topological_sort_impl.cuh +++ b/cpp/src/dag/topological_sort_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -101,10 +101,8 @@ rmm::device_uvector topological_sort( while (true) { auto aggregate_frontier_size = frontier_vertices.size(); if constexpr (multi_gpu) { - aggregate_frontier_size = host_scalar_allreduce(handle.get_comms(), - aggregate_frontier_size, - raft::comms::op_t::SUM, - handle.get_stream().get()); + aggregate_frontier_size = host_scalar_allreduce( + handle.get_comms(), aggregate_frontier_size, raft::comms::op_t::SUM, handle.get_stream()); } if (aggregate_frontier_size == 0) { break; } diff --git a/cpp/src/detail/device_comm_wrapper.cuh b/cpp/src/detail/device_comm_wrapper.cuh index 4fbbea6b3f7..df6da4df876 100644 --- a/cpp/src/detail/device_comm_wrapper.cuh +++ b/cpp/src/detail/device_comm_wrapper.cuh @@ -24,7 +24,7 @@ rmm::device_uvector device_allgatherv(raft::handle_t const& handle, raft::comms::comms_t const& comms, raft::device_span d_input) { - auto rx_sizes = cugraph::host_scalar_allgather(comms, d_input.size(), handle.get_stream().get()); + auto rx_sizes = cugraph::host_scalar_allgather(comms, d_input.size(), handle.get_stream()); std::vector rx_displs(static_cast(comms.get_size())); std::partial_sum(rx_sizes.begin(), rx_sizes.end() - 1, rx_displs.begin() + 1); diff --git a/cpp/src/detail/permute_range.cuh b/cpp/src/detail/permute_range.cuh index d329c70273d..853a6430516 100644 --- a/cpp/src/detail/permute_range.cuh +++ b/cpp/src/detail/permute_range.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -41,10 +41,10 @@ rmm::device_uvector permute_range(raft::handle_t const& handle, auto const comm_size = comm.get_size(); auto const comm_rank = comm.get_rank(); - auto global_start = cugraph::host_scalar_bcast( - handle.get_comms(), local_range_start, 0, handle.get_stream().get()); - auto sub_range_sizes = cugraph::host_scalar_allgather( - handle.get_comms(), local_range_size, handle.get_stream().get()); + auto global_start = + cugraph::host_scalar_bcast(handle.get_comms(), local_range_start, 0, handle.get_stream()); + auto sub_range_sizes = + cugraph::host_scalar_allgather(handle.get_comms(), local_range_size, handle.get_stream()); std::exclusive_scan( sub_range_sizes.begin(), sub_range_sizes.end(), sub_range_sizes.begin(), global_start); CUGRAPH_EXPECTS( @@ -153,7 +153,7 @@ rmm::device_uvector permute_range(raft::handle_t const& handle, permuted_integers.resize(local_range_size, handle.get_stream()); auto deficits = - cugraph::host_scalar_allgather(handle.get_comms(), nr_deficits, handle.get_stream().get()); + cugraph::host_scalar_allgather(handle.get_comms(), nr_deficits, handle.get_stream()); std::exclusive_scan(deficits.begin(), deficits.end(), deficits.begin(), vertex_t{0}); diff --git a/cpp/src/link_analysis/pagerank_impl.cuh b/cpp/src/link_analysis/pagerank_impl.cuh index c7846b4301a..2502c7fd818 100644 --- a/cpp/src/link_analysis/pagerank_impl.cuh +++ b/cpp/src/link_analysis/pagerank_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -69,7 +69,7 @@ centrality_algorithm_metadata_t pagerank( ? host_scalar_allreduce(handle.get_comms(), std::get<0>(*personalization).size(), raft::comms::op_t::SUM, - handle.get_stream().get()) + handle.get_stream()) : std::get<0>(*personalization).size() : vertex_t{0}; @@ -117,7 +117,7 @@ centrality_algorithm_metadata_t pagerank( host_scalar_allreduce(handle.get_comms(), personalization ? int{1} : int{0}, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); CUGRAPH_EXPECTS( (num_gpus_with_valid_personalization_vector == 0) || (num_gpus_with_valid_personalization_vector == handle.get_comms().get_size()), @@ -137,10 +137,8 @@ centrality_algorithm_metadata_t pagerank( vertex_partition.in_local_vertex_partition_range_nocheck(val)); }); if constexpr (GraphViewType::is_multi_gpu) { - num_invalid_vertices = host_scalar_allreduce(handle.get_comms(), - num_invalid_vertices, - raft::comms::op_t::SUM, - handle.get_stream().get()); + num_invalid_vertices = host_scalar_allreduce( + handle.get_comms(), num_invalid_vertices, raft::comms::op_t::SUM, handle.get_stream()); } CUGRAPH_EXPECTS(num_invalid_vertices == 0, "Invalid input argument: peresonalization vertices have invalid vertex IDs."); @@ -149,10 +147,8 @@ centrality_algorithm_metadata_t pagerank( std::get<1>(*personalization).end(), [] __device__(auto val) { return val < 0.0; }); if constexpr (GraphViewType::is_multi_gpu) { - num_negative_values = host_scalar_allreduce(handle.get_comms(), - num_negative_values, - raft::comms::op_t::SUM, - handle.get_stream().get()); + num_negative_values = host_scalar_allreduce( + handle.get_comms(), num_negative_values, raft::comms::op_t::SUM, handle.get_stream()); } CUGRAPH_EXPECTS(num_negative_values == 0, "Invalid input argument: peresonalization values should be non-negative."); @@ -211,7 +207,7 @@ centrality_algorithm_metadata_t pagerank( result_t{0.0}); if constexpr (GraphViewType::is_multi_gpu) { personalization_sum = host_scalar_allreduce( - handle.get_comms(), personalization_sum, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), personalization_sum, raft::comms::op_t::SUM, handle.get_stream()); } CUGRAPH_EXPECTS(personalization_sum > 0.0, "Invalid input argument: sum of personalization valuese " diff --git a/cpp/src/link_prediction/detail/similarity_impl.cuh b/cpp/src/link_prediction/detail/similarity_impl.cuh index fc7fcc6111b..e59aada4539 100644 --- a/cpp/src/link_prediction/detail/similarity_impl.cuh +++ b/cpp/src/link_prediction/detail/similarity_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -274,10 +274,8 @@ all_pairs_similarity(raft::handle_t const& handle, }); if constexpr (multi_gpu) { - num_invalid_vertices = cugraph::host_scalar_allreduce(handle.get_comms(), - num_invalid_vertices, - raft::comms::op_t::SUM, - handle.get_stream().get()); + num_invalid_vertices = cugraph::host_scalar_allreduce( + handle.get_comms(), num_invalid_vertices, raft::comms::op_t::SUM, handle.get_stream()); } CUGRAPH_EXPECTS(num_invalid_vertices == 0, @@ -297,7 +295,7 @@ all_pairs_similarity(raft::handle_t const& handle, num_negative_edge_weights = cugraph::host_scalar_allreduce(handle.get_comms(), num_negative_edge_weights, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); } CUGRAPH_EXPECTS( @@ -415,7 +413,7 @@ all_pairs_similarity(raft::handle_t const& handle, size_t num_batches = batch_offsets.size() - 1; if constexpr (multi_gpu) { num_batches = cugraph::host_scalar_allreduce( - handle.get_comms(), num_batches, raft::comms::op_t::MAX, handle.get_stream().get()); + handle.get_comms(), num_batches, raft::comms::op_t::MAX, handle.get_stream()); } for (size_t batch_number = 0; batch_number < num_batches; ++batch_number) { @@ -535,7 +533,7 @@ all_pairs_similarity(raft::handle_t const& handle, if constexpr (multi_gpu) { bool is_root = handle.get_comms().get_rank() == int{0}; auto rx_sizes = cugraph::host_scalar_gather( - handle.get_comms(), top_v1.size(), int{0}, handle.get_stream().get()); + handle.get_comms(), top_v1.size(), int{0}, handle.get_stream()); std::vector rx_displs; size_t gathered_size{0}; @@ -589,8 +587,8 @@ all_pairs_similarity(raft::handle_t const& handle, &similarity_threshold, top_score.data() + *topk - 1, 1, handle.get_stream()); } if constexpr (multi_gpu) { - similarity_threshold = host_scalar_bcast( - handle.get_comms(), similarity_threshold, int{0}, handle.get_stream().get()); + similarity_threshold = + host_scalar_bcast(handle.get_comms(), similarity_threshold, int{0}, handle.get_stream()); } } diff --git a/cpp/src/lookup/lookup_src_dst_impl.cuh b/cpp/src/lookup/lookup_src_dst_impl.cuh index f695a275dda..350b52e6efe 100644 --- a/cpp/src/lookup/lookup_src_dst_impl.cuh +++ b/cpp/src/lookup/lookup_src_dst_impl.cuh @@ -220,7 +220,7 @@ struct lookup_container_t::lookup_con cugraph::allocate_dataframe_buffer(edge_ids_to_lookup.size(), handle.get_stream()); if (multi_gpu) { auto& comm = handle.get_comms(); - auto rx_counts = host_scalar_allgather(comm, unique_types.size(), handle.get_stream().get()); + auto rx_counts = host_scalar_allgather(comm, unique_types.size(), handle.get_stream()); std::vector rx_displacements(rx_counts.size()); std::exclusive_scan(rx_counts.begin(), rx_counts.end(), rx_displacements.begin(), size_t{0}); rmm::device_uvector rx_unique_types(rx_displacements.back() + rx_counts.back(), diff --git a/cpp/src/sampling/detail/check_edge_bias_values.cuh b/cpp/src/sampling/detail/check_edge_bias_values.cuh index 781d1aaac81..68bf946bfc6 100644 --- a/cpp/src/sampling/detail/check_edge_bias_values.cuh +++ b/cpp/src/sampling/detail/check_edge_bias_values.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -48,12 +48,10 @@ std::tuple check_edge_bias_values( } if constexpr (multi_gpu) { - num_negative_edge_weights = host_scalar_allreduce(handle.get_comms(), - num_negative_edge_weights, - raft::comms::op_t::SUM, - handle.get_stream().get()); - num_overflows = host_scalar_allreduce( - handle.get_comms(), num_overflows, raft::comms::op_t::SUM, handle.get_stream().get()); + num_negative_edge_weights = host_scalar_allreduce( + handle.get_comms(), num_negative_edge_weights, raft::comms::op_t::SUM, handle.get_stream()); + num_overflows = host_scalar_allreduce( + handle.get_comms(), num_overflows, raft::comms::op_t::SUM, handle.get_stream()); } return std::make_tuple(num_negative_edge_weights, num_overflows); diff --git a/cpp/src/sampling/detail/deduplicate_edges_by_minor_impl.cuh b/cpp/src/sampling/detail/deduplicate_edges_by_minor_impl.cuh index 3dce013eb61..64d85184229 100644 --- a/cpp/src/sampling/detail/deduplicate_edges_by_minor_impl.cuh +++ b/cpp/src/sampling/detail/deduplicate_edges_by_minor_impl.cuh @@ -68,7 +68,7 @@ deduplicate_edges_by_minor(raft::handle_t const& handle, if constexpr (multi_gpu) { total_edges = host_scalar_allreduce( - handle.get_comms(), total_edges, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), total_edges, raft::comms::op_t::SUM, handle.get_stream()); } if (total_edges == 0) { diff --git a/cpp/src/sampling/detail/output_labels.cuh b/cpp/src/sampling/detail/output_labels.cuh index d4b99dff9f5..d2409ef6848 100644 --- a/cpp/src/sampling/detail/output_labels.cuh +++ b/cpp/src/sampling/detail/output_labels.cuh @@ -92,7 +92,7 @@ std::optional> compute_output_labels( if constexpr (multi_gpu) { max_label = host_scalar_allreduce( - handle.get_comms(), max_label, raft::comms::op_t::MAX, handle.get_stream().get()); + handle.get_comms(), max_label, raft::comms::op_t::MAX, handle.get_stream()); } rmm::device_uvector output_labels(static_cast(max_label + 1), diff --git a/cpp/src/sampling/detail/prepare_next_frontier_impl.cuh b/cpp/src/sampling/detail/prepare_next_frontier_impl.cuh index 6eba8e322c8..f0b39d6ccb1 100644 --- a/cpp/src/sampling/detail/prepare_next_frontier_impl.cuh +++ b/cpp/src/sampling/detail/prepare_next_frontier_impl.cuh @@ -93,12 +93,12 @@ prepare_next_frontier( host_scalar_allreduce(comm, static_cast(has_sampled_dst_window_starts ? 1 : 0), raft::comms::op_t::MAX, - handle.get_stream().get()) != 0; + handle.get_stream()) != 0; has_sampled_dst_window_ends = host_scalar_allreduce(comm, static_cast(has_sampled_dst_window_ends ? 1 : 0), raft::comms::op_t::MAX, - handle.get_stream().get()) != 0; + handle.get_stream()) != 0; } auto const carry_over = prior_sources_behavior == prior_sources_behavior_t::CARRY_OVER; diff --git a/cpp/src/sampling/detail/sample_outgoing_edges_impl.cuh b/cpp/src/sampling/detail/sample_outgoing_edges_impl.cuh index a2aabcbf8e7..0fbe345ab1b 100644 --- a/cpp/src/sampling/detail/sample_outgoing_edges_impl.cuh +++ b/cpp/src/sampling/detail/sample_outgoing_edges_impl.cuh @@ -1614,7 +1614,7 @@ sample_unvisited_outgoing_edges( sample_and_append = (host_scalar_allreduce(handle.get_comms(), carryover_frontier_majors.size(), raft::comms::op_t::SUM, - handle.get_stream().get()) > 0); + handle.get_stream()) > 0); } else { sample_and_append = carryover_frontier_majors.size() > 0; } diff --git a/cpp/src/sampling/negative_sampling_impl.cuh b/cpp/src/sampling/negative_sampling_impl.cuh index 3c73f8b6d06..25f4027d060 100644 --- a/cpp/src/sampling/negative_sampling_impl.cuh +++ b/cpp/src/sampling/negative_sampling_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -287,9 +287,8 @@ std::tuple, rmm::device_uvector> negativ std::vector samples_per_gpu; if constexpr (multi_gpu) { - samples_per_gpu = - host_scalar_allgather(handle.get_comms(), num_samples, handle.get_stream().get()); - total_samples = std::reduce(samples_per_gpu.begin(), samples_per_gpu.end()); + samples_per_gpu = host_scalar_allgather(handle.get_comms(), num_samples, handle.get_stream()); + total_samples = std::reduce(samples_per_gpu.begin(), samples_per_gpu.end()); } size_t samples_in_this_batch = total_samples; @@ -415,10 +414,8 @@ std::tuple, rmm::device_uvector> negativ if (exact_number_of_samples) { size_t current_sample_size = srcs.size(); if constexpr (multi_gpu) { - current_sample_size = cugraph::host_scalar_allreduce(handle.get_comms(), - current_sample_size, - raft::comms::op_t::SUM, - handle.get_stream().get()); + current_sample_size = cugraph::host_scalar_allreduce( + handle.get_comms(), current_sample_size, raft::comms::op_t::SUM, handle.get_stream()); } // FIXME: We could oversample and discard the unnecessary samples @@ -447,7 +444,7 @@ std::tuple, rmm::device_uvector> negativ // accommodate this situation. For now we'll just // uniformly(-ish) reduce the requested size. size_t total_extracted = host_scalar_allreduce( - handle.get_comms(), srcs.size(), raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), srcs.size(), raft::comms::op_t::SUM, handle.get_stream()); size_t reduction = total_samples - total_extracted; while (reduction > 0) { @@ -544,7 +541,7 @@ std::tuple, rmm::device_uvector> negativ srcs.resize(num_samples, handle.get_stream()); dsts.resize(num_samples, handle.get_stream()); auto deficits = - cugraph::host_scalar_allgather(handle.get_comms(), nr_deficits, handle.get_stream().get()); + cugraph::host_scalar_allgather(handle.get_comms(), nr_deficits, handle.get_stream()); std::exclusive_scan(deficits.begin(), deficits.end(), deficits.begin(), vertex_t{0}); diff --git a/cpp/src/sampling/neighbor_sampling_impl.cuh b/cpp/src/sampling/neighbor_sampling_impl.cuh index 30635743eb4..ea42af3a13c 100644 --- a/cpp/src/sampling/neighbor_sampling_impl.cuh +++ b/cpp/src/sampling/neighbor_sampling_impl.cuh @@ -194,10 +194,8 @@ neighbor_sample_impl(raft::handle_t const& handle, size_t local_frontier_size = (hop == 0) ? starting_vertices.size() : frontier_vertices.size(); size_t frontier_size = local_frontier_size; if constexpr (multi_gpu) { - frontier_size = host_scalar_allreduce(handle.get_comms(), - local_frontier_size, - raft::comms::op_t::SUM, - handle.get_stream().get()); + frontier_size = host_scalar_allreduce( + handle.get_comms(), local_frontier_size, raft::comms::op_t::SUM, handle.get_stream()); } if (frontier_size == 0) { break; } } diff --git a/cpp/src/sampling/random_walks_impl.cuh b/cpp/src/sampling/random_walks_impl.cuh index 00929b65517..0ae25114c31 100644 --- a/cpp/src/sampling/random_walks_impl.cuh +++ b/cpp/src/sampling/random_walks_impl.cuh @@ -365,7 +365,7 @@ struct node2vec_selector { auto recv_counts = cugraph::host_scalar_allgather( handle.get_subcomm(cugraph::partition_manager::minor_comm_name()), current_vertices.size(), - handle.get_stream().get()); + handle.get_stream()); std::vector displacements(recv_counts.size()); std::exclusive_scan(recv_counts.begin(), recv_counts.end(), displacements.begin(), size_t{0}); @@ -410,7 +410,7 @@ struct node2vec_selector { recv_counts = cugraph::host_scalar_allgather( handle.get_subcomm(cugraph::partition_manager::minor_comm_name()), intersection_offsets.back_element(handle.get_stream().get()), - handle.get_stream().get()); + handle.get_stream()); displacements.resize(recv_counts.size()); std::exclusive_scan(recv_counts.begin(), recv_counts.end(), displacements.begin(), size_t{0}); diff --git a/cpp/src/sampling/temporal_sampling_impl.cuh b/cpp/src/sampling/temporal_sampling_impl.cuh index 4fc21b5e7fb..a9224fdd13e 100644 --- a/cpp/src/sampling/temporal_sampling_impl.cuh +++ b/cpp/src/sampling/temporal_sampling_impl.cuh @@ -679,7 +679,7 @@ temporal_neighbor_sample_impl( size_t frontier_size = frontier_vertices.size(); if constexpr (multi_gpu) { frontier_size = host_scalar_allreduce( - handle.get_comms(), frontier_size, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), frontier_size, raft::comms::op_t::SUM, handle.get_stream()); } if (frontier_size == 0) { break; } } diff --git a/cpp/src/structure/create_graph_from_edgelist_impl.cuh b/cpp/src/structure/create_graph_from_edgelist_impl.cuh index 9cb0ee670cb..22b8cef2f9b 100644 --- a/cpp/src/structure/create_graph_from_edgelist_impl.cuh +++ b/cpp/src/structure/create_graph_from_edgelist_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -140,7 +140,7 @@ void expensive_check_edgelist(raft::handle_t const& handle, auto num_unique_vertices = vertices->size(); #if 1 // FIXME: we should add host_allreduce to raft num_unique_vertices = host_scalar_allreduce( - comm, num_unique_vertices, raft::comms::op_t::SUM, handle.get_stream().get()); + comm, num_unique_vertices, raft::comms::op_t::SUM, handle.get_stream()); #else comm.host_allreduce(std::addressof(num_unique_vertices), std::addressof(num_unique_vertices), @@ -182,8 +182,7 @@ void expensive_check_edgelist(raft::handle_t const& handle, rmm::device_uvector sorted_majors(0, handle.get_stream()); { #if 1 // FIXME: we should add host_allgather to raft - auto recvcounts = - host_scalar_allgather(minor_comm, vertices->size(), handle.get_stream().get()); + auto recvcounts = host_scalar_allgather(minor_comm, vertices->size(), handle.get_stream()); #else std::vector recvcounts(minor_comm_size, 0); recvcounts[minor_comm_rank] = vertices->size(); @@ -204,8 +203,7 @@ void expensive_check_edgelist(raft::handle_t const& handle, rmm::device_uvector sorted_minors(0, handle.get_stream()); { #if 1 // FIXME: we should add host_allgather to raft - auto recvcounts = - host_scalar_allgather(major_comm, vertices->size(), handle.get_stream().get()); + auto recvcounts = host_scalar_allgather(major_comm, vertices->size(), handle.get_stream()); #else std::vector recvcounts(major_comm_size, 0); recvcounts[major_comm_rank] = vertices->size(); diff --git a/cpp/src/structure/graph_impl.cuh b/cpp/src/structure/graph_impl.cuh index 2bec7a76568..6a4ce241d79 100644 --- a/cpp/src/structure/graph_impl.cuh +++ b/cpp/src/structure/graph_impl.cuh @@ -178,7 +178,7 @@ update_local_sorted_unique_edge_majors_minors( comm, static_cast(num_local_unique_edge_minors) / static_cast(minor_range_size), raft::comms::op_t::MAX, - handle.get_stream().get()); + handle.get_stream()); if (max_minor_properties_fill_ratio < detail::edge_partition_src_dst_property_values_kv_pair_fill_ratio_threshold) { @@ -291,7 +291,7 @@ update_local_sorted_unique_edge_majors_minors( static_cast(aggregate_major_range_size); #if 1 // FIXME: we should add host_allreduce to raft max_major_properties_fill_ratio = host_scalar_allreduce( - comm, max_major_properties_fill_ratio, raft::comms::op_t::MAX, handle.get_stream().get()); + comm, max_major_properties_fill_ratio, raft::comms::op_t::MAX, handle.get_stream()); #else comm.host_allreduce(std::addressof(max_major_properties_fill_ratio), std::addressof(max_major_properties_fill_ratio), diff --git a/cpp/src/structure/graph_view_impl.cuh b/cpp/src/structure/graph_view_impl.cuh index 836fbe6f734..85817e18b45 100644 --- a/cpp/src/structure/graph_view_impl.cuh +++ b/cpp/src/structure/graph_view_impl.cuh @@ -624,8 +624,8 @@ edge_t graph_view_t find_locally_unused_ext_vertex_id( } auto tmp = static_cast(ret.has_value()); #if 1 // FIXME: we should add host_allreduce to raft - tmp = host_scalar_allreduce(comm, tmp, raft::comms::op_t::MIN, handle.get_stream().get()); + tmp = host_scalar_allreduce(comm, tmp, raft::comms::op_t::MIN, handle.get_stream()); #else comm.host_allreduce( std::addressof(tmp), std::addressof(tmp), size_t{1}, raft::comms::op_t::MIN); @@ -269,8 +269,8 @@ std::optional find_locally_unused_ext_vertex_id( if (multi_gpu && (handle.get_comms().get_size() > int{1})) { auto& comm = handle.get_comms(); #if 1 // FIXME: we should add host_allreduce to raft - min = host_scalar_allreduce(comm, min, raft::comms::op_t::MIN, handle.get_stream().get()); - max = host_scalar_allreduce(comm, max, raft::comms::op_t::MAX, handle.get_stream().get()); + min = host_scalar_allreduce(comm, min, raft::comms::op_t::MIN, handle.get_stream()); + max = host_scalar_allreduce(comm, max, raft::comms::op_t::MAX, handle.get_stream()); #else comm.host_allreduce( std::addressof(min), std::addressof(min), size_t{1}, raft::comms::op_t::MIN); @@ -317,8 +317,7 @@ std::optional find_locally_unused_ext_vertex_id( if (multi_gpu && (handle.get_comms().get_size() > int{1})) { auto& comm = handle.get_comms(); #if 1 // FIXME: we should add host_allreduce to raft - unused_id = - host_scalar_allreduce(comm, unused_id, raft::comms::op_t::MIN, handle.get_stream().get()); + unused_id = host_scalar_allreduce(comm, unused_id, raft::comms::op_t::MIN, handle.get_stream()); #else comm.host_allreduce( std::addressof(unused_id), std::addressof(unused_id), size_t{1}, raft::comms::op_t::MIN); @@ -639,13 +638,13 @@ compute_renumber_map(raft::handle_t const& handle, assert(edgelist_majors.size() == minor_comm_size); auto edge_partition_major_range_sizes = - host_scalar_allgather(minor_comm, sorted_local_vertices.size(), handle.get_stream().get()); + host_scalar_allgather(minor_comm, sorted_local_vertices.size(), handle.get_stream()); for (int i = 0; i < minor_comm_size; ++i) { - auto sorted_majors = large_vertex_buffer_type - ? large_buffer_manager::allocate_memory_buffer( - edge_partition_major_range_sizes[i], handle.get_stream().get()) - : rmm::device_uvector(edge_partition_major_range_sizes[i], - handle.get_stream().get()); + auto sorted_majors = + large_vertex_buffer_type + ? large_buffer_manager::allocate_memory_buffer( + edge_partition_major_range_sizes[i], handle.get_stream().get()) + : rmm::device_uvector(edge_partition_major_range_sizes[i], handle.get_stream().get()); device_bcast(minor_comm, sorted_local_vertices.data(), sorted_majors.data(), @@ -942,8 +941,8 @@ void expensive_check_edgelist( "Invalid input argument: local_vertices should be pre-shuffled."); rmm::device_uvector sorted_minors(0, handle.get_stream()); - auto recvcounts = host_scalar_allgather( - major_comm, (*sorted_local_vertices).size(), handle.get_stream().get()); + auto recvcounts = + host_scalar_allgather(major_comm, (*sorted_local_vertices).size(), handle.get_stream()); std::vector displacements(recvcounts.size(), size_t{0}); std::partial_sum(recvcounts.begin(), recvcounts.end() - 1, displacements.begin() + 1); sorted_minors.resize(displacements.back() + recvcounts.back(), handle.get_stream()); @@ -955,8 +954,8 @@ void expensive_check_edgelist( handle.get_stream()); cugraph::sort(handle.get_thrust_policy(), sorted_minors.begin(), sorted_minors.end()); - auto major_range_sizes = host_scalar_allgather( - minor_comm, (*sorted_local_vertices).size(), handle.get_stream().get()); + auto major_range_sizes = + host_scalar_allgather(minor_comm, (*sorted_local_vertices).size(), handle.get_stream()); for (size_t i = 0; i < edgelist_majors.size(); ++i) { rmm::device_uvector sorted_majors(0, handle.get_stream()); { @@ -1026,10 +1025,8 @@ std::vector aggregate_offset_vectors(raft::handle_t const& handle, raft::update_device(d_offsets.data(), offsets.data(), offsets.size(), handle.get_stream()); rmm::device_uvector d_aggregate_offset_vectors(minor_comm_size * d_offsets.size(), handle.get_stream()); - minor_comm.allgather(d_offsets.data(), - d_aggregate_offset_vectors.data(), - d_offsets.size(), - handle.get_stream().get()); + minor_comm.allgather( + d_offsets.data(), d_aggregate_offset_vectors.data(), d_offsets.size(), handle.get_stream().get()); std::vector h_aggregate_offset_vectors(d_aggregate_offset_vectors.size(), vertex_t{0}); raft::update_host(h_aggregate_offset_vectors.data(), @@ -1139,13 +1136,12 @@ renumber_edgelist( // 2. initialize partition_t object, number_of_vertices, and number_of_edges #if 1 // FIXME: we should add host_allgather to raft - auto vertex_counts = - host_scalar_allgather(comm, renumber_map_labels.size(), handle.get_stream().get()); + auto vertex_counts = host_scalar_allgather(comm, renumber_map_labels.size(), handle.get_stream()); auto vertex_partition_ids = host_scalar_allgather(comm, partition_manager::compute_vertex_partition_id_from_graph_subcomm_ranks( major_comm_size, minor_comm_size, major_comm_rank, minor_comm_rank), - handle.get_stream().get()); + handle.get_stream()); #else std::vector vertex_counts(comm_size, 0); std::vector vertex_partition_ids(comm_size, 0); @@ -1184,7 +1180,7 @@ renumber_edgelist( std::accumulate(edgelist_edge_counts.begin(), edgelist_edge_counts.end(), edge_t{0}); #if 1 // FIXME: we should add host_allreduce to raft number_of_edges = - host_scalar_allreduce(comm, number_of_edges, raft::comms::op_t::SUM, handle.get_stream().get()); + host_scalar_allreduce(comm, number_of_edges, raft::comms::op_t::SUM, handle.get_stream()); #else comm.host_allreduce(std::addressof(number_of_edges), std::addressof(number_of_edges), diff --git a/cpp/src/structure/renumber_utils_impl.cuh b/cpp/src/structure/renumber_utils_impl.cuh index 98b9fd74a79..46d3d9a8746 100644 --- a/cpp/src/structure/renumber_utils_impl.cuh +++ b/cpp/src/structure/renumber_utils_impl.cuh @@ -162,7 +162,7 @@ void unrenumber_local_int_edges( auto number_of_edges = std::reduce(edgelist_edge_counts.begin(), edgelist_edge_counts.end()); #if 1 // FIXME: we should add host_allreduce to raft number_of_edges = - host_scalar_allreduce(comm, number_of_edges, raft::comms::op_t::SUM, handle.get_stream().get()); + host_scalar_allreduce(comm, number_of_edges, raft::comms::op_t::SUM, handle.get_stream()); #else comm.host_allreduce(std::addressof(number_of_edges), std::addressof(number_of_edges), diff --git a/cpp/src/structure/select_random_vertices_impl.cuh b/cpp/src/structure/select_random_vertices_impl.cuh index 385f2f45b89..02cd9db70ae 100644 --- a/cpp/src/structure/select_random_vertices_impl.cuh +++ b/cpp/src/structure/select_random_vertices_impl.cuh @@ -62,7 +62,7 @@ rmm::device_uvector select_random_vertices( num_of_elements_in_given_set = host_scalar_allreduce(handle.get_comms(), num_of_elements_in_given_set, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); } CUGRAPH_EXPECTS( with_replacement || select_count <= num_of_elements_in_given_set, @@ -212,7 +212,7 @@ rmm::device_uvector select_random_vertices( } auto buffer_sizes = cugraph::host_scalar_allgather( - handle.get_comms(), mg_sample_buffer.size(), handle.get_stream().get()); + handle.get_comms(), mg_sample_buffer.size(), handle.get_stream()); auto min_buffer_size = *std::min_element(buffer_sizes.begin(), buffer_sizes.end()); if (min_buffer_size <= select_count / comm_size) { auto new_sizes = std::vector(comm_size, min_buffer_size); diff --git a/cpp/src/traversal/bfs_impl.cuh b/cpp/src/traversal/bfs_impl.cuh index 50f5229f177..6fcba420db0 100644 --- a/cpp/src/traversal/bfs_impl.cuh +++ b/cpp/src/traversal/bfs_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -184,7 +184,7 @@ void bfs(raft::handle_t const& handle, auto aggregate_n_sources = n_sources; #if 1 // FIXME: we should add host_allreduce to raft aggregate_n_sources = host_scalar_allreduce( - handle.get_comms(), aggregate_n_sources, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), aggregate_n_sources, raft::comms::op_t::SUM, handle.get_stream()); #else handle.get_comms().host_allreduce(std::addressof(aggregate_n_sources), std::addressof(aggregate_n_sources), @@ -211,8 +211,8 @@ void bfs(raft::handle_t const& handle, if constexpr (GraphViewType::is_multi_gpu) { auto tmp = static_cast(is_sorted); #if 1 // FIXME: we should add host_allreduce to raft - tmp = host_scalar_allreduce( - handle.get_comms(), tmp, raft::comms::op_t::MIN, handle.get_stream().get()); + tmp = + host_scalar_allreduce(handle.get_comms(), tmp, raft::comms::op_t::MIN, handle.get_stream()); #else handle.get_comms().host_allreduce( std::addressof(tmp), std::addressof(tmp), size_t{1}, raft::comms::op_t::MIN); @@ -231,8 +231,8 @@ void bfs(raft::handle_t const& handle, if constexpr (GraphViewType::is_multi_gpu) { auto tmp = static_cast(no_duplicates); #if 1 // FIXME: we should add host_allreduce to raft - tmp = host_scalar_allreduce( - handle.get_comms(), tmp, raft::comms::op_t::MIN, handle.get_stream().get()); + tmp = + host_scalar_allreduce(handle.get_comms(), tmp, raft::comms::op_t::MIN, handle.get_stream()); #else handle.get_comms().host_allreduce( std::addressof(tmp), std::addressof(tmp), size_t{1}, raft::comms::op_t::MIN); @@ -252,10 +252,8 @@ void bfs(raft::handle_t const& handle, }); if constexpr (GraphViewType::is_multi_gpu) { #if 1 // FIXME: we should add host_allreduce to raft - num_invalid_vertices = host_scalar_allreduce(handle.get_comms(), - num_invalid_vertices, - raft::comms::op_t::SUM, - handle.get_stream().get()); + num_invalid_vertices = host_scalar_allreduce( + handle.get_comms(), num_invalid_vertices, raft::comms::op_t::SUM, handle.get_stream()); #else handle.get_comms().host_allreduce(std::addressof(num_invalid_vertices), std::addressof(num_invalid_vertices), @@ -436,10 +434,8 @@ void bfs(raft::handle_t const& handle, vertex_t cur_aggregate_frontier_size = cur_frontier_view.size(); if constexpr (GraphViewType::is_multi_gpu) { #if 1 // FIXME: we should add host_allreduce to raft - cur_aggregate_frontier_size = host_scalar_allreduce(handle.get_comms(), - cur_aggregate_frontier_size, - raft::comms::op_t::SUM, - handle.get_stream().get()); + cur_aggregate_frontier_size = host_scalar_allreduce( + handle.get_comms(), cur_aggregate_frontier_size, raft::comms::op_t::SUM, handle.get_stream()); #else handle.get_comms().host_allreduce(std::addressof(cur_aggregate_frontier_size), std::addressof(cur_aggregate_frontier_size), @@ -602,12 +598,12 @@ void bfs(raft::handle_t const& handle, next_aggregate_frontier_size = host_scalar_allreduce(handle.get_comms(), next_aggregate_frontier_size, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); if (direction_optimizing) { aggregate_m_f = host_scalar_allreduce( - handle.get_comms(), *m_f, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), *m_f, raft::comms::op_t::SUM, handle.get_stream()); aggregate_m_u = host_scalar_allreduce( - handle.get_comms(), *m_u, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), *m_u, raft::comms::op_t::SUM, handle.get_stream()); } #else size_t* h_staging_buffer_ptr = reinterpret_cast(h_staging_buffer_view.data()); @@ -819,11 +815,11 @@ void bfs(raft::handle_t const& handle, next_aggregate_frontier_size = host_scalar_allreduce(handle.get_comms(), next_aggregate_frontier_size, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); aggregate_nzd_unvisited_vertices = host_scalar_allreduce(handle.get_comms(), aggregate_nzd_unvisited_vertices, raft::comms::op_t::SUM, - handle.get_stream().get()); + handle.get_stream()); #else vertex_t* h_staging_buffer_ptr = reinterpret_cast(h_staging_buffer_view.data()); assert(h_staging_buffer_view.size() >= 2); diff --git a/cpp/src/traversal/extract_bfs_paths_impl.cuh b/cpp/src/traversal/extract_bfs_paths_impl.cuh index f5a0177c9ea..b9e997ccf08 100644 --- a/cpp/src/traversal/extract_bfs_paths_impl.cuh +++ b/cpp/src/traversal/extract_bfs_paths_impl.cuh @@ -174,7 +174,7 @@ std::tuple, vertex_t> extract_bfs_paths( if constexpr (multi_gpu) { max_path_length = cugraph::host_scalar_allreduce( - handle.get_comms(), max_path_length, raft::comms::op_t::MAX, handle.get_stream().get()); + handle.get_comms(), max_path_length, raft::comms::op_t::MAX, handle.get_stream()); } rmm::device_uvector paths(n_destinations * max_path_length, handle.get_stream()); diff --git a/cpp/src/traversal/k_hop_nbrs_impl.cuh b/cpp/src/traversal/k_hop_nbrs_impl.cuh index 47b4453e0a0..c6232464e1f 100644 --- a/cpp/src/traversal/k_hop_nbrs_impl.cuh +++ b/cpp/src/traversal/k_hop_nbrs_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -81,7 +81,7 @@ k_hop_nbrs(raft::handle_t const& handle, std::vector start_vertex_counts{}; if constexpr (GraphViewType::is_multi_gpu) { start_vertex_counts = - host_scalar_allgather(handle.get_comms(), start_vertices.size(), handle.get_stream().get()); + host_scalar_allgather(handle.get_comms(), start_vertices.size(), handle.get_stream()); } else { start_vertex_counts = std::vector{start_vertices.size()}; } @@ -111,10 +111,8 @@ k_hop_nbrs(raft::handle_t const& handle, vertex_partition.in_local_vertex_partition_range_nocheck(val)); }); if constexpr (GraphViewType::is_multi_gpu) { - num_invalid_vertices = host_scalar_allreduce(handle.get_comms(), - num_invalid_vertices, - raft::comms::op_t::SUM, - handle.get_stream().get()); + num_invalid_vertices = host_scalar_allreduce( + handle.get_comms(), num_invalid_vertices, raft::comms::op_t::SUM, handle.get_stream()); } CUGRAPH_EXPECTS(num_invalid_vertices == 0, "Invalid input argument: start_vertices have invalid vertex IDs."); diff --git a/cpp/src/traversal/sssp_impl.cuh b/cpp/src/traversal/sssp_impl.cuh index 2918b77f88e..41f3d1ce080 100644 --- a/cpp/src/traversal/sssp_impl.cuh +++ b/cpp/src/traversal/sssp_impl.cuh @@ -252,7 +252,7 @@ void sssp(raft::handle_t const& handle, static_cast(handle.get_device_properties().multiProcessorCount); if constexpr (GraphViewType::is_multi_gpu) { aggregate_sm_counts = host_scalar_allreduce( - handle.get_comms(), aggregate_sm_counts, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), aggregate_sm_counts, raft::comms::op_t::SUM, handle.get_stream()); } max_near_near_q_size = std::min(static_cast( diff --git a/cpp/src/utilities/shuffle_vertex_pairs.cuh b/cpp/src/utilities/shuffle_vertex_pairs.cuh index f9d1c59cc0d..5f97309916e 100644 --- a/cpp/src/utilities/shuffle_vertex_pairs.cuh +++ b/cpp/src/utilities/shuffle_vertex_pairs.cuh @@ -112,7 +112,7 @@ shuffle_vertex_pairs_with_values_by_gpu_id_impl( { auto flag = majors.size() > mem_frugal_threshold ? int{1} : int{0}; #if 1 // FIXME: we should add host_allreduce to raft - flag = host_scalar_allreduce(comm, flag, raft::comms::op_t::MAX, handle.get_stream().get()); + flag = host_scalar_allreduce(comm, flag, raft::comms::op_t::MAX, handle.get_stream()); #else comm.host_allreduce( std::addressof(flag), std::addressof(flag), size_t{1}, raft::comms::op_t::MAX); diff --git a/cpp/src/utilities/validation_checks_impl.cuh b/cpp/src/utilities/validation_checks_impl.cuh index 8bcd21f12f4..3b017ed7132 100644 --- a/cpp/src/utilities/validation_checks_impl.cuh +++ b/cpp/src/utilities/validation_checks_impl.cuh @@ -36,7 +36,7 @@ size_t count_invalid_vertices( }); if constexpr (multi_gpu) { num_invalid_vertices = cugraph::host_scalar_allreduce( - handle.get_comms(), num_invalid_vertices, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), num_invalid_vertices, raft::comms::op_t::SUM, handle.get_stream()); } return num_invalid_vertices; diff --git a/cpp/tests/c_api/test_utils.cpp b/cpp/tests/c_api/test_utils.cpp index a651a6317de..50ca9d5a559 100644 --- a/cpp/tests/c_api/test_utils.cpp +++ b/cpp/tests/c_api/test_utils.cpp @@ -477,7 +477,7 @@ extern "C" size_t cugraph_size_t_allreduce(const cugraph_resource_handle_t* hand return cugraph::host_scalar_allreduce(internal_handle->handle_->get_comms(), value, raft::comms::op_t::SUM, - internal_handle->handle_->get_stream().get()); + internal_handle->handle_->get_stream()); } extern "C" int validate_sample_result(const cugraph_resource_handle_t* handle, diff --git a/cpp/tests/sampling/detail/nbr_sampling_validate_empty_result.cuh b/cpp/tests/sampling/detail/nbr_sampling_validate_empty_result.cuh index afbe128db32..e7a9bc6f40e 100644 --- a/cpp/tests/sampling/detail/nbr_sampling_validate_empty_result.cuh +++ b/cpp/tests/sampling/detail/nbr_sampling_validate_empty_result.cuh @@ -111,7 +111,7 @@ bool validate_sampling_empty_result( if constexpr (multi_gpu) { num_eligible = cugraph::host_scalar_allreduce( - handle.get_comms(), num_eligible, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), num_eligible, raft::comms::op_t::SUM, handle.get_stream()); } return num_eligible == 0; @@ -222,7 +222,7 @@ bool validate_sampling_empty_result( if constexpr (multi_gpu) { num_eligible = cugraph::host_scalar_allreduce( - handle.get_comms(), num_eligible, raft::comms::op_t::SUM, handle.get_stream().get()); + handle.get_comms(), num_eligible, raft::comms::op_t::SUM, handle.get_stream()); } return num_eligible == 0; diff --git a/cpp/tests/utilities/test_graphs.hpp b/cpp/tests/utilities/test_graphs.hpp index 8bbb22ad5b9..f62438a4cb7 100644 --- a/cpp/tests/utilities/test_graphs.hpp +++ b/cpp/tests/utilities/test_graphs.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -602,8 +602,7 @@ construct_graph( size_t base_offset{0}; if constexpr (multi_gpu) { - auto base_offsets = - host_scalar_allgather(handle.get_comms(), num_edges, handle.get_stream().get()); + auto base_offsets = host_scalar_allgather(handle.get_comms(), num_edges, handle.get_stream()); handle.sync_stream(); std::exclusive_scan(base_offsets.begin(), base_offsets.end(), base_offsets.begin(), size_t{0}); base_offset = base_offsets[handle.get_comms().get_rank()]; From 73def00bfcde7e38812b6ea7567cb04ae005514e Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Sun, 6 Sep 2026 09:34:56 -0500 Subject: [PATCH 06/10] Apply migration style checks --- ...rm_reduce_dst_key_aggregated_outgoing_e.cuh | 2 +- .../cugraph/utilities/host_scalar_comm.hpp | 2 +- cpp/src/c_api/bfs.cpp | 2 +- cpp/src/c_api/random.cpp | 2 +- .../centrality/betweenness_centrality_impl.cuh | 2 +- cpp/src/detail/permute_range.cuh | 2 +- cpp/src/sampling/negative_sampling_impl.cuh | 2 +- cpp/src/structure/renumber_edgelist_impl.cuh | 18 ++++++++++-------- cpp/src/utilities/validation_checks_impl.cuh | 2 +- 9 files changed, 18 insertions(+), 16 deletions(-) diff --git a/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh b/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh index 580e88787ea..de30cc19381 100644 --- a/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh +++ b/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh @@ -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 diff --git a/cpp/include/cugraph/utilities/host_scalar_comm.hpp b/cpp/include/cugraph/utilities/host_scalar_comm.hpp index 4f3640f51a1..bdb919cc395 100644 --- a/cpp/include/cugraph/utilities/host_scalar_comm.hpp +++ b/cpp/include/cugraph/utilities/host_scalar_comm.hpp @@ -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 diff --git a/cpp/src/c_api/bfs.cpp b/cpp/src/c_api/bfs.cpp index 1325a405eb0..63b121d644d 100644 --- a/cpp/src/c_api/bfs.cpp +++ b/cpp/src/c_api/bfs.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ diff --git a/cpp/src/c_api/random.cpp b/cpp/src/c_api/random.cpp index 168d1abd3b2..fbaf4e9a701 100644 --- a/cpp/src/c_api/random.cpp +++ b/cpp/src/c_api/random.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ diff --git a/cpp/src/centrality/betweenness_centrality_impl.cuh b/cpp/src/centrality/betweenness_centrality_impl.cuh index cfef2c414d2..74718148e98 100644 --- a/cpp/src/centrality/betweenness_centrality_impl.cuh +++ b/cpp/src/centrality/betweenness_centrality_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/cpp/src/detail/permute_range.cuh b/cpp/src/detail/permute_range.cuh index 853a6430516..a166b31c3fc 100644 --- a/cpp/src/detail/permute_range.cuh +++ b/cpp/src/detail/permute_range.cuh @@ -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 */ diff --git a/cpp/src/sampling/negative_sampling_impl.cuh b/cpp/src/sampling/negative_sampling_impl.cuh index 25f4027d060..3350a6900c7 100644 --- a/cpp/src/sampling/negative_sampling_impl.cuh +++ b/cpp/src/sampling/negative_sampling_impl.cuh @@ -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 */ diff --git a/cpp/src/structure/renumber_edgelist_impl.cuh b/cpp/src/structure/renumber_edgelist_impl.cuh index 04d931f1ba1..e2eb2a39f4a 100644 --- a/cpp/src/structure/renumber_edgelist_impl.cuh +++ b/cpp/src/structure/renumber_edgelist_impl.cuh @@ -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 @@ -640,11 +640,11 @@ compute_renumber_map(raft::handle_t const& handle, auto edge_partition_major_range_sizes = host_scalar_allgather(minor_comm, sorted_local_vertices.size(), handle.get_stream()); for (int i = 0; i < minor_comm_size; ++i) { - auto sorted_majors = - large_vertex_buffer_type - ? large_buffer_manager::allocate_memory_buffer( - edge_partition_major_range_sizes[i], handle.get_stream().get()) - : rmm::device_uvector(edge_partition_major_range_sizes[i], handle.get_stream().get()); + auto sorted_majors = large_vertex_buffer_type + ? large_buffer_manager::allocate_memory_buffer( + edge_partition_major_range_sizes[i], handle.get_stream().get()) + : rmm::device_uvector(edge_partition_major_range_sizes[i], + handle.get_stream().get()); device_bcast(minor_comm, sorted_local_vertices.data(), sorted_majors.data(), @@ -1025,8 +1025,10 @@ std::vector aggregate_offset_vectors(raft::handle_t const& handle, raft::update_device(d_offsets.data(), offsets.data(), offsets.size(), handle.get_stream()); rmm::device_uvector d_aggregate_offset_vectors(minor_comm_size * d_offsets.size(), handle.get_stream()); - minor_comm.allgather( - d_offsets.data(), d_aggregate_offset_vectors.data(), d_offsets.size(), handle.get_stream().get()); + minor_comm.allgather(d_offsets.data(), + d_aggregate_offset_vectors.data(), + d_offsets.size(), + handle.get_stream().get()); std::vector h_aggregate_offset_vectors(d_aggregate_offset_vectors.size(), vertex_t{0}); raft::update_host(h_aggregate_offset_vectors.data(), diff --git a/cpp/src/utilities/validation_checks_impl.cuh b/cpp/src/utilities/validation_checks_impl.cuh index 3b017ed7132..b4fa1bbb2eb 100644 --- a/cpp/src/utilities/validation_checks_impl.cuh +++ b/cpp/src/utilities/validation_checks_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ From f350b7bfaf0cbb1e8cc6ff108255b1e1b85a23b8 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Sun, 6 Sep 2026 20:06:38 -0500 Subject: [PATCH 07/10] Correct migration copyright headers --- cpp/include/cugraph/partition_manager.hpp | 2 +- cpp/include/cugraph/prims/count_if_v.cuh | 2 +- cpp/include/cugraph/prims/update_edge_src_dst_property.cuh | 2 +- cpp/include/cugraph/utilities/error_check_utils.cuh | 2 +- cpp/src/c_api/graph_mg.cpp | 2 +- cpp/src/community/approx_weighted_matching_impl.cuh | 2 +- cpp/src/community/detail/refine_impl.cuh | 2 +- cpp/src/community/triangle_count_impl.cuh | 2 +- cpp/src/components/strongly_connected_components_impl.cuh | 2 +- cpp/src/cores/core_number_impl.cuh | 2 +- cpp/src/dag/topological_sort_impl.cuh | 2 +- cpp/src/link_analysis/pagerank_impl.cuh | 2 +- cpp/src/link_prediction/detail/similarity_impl.cuh | 2 +- cpp/src/sampling/detail/check_edge_bias_values.cuh | 2 +- cpp/src/structure/create_graph_from_edgelist_impl.cuh | 2 +- cpp/src/structure/graph_weight_utils_impl.cuh | 2 +- cpp/src/traversal/bfs_impl.cuh | 2 +- cpp/src/traversal/k_hop_nbrs_impl.cuh | 2 +- cpp/tests/utilities/test_graphs.hpp | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cpp/include/cugraph/partition_manager.hpp b/cpp/include/cugraph/partition_manager.hpp index 1c6411bfb18..97d79dd224a 100644 --- a/cpp/include/cugraph/partition_manager.hpp +++ b/cpp/include/cugraph/partition_manager.hpp @@ -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 */ diff --git a/cpp/include/cugraph/prims/count_if_v.cuh b/cpp/include/cugraph/prims/count_if_v.cuh index be056239e9f..476d984f18d 100644 --- a/cpp/include/cugraph/prims/count_if_v.cuh +++ b/cpp/include/cugraph/prims/count_if_v.cuh @@ -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 diff --git a/cpp/include/cugraph/prims/update_edge_src_dst_property.cuh b/cpp/include/cugraph/prims/update_edge_src_dst_property.cuh index 4b1b337ee9a..4b098512c0d 100644 --- a/cpp/include/cugraph/prims/update_edge_src_dst_property.cuh +++ b/cpp/include/cugraph/prims/update_edge_src_dst_property.cuh @@ -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 diff --git a/cpp/include/cugraph/utilities/error_check_utils.cuh b/cpp/include/cugraph/utilities/error_check_utils.cuh index 77dcca86d7e..6e16e428bcf 100644 --- a/cpp/include/cugraph/utilities/error_check_utils.cuh +++ b/cpp/include/cugraph/utilities/error_check_utils.cuh @@ -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 */ diff --git a/cpp/src/c_api/graph_mg.cpp b/cpp/src/c_api/graph_mg.cpp index 98b6ce6459b..b5674123dfb 100644 --- a/cpp/src/c_api/graph_mg.cpp +++ b/cpp/src/c_api/graph_mg.cpp @@ -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 */ diff --git a/cpp/src/community/approx_weighted_matching_impl.cuh b/cpp/src/community/approx_weighted_matching_impl.cuh index 86cda764e2d..4ab16909022 100644 --- a/cpp/src/community/approx_weighted_matching_impl.cuh +++ b/cpp/src/community/approx_weighted_matching_impl.cuh @@ -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 */ #pragma once diff --git a/cpp/src/community/detail/refine_impl.cuh b/cpp/src/community/detail/refine_impl.cuh index 8e0938f1f90..d964505495d 100644 --- a/cpp/src/community/detail/refine_impl.cuh +++ b/cpp/src/community/detail/refine_impl.cuh @@ -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 */ #pragma once diff --git a/cpp/src/community/triangle_count_impl.cuh b/cpp/src/community/triangle_count_impl.cuh index a08977efb48..6883bbd99ca 100644 --- a/cpp/src/community/triangle_count_impl.cuh +++ b/cpp/src/community/triangle_count_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/cpp/src/components/strongly_connected_components_impl.cuh b/cpp/src/components/strongly_connected_components_impl.cuh index 18a8070a3c5..57e6fb616a3 100644 --- a/cpp/src/components/strongly_connected_components_impl.cuh +++ b/cpp/src/components/strongly_connected_components_impl.cuh @@ -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 diff --git a/cpp/src/cores/core_number_impl.cuh b/cpp/src/cores/core_number_impl.cuh index 5d4d976a592..3f99fe073f2 100644 --- a/cpp/src/cores/core_number_impl.cuh +++ b/cpp/src/cores/core_number_impl.cuh @@ -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 diff --git a/cpp/src/dag/topological_sort_impl.cuh b/cpp/src/dag/topological_sort_impl.cuh index 9f2164f0fb5..5b0c15d2f45 100644 --- a/cpp/src/dag/topological_sort_impl.cuh +++ b/cpp/src/dag/topological_sort_impl.cuh @@ -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 */ diff --git a/cpp/src/link_analysis/pagerank_impl.cuh b/cpp/src/link_analysis/pagerank_impl.cuh index 2502c7fd818..ebbff656a30 100644 --- a/cpp/src/link_analysis/pagerank_impl.cuh +++ b/cpp/src/link_analysis/pagerank_impl.cuh @@ -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 diff --git a/cpp/src/link_prediction/detail/similarity_impl.cuh b/cpp/src/link_prediction/detail/similarity_impl.cuh index e59aada4539..0187eae5af6 100644 --- a/cpp/src/link_prediction/detail/similarity_impl.cuh +++ b/cpp/src/link_prediction/detail/similarity_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/cpp/src/sampling/detail/check_edge_bias_values.cuh b/cpp/src/sampling/detail/check_edge_bias_values.cuh index 68bf946bfc6..b5a2654fccd 100644 --- a/cpp/src/sampling/detail/check_edge_bias_values.cuh +++ b/cpp/src/sampling/detail/check_edge_bias_values.cuh @@ -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 */ diff --git a/cpp/src/structure/create_graph_from_edgelist_impl.cuh b/cpp/src/structure/create_graph_from_edgelist_impl.cuh index 22b8cef2f9b..d3dafbb67f5 100644 --- a/cpp/src/structure/create_graph_from_edgelist_impl.cuh +++ b/cpp/src/structure/create_graph_from_edgelist_impl.cuh @@ -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 diff --git a/cpp/src/structure/graph_weight_utils_impl.cuh b/cpp/src/structure/graph_weight_utils_impl.cuh index 6caa5bb8385..e362ab8477d 100644 --- a/cpp/src/structure/graph_weight_utils_impl.cuh +++ b/cpp/src/structure/graph_weight_utils_impl.cuh @@ -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 */ diff --git a/cpp/src/traversal/bfs_impl.cuh b/cpp/src/traversal/bfs_impl.cuh index 6fcba420db0..92f2058e2f4 100644 --- a/cpp/src/traversal/bfs_impl.cuh +++ b/cpp/src/traversal/bfs_impl.cuh @@ -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 diff --git a/cpp/src/traversal/k_hop_nbrs_impl.cuh b/cpp/src/traversal/k_hop_nbrs_impl.cuh index c6232464e1f..fd18d3fb9b3 100644 --- a/cpp/src/traversal/k_hop_nbrs_impl.cuh +++ b/cpp/src/traversal/k_hop_nbrs_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ #pragma once diff --git a/cpp/tests/utilities/test_graphs.hpp b/cpp/tests/utilities/test_graphs.hpp index f62438a4cb7..ebe4054b296 100644 --- a/cpp/tests/utilities/test_graphs.hpp +++ b/cpp/tests/utilities/test_graphs.hpp @@ -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 From 45cfc32379e0439e1ebf8d218399d198850d12b2 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Sun, 13 Sep 2026 15:36:04 -0500 Subject: [PATCH 08/10] Update copyrights --- cpp/src/c_api/bfs.cpp | 2 +- cpp/src/c_api/random.cpp | 2 +- cpp/src/utilities/validation_checks_impl.cuh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/src/c_api/bfs.cpp b/cpp/src/c_api/bfs.cpp index 63b121d644d..1325a405eb0 100644 --- a/cpp/src/c_api/bfs.cpp +++ b/cpp/src/c_api/bfs.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ diff --git a/cpp/src/c_api/random.cpp b/cpp/src/c_api/random.cpp index fbaf4e9a701..168d1abd3b2 100644 --- a/cpp/src/c_api/random.cpp +++ b/cpp/src/c_api/random.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ diff --git a/cpp/src/utilities/validation_checks_impl.cuh b/cpp/src/utilities/validation_checks_impl.cuh index b4fa1bbb2eb..3b017ed7132 100644 --- a/cpp/src/utilities/validation_checks_impl.cuh +++ b/cpp/src/utilities/validation_checks_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ From e81ac3a7b2974d0c141327cc02b4edc9f8efe5bf Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 14 Sep 2026 05:04:12 +0000 Subject: [PATCH 09/10] Fix raw stream conversions in multi-GPU builds --- ...ransform_reduce_dst_key_aggregated_outgoing_e.cuh | 4 ++-- cpp/tests/c_api/mg_test_utils.cpp | 12 ++++++------ .../detail/graph500_forest_pruning_utils.cuh | 6 +++--- cpp/tests/utilities/mg_utilities.cpp | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh b/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh index de30cc19381..67e1280ece7 100644 --- a/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh +++ b/cpp/include/cugraph/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh @@ -523,7 +523,7 @@ void per_v_transform_reduce_dst_key_aggregated_outgoing_e( h_vertex_offsets[j + 1] - h_vertex_offsets[j], offset_first, offset_first + 1, - handle.get_stream()); + handle.get_stream().get()); } if (tmp_storage_bytes > d_tmp_storage.size()) { d_tmp_storage = rmm::device_uvector(tmp_storage_bytes, handle.get_stream()); @@ -554,7 +554,7 @@ void per_v_transform_reduce_dst_key_aggregated_outgoing_e( h_vertex_offsets[j + 1] - h_vertex_offsets[j], offset_first, offset_first + 1, - handle.get_stream()); + handle.get_stream().get()); } thrust::copy(handle.get_thrust_policy(), diff --git a/cpp/tests/c_api/mg_test_utils.cpp b/cpp/tests/c_api/mg_test_utils.cpp index f96bd8fa3d6..b70c53c418c 100644 --- a/cpp/tests/c_api/mg_test_utils.cpp +++ b/cpp/tests/c_api/mg_test_utils.cpp @@ -83,9 +83,9 @@ extern "C" int run_mg_test(int (*test)(const cugraph_resource_handle_t*), rmm::device_uvector d_input(1, raft_handle->get_stream()); raft::update_device(d_input.data(), &ret_val, 1, raft_handle->get_stream()); comm.allreduce( - d_input.data(), d_input.data(), 1, raft::comms::op_t::SUM, raft_handle->get_stream()); + d_input.data(), d_input.data(), 1, raft::comms::op_t::SUM, raft_handle->get_stream().get()); raft::update_host(&ret_val, d_input.data(), 1, raft_handle->get_stream()); - auto status = comm.sync_stream(raft_handle->get_stream()); + auto status = comm.sync_stream(raft_handle->get_stream().get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); if (rank == 0) { @@ -772,9 +772,9 @@ extern "C" size_t cugraph_test_device_gatherv_size( rmm::device_uvector d_input(1, raft_handle->get_stream()); raft::update_device(d_input.data(), &ret_value, 1, raft_handle->get_stream()); comm.allreduce( - d_input.data(), d_input.data(), 1, raft::comms::op_t::SUM, raft_handle->get_stream()); + d_input.data(), d_input.data(), 1, raft::comms::op_t::SUM, raft_handle->get_stream().get()); raft::update_host(&ret_value, d_input.data(), 1, raft_handle->get_stream()); - auto status = comm.sync_stream(raft_handle->get_stream()); + auto status = comm.sync_stream(raft_handle->get_stream().get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); return (comm.get_rank() == 0) ? ret_value : 0; @@ -789,9 +789,9 @@ extern "C" size_t cugraph_test_scalar_reduce(const cugraph_resource_handle_t* ha rmm::device_uvector d_input(1, raft_handle->get_stream()); raft::update_device(d_input.data(), &value, 1, raft_handle->get_stream()); comm.allreduce( - d_input.data(), d_input.data(), 1, raft::comms::op_t::SUM, raft_handle->get_stream()); + d_input.data(), d_input.data(), 1, raft::comms::op_t::SUM, raft_handle->get_stream().get()); raft::update_host(&value, d_input.data(), 1, raft_handle->get_stream()); - auto status = comm.sync_stream(raft_handle->get_stream()); + auto status = comm.sync_stream(raft_handle->get_stream().get()); CUGRAPH_EXPECTS(status == raft::comms::status_t::SUCCESS, "sync_stream() failure."); return (comm.get_rank() == 0) ? value : 0; diff --git a/cpp/tests/traversal/detail/graph500_forest_pruning_utils.cuh b/cpp/tests/traversal/detail/graph500_forest_pruning_utils.cuh index 1ad9a907871..c1c2ec24263 100644 --- a/cpp/tests/traversal/detail/graph500_forest_pruning_utils.cuh +++ b/cpp/tests/traversal/detail/graph500_forest_pruning_utils.cuh @@ -683,14 +683,14 @@ std::tuple> trave cudaMemsetAsync(mg_distances.data() + (starting_vertex - local_vertex_partition_range_first), 0, sizeof(distance_t), - handle.get_stream())); // note that all 0 bits are zero in both integers and - // floating point numbers + handle.get_stream().get())); // note that all 0 bits are zero in both + // integers and floating point numbers if constexpr (std::is_floating_point_v) { // SSSP RAFT_CUDA_TRY(cudaMemsetAsync( mg_w_to_predecessors->data() + (starting_vertex - local_vertex_partition_range_first), 0, sizeof(distance_t), - handle.get_stream())); + handle.get_stream().get())); } handle.sync_stream(); } diff --git a/cpp/tests/utilities/mg_utilities.cpp b/cpp/tests/utilities/mg_utilities.cpp index 8e7c00434da..de0b90e0433 100644 --- a/cpp/tests/utilities/mg_utilities.cpp +++ b/cpp/tests/utilities/mg_utilities.cpp @@ -67,7 +67,7 @@ void enforce_p2p_initialization(raft::comms::comms_t const& comm, cuda::stream_r cugraph::device_alltoall(comm, tx_ints.data(), rx_ints.data(), p2p_count, stream); - RAFT_CUDA_TRY(cudaStreamSynchronize(stream)); + RAFT_CUDA_TRY(cudaStreamSynchronize(stream.get())); } } // namespace test From 4b603457cd880543b14407a5ec527be17128aa69 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 14 Sep 2026 05:09:16 +0000 Subject: [PATCH 10/10] Fix copyright --- cpp/tests/traversal/detail/graph500_forest_pruning_utils.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/tests/traversal/detail/graph500_forest_pruning_utils.cuh b/cpp/tests/traversal/detail/graph500_forest_pruning_utils.cuh index c1c2ec24263..3aa95d7cd38 100644 --- a/cpp/tests/traversal/detail/graph500_forest_pruning_utils.cuh +++ b/cpp/tests/traversal/detail/graph500_forest_pruning_utils.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */