Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenMPTarget: Adding logic to skip the kernel launch if league_size=0. #5067

Merged
merged 2 commits into from
May 31, 2022

Conversation

rgayatri23
Copy link
Contributor

The PR fixes the following error message:
" num_teams clause is not being respected."

@dalg24
Copy link
Member

dalg24 commented May 27, 2022

Fix the format

diff --git a/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp b/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp
index d6fdbc70a..dfb9ea70a 100644
--- a/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp
+++ b/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp
@@ -789,8 +789,7 @@ class ParallelFor<FunctorType, Kokkos::TeamPolicy<Properties...>,
         league_size < max_active_teams ? league_size : max_active_teams;
 
     // If the league size is <=0, do not launch the kernel.
-    if(nteams <=0) 
-        return;
+    if (nteams <= 0) return;
 
 // Performing our own scheduling of teams to avoid separation of code between
 // teams-distribute and parallel. Gave a 2x performance boost in test cases with
@@ -874,8 +873,7 @@ struct ParallelReduceSpecialize<FunctorType, TeamPolicyInternal<PolicyArgs...>,
         league_size < max_active_teams ? league_size : max_active_teams;
 
     // If the league size is <=0, do not launch the kernel.
-    if(nteams <=0) 
-        return;
+    if (nteams <= 0) return;
 
 #pragma omp declare reduction(                                         \
     custom:ValueType                                                   \
@@ -936,8 +934,7 @@ struct ParallelReduceSpecialize<FunctorType, TeamPolicyInternal<PolicyArgs...>,
         league_size < max_active_teams ? league_size : max_active_teams;
 
     // If the league size is <=0, do not launch the kernel.
-    if(nteams <=0) 
-        return;
+    if (nteams <= 0) return;
 
     // Case where the number of reduction items is 1.
     if constexpr (NumReductions == 1) {

@dalg24
Copy link
Member

dalg24 commented May 31, 2022

Retest this please

@dalg24
Copy link
Member

dalg24 commented May 31, 2022

SYCL build is hanging. Not bothering to re-run.

@dalg24 dalg24 merged commit 599e305 into kokkos:develop May 31, 2022
@rgayatri23 rgayatri23 deleted the OpenMPTarget_league_size_0 branch March 24, 2023 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants