diff --git a/cpp/include/cugraph/legacy/functions.hpp b/cpp/include/cugraph/legacy/functions.hpp index e5e5915e112..2ccb676c23f 100644 --- a/cpp/include/cugraph/legacy/functions.hpp +++ b/cpp/include/cugraph/legacy/functions.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 @@ -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 * */ diff --git a/cpp/src/converters/legacy/COOtoCSR.cuh b/cpp/src/converters/legacy/COOtoCSR.cuh index ad194eca019..0f8f0bd6532 100644 --- a/cpp/src/converters/legacy/COOtoCSR.cuh +++ b/cpp/src/converters/legacy/COOtoCSR.cuh @@ -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 */ /* @@ -154,6 +154,11 @@ std::unique_ptr> 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>(std::move(csr_contents)); }