[OpenMP][FIX] Use thread id not team id for masked section
authorJohannes Doerfert <johannes@jdoerfert.de>
Sat, 14 Jan 2023 03:10:46 +0000 (19:10 -0800)
committerJohannes Doerfert <johannes@jdoerfert.de>
Sun, 22 Jan 2023 23:45:00 +0000 (15:45 -0800)
openmp/libomptarget/DeviceRTL/src/Synchronization.cpp

index 2cfd0cc..b85e1b3 100644 (file)
@@ -486,7 +486,7 @@ __attribute__((noinline)) void __kmpc_barrier_simple_generic(IdentTy *Loc,
 
 int32_t __kmpc_master(IdentTy *Loc, int32_t TId) {
   FunctionTracingRAII();
-  return omp_get_team_num() == 0;
+  return omp_get_thread_num() == 0;
 }
 
 void __kmpc_end_master(IdentTy *Loc, int32_t TId) { FunctionTracingRAII(); }