Skip to content

Commit

Permalink
This PR changes the default execution behavior of the parallel_for(te…
Browse files Browse the repository at this point in the history
…am-policy) constructs in the OpenACC backend.

    - This PR handles a missing case not covered by the previous PR kokkos#6772
This PR also fixes the OpenACC backend error in the thread-safety test in PR kokkos#6938.
  • Loading branch information
seyonglee committed May 15, 2024
1 parent df018d9 commit da8be22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions core/src/OpenACC/Kokkos_OpenACC_ParallelFor_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ class Kokkos::Impl::ParallelFor<FunctorType, Kokkos::TeamPolicy<Properties...>,
auto team_size = m_policy.team_size();
auto vector_length = m_policy.impl_vector_length();

int const async_arg = m_policy.space().acc_async_queue();

auto const a_functor(m_functor);

#pragma acc parallel loop gang vector num_gangs(league_size) \
vector_length(team_size* vector_length) copyin(a_functor)
vector_length(team_size* vector_length) copyin(a_functor) async(async_arg)
for (int i = 0; i < league_size * team_size * vector_length; i++) {
int league_id = i / (team_size * vector_length);
typename Policy::member_type team(league_id, league_size, team_size,
Expand Down Expand Up @@ -145,10 +147,12 @@ class Kokkos::Impl::ParallelFor<FunctorType, Kokkos::TeamPolicy<Properties...>,
auto team_size = m_policy.team_size();
auto vector_length = m_policy.impl_vector_length();

int const async_arg = m_policy.space().acc_async_queue();

auto const a_functor(m_functor);

#pragma acc parallel loop gang num_gangs(league_size) num_workers(team_size) \
vector_length(vector_length) copyin(a_functor)
vector_length(vector_length) copyin(a_functor) async(async_arg)
for (int i = 0; i < league_size; i++) {
int league_id = i;
typename Policy::member_type team(league_id, league_size, team_size,
Expand Down
1 change: 0 additions & 1 deletion core/unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@ if(Kokkos_ENABLE_OPENACC)
${CMAKE_CURRENT_BINARY_DIR}/openacc/TestOpenACC_AtomicOperations_complexdouble.cpp
${CMAKE_CURRENT_BINARY_DIR}/openacc/TestOpenACC_AtomicOperations_complexfloat.cpp
${CMAKE_CURRENT_BINARY_DIR}/openacc/TestOpenACC_Crs.cpp
${CMAKE_CURRENT_BINARY_DIR}/openacc/TestOpenACC_ExecSpaceThreadSafety.cpp
${CMAKE_CURRENT_BINARY_DIR}/openacc/TestOpenACC_JoinBackwardCompatibility.cpp
${CMAKE_CURRENT_BINARY_DIR}/openacc/TestOpenACC_LocalDeepCopy.cpp
${CMAKE_CURRENT_BINARY_DIR}/openacc/TestOpenACC_Other.cpp
Expand Down

0 comments on commit da8be22

Please sign in to comment.