Skip to content

Commit

Permalink
Fix teamsize request for OPENMPTARGET
Browse files Browse the repository at this point in the history
  • Loading branch information
tcclevenger committed Jan 18, 2024
1 parent f3f32c5 commit 9beb5ea
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions core/unit_test/TestReducers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,18 @@ struct TestReducers {
const int league_size = 10;
Kokkos::View<Scalar*, ExecSpace> result("result", league_size);
TeamSumNestedFunctor tnf(f, league_size, N, result);
auto team_size_max = Kokkos::TeamPolicy<ExecSpace>(league_size, 1)
.team_size_max(tnf, Kokkos::ParallelForTag());
// FIXME_OPENMPTARGET temporary restriction for team size to be at least
// 32
#ifdef KOKKOS_ENABLE_OPENMPTARGET
int initial_team_size =
std::is_same_v<ExecSpace, Kokkos::Experimental::OpenMPTarget> ? 32
: 1;
#else
int initial_team_size = 1;
#endif
auto team_size_max =
Kokkos::TeamPolicy<ExecSpace>(league_size, initial_team_size)
.team_size_max(tnf, Kokkos::ParallelForTag());
auto team_size = std::min(team_size_max, TEST_EXECSPACE().concurrency());
Kokkos::parallel_for(
Kokkos::TeamPolicy<ExecSpace>(league_size, team_size), tnf);
Expand Down

0 comments on commit 9beb5ea

Please sign in to comment.