From 722425ca6e1b332e612ef05deae5eea2381357e0 Mon Sep 17 00:00:00 2001 From: William Hicks Date: Mon, 2 Oct 2023 13:24:28 -0400 Subject: [PATCH] Correct iteration in host-to-host copies --- cpp/include/raft/core/detail/copy.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/include/raft/core/detail/copy.hpp b/cpp/include/raft/core/detail/copy.hpp index 5457a08df3..b23660fefe 100644 --- a/cpp/include/raft/core/detail/copy.hpp +++ b/cpp/include/raft/core/detail/copy.hpp @@ -527,7 +527,7 @@ mdspan_copyable_t copy(resources const& res, DstType&& dst, Sr // cache-oblivious implementation should work through dimensions in // order of increasing stride. auto dim = std::size_t{}; - while ((indices[dim]++) == src.extent(dim)) { + while ((++indices[dim]) == src.extent(dim)) { indices[dim] = typename config::index_type{}; ++dim; }