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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cpp/include/cugraph/legacy/functions.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
Expand Down Expand Up @@ -35,6 +35,9 @@ namespace CUGRAPH_EXPORT cugraph {
* @param[in] graph cuGraph graph in coordinate format
* @param[in] mr Memory resource used to allocate the returned graph
*
* @note Synchronizes the internal CUDA stream before returning so callers may use the
* returned CSR on a different stream without additional ordering.
*
* @return Unique pointer to generate Compressed Sparse Row graph
*
*/
Expand Down
7 changes: 6 additions & 1 deletion cpp/src/converters/legacy/COOtoCSR.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
/*
Expand Down Expand Up @@ -154,6 +154,11 @@ std::unique_ptr<legacy::GraphCSR<VT, ET, WT>> coo_to_csr(
std::move(coo_contents.dst_indices),
std::move(coo_contents.edge_data)};

// All conversion work runs on stream_view, which callers do not share (for example
// raft::handle_t defaults to cudaStreamPerThread). Synchronize before returning so
// downstream algorithms can safely consume the CSR buffers on any stream.
stream_view.synchronize();

return std::make_unique<legacy::GraphCSR<VT, ET, WT>>(std::move(csr_contents));
}

Expand Down
Loading