diff --git a/cpp/src/traversal/od_shortest_distances_impl.cuh b/cpp/src/traversal/od_shortest_distances_impl.cuh index 549b6887bc..90ed6ab9dd 100644 --- a/cpp/src/traversal/od_shortest_distances_impl.cuh +++ b/cpp/src/traversal/od_shortest_distances_impl.cuh @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -912,7 +912,8 @@ rmm::device_uvector od_shortest_distances( h_split_thresholds.size(), handle.get_stream()); - rmm::device_uvector tmp_buffer = std::move(far_buffers.back()); + auto tmp_buffer = rmm::device_uvector(0, handle.get_stream()); + std::swap(tmp_buffer, far_buffers.back()); std::vector h_buffer_ptrs(h_split_thresholds.size() + 1); auto old_size = new_near_q_keys.size(); for (size_t j = 0; j < h_buffer_ptrs.size(); ++j) { @@ -994,7 +995,8 @@ rmm::device_uvector od_shortest_distances( new_near_q_keys.resize(cuda::std::distance(new_near_q_keys.begin(), last), handle.get_stream()); } else { - far_buffers[i - num_near_q_insert_buffers] = std::move(far_buffers[i]); + std::swap(far_buffers[i - num_near_q_insert_buffers], far_buffers[i]); + far_buffers[i].resize(0, handle.get_stream()); } }