Skip to content

Commit

Permalink
Simplify unit test indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
cwpearson committed May 15, 2024
1 parent 2560097 commit 0f6bd4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions unit_tests/test_alltoall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ TYPED_TEST(Alltoall, 1D_contig) {
Kokkos::parallel_reduce(
rv.extent(0),
KOKKOS_LAMBDA(const int &i, int &lsum) {
const int src = i / nContrib; // who sent this data
const int j = rank * nContrib + (i % nContrib); // what index i was at the source
const int src = i / nContrib; // who sent this data
const int j = i - rank * nContrib; // what index i was at the source
lsum += rv(i) != src + j;
},
errs);
Expand Down Expand Up @@ -80,8 +80,8 @@ TYPED_TEST(Alltoall, 1D_inplace_contig) {
Kokkos::parallel_reduce(
rv.extent(0),
KOKKOS_LAMBDA(const int &i, int &lsum) {
const int src = i / nContrib; // who sent this data
const int j = rank * nContrib + (i % nContrib); // what index i was at the source
const int src = i / nContrib; // who sent this data
const int j = i - rank * nContrib; // what index i was at the source
lsum += rv(i) != src + j;
},
errs);
Expand Down

0 comments on commit 0f6bd4f

Please sign in to comment.