diff --git a/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp b/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp --- a/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp @@ -111,9 +111,10 @@ if (TId < NumThreads) invokeMicrotask(TId, 0, fn, args, nargs); + + // Synchronize all threads at the end of a parallel region. + synchronize::threadsAligned(); } - // Synchronize all threads at the end of a parallel region. - synchronize::threadsAligned(); ASSERT(state::ParallelTeamSize == 1u); ASSERT(icv::ActiveLevel == 0u);