Skip to content

Commit 47babb4

Browse files
committed
sparse_sort_crs: Fix row begin/end offset in entry shuffle
1 parent 3d6bbb2 commit 47babb4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

perf_test/sparse/KokkosSparse_sort_crs.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ void run_experiment(int argc, char** argv, const CommonInputParams& common_param
8282
std::random_device rd;
8383
std::mt19937 g(rd());
8484
for (lno_t i = 0; i < m; i++) {
85-
std::shuffle(entriesHost.data() + i, entriesHost.data() + i + 1, g);
85+
const size_type rowBegin = rowmapHost(i);
86+
const size_type rowEnd = rowmapHost(i + 1);
87+
std::shuffle(entriesHost.data() + rowBegin, entriesHost.data() + rowEnd, g);
8688
}
8789
Kokkos::deep_copy(shuffledEntries, entriesHost);
8890
exec_space exec;

0 commit comments

Comments
 (0)