Skip to content

Commit

Permalink
Fix parallel_scan_with_reducers test
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Arndt authored and masterleinad committed Sep 19, 2023
1 parent 8e48201 commit 5f279b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/unit_test/TestTeamVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -917,9 +917,6 @@ struct checkScan {
view_type inputs = view_type{"inputs"};
view_type outputs = view_type{"outputs"};

value_type result;
Reducer reducer = {result};

struct ThreadVectorFunctor {
KOKKOS_FUNCTION void operator()(const size_type j, value_type &update,
const bool final) const {
Expand Down Expand Up @@ -967,6 +964,8 @@ struct checkScan {
const {
const size_type iTeam = team.league_rank();
const size_type iTeamOffset = iTeam * n_per_team;
value_type dummy;
Reducer reducer = {dummy};
Kokkos::parallel_for(
Kokkos::TeamThreadRange(team, n_team_thread_range),
TeamThreadRangeFunctor{team, reducer, iTeamOffset, outputs, inputs});
Expand Down Expand Up @@ -997,7 +996,9 @@ struct checkScan {
Kokkos::View<value_type[n], Kokkos::HostSpace> expected("expected");
{
value_type identity;
Reducer reducer = {identity};
reducer.init(identity);

for (int i = 0; i < expected.extent_int(0); ++i) {
const int vector = i % n_vector_range;
const value_type accum = vector == 0 ? identity : expected(i - 1);
Expand Down

0 comments on commit 5f279b0

Please sign in to comment.