[Openmp-commits] [openmp] ef922c6 - [OpenMP][FIX] Query proper thread ID information to support nesting
Johannes Doerfert via Openmp-commits
openmp-commits at lists.llvm.org
Wed Oct 27 16:18:55 PDT 2021
Author: Johannes Doerfert
Date: 2021-10-27T18:18:44-05:00
New Revision: ef922c692fdb971497d79cc8fa6b9d221733db3d
URL: https://github.com/llvm/llvm-project/commit/ef922c692fdb971497d79cc8fa6b9d221733db3d
DIFF: https://github.com/llvm/llvm-project/commit/ef922c692fdb971497d79cc8fa6b9d221733db3d.diff
LOG: [OpenMP][FIX] Query proper thread ID information to support nesting
The OpenMP thread ID is not the hardware thread ID if we have nesting.
We need to ask the runtime properly to ensure correct results.
Note that the loop interface is going to change soon so we do not adjust
it now but simply ignore the extra argument.
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D111950
Added:
Modified:
openmp/libomptarget/DeviceRTL/src/Workshare.cpp
Removed:
################################################################################
diff --git a/openmp/libomptarget/DeviceRTL/src/Workshare.cpp b/openmp/libomptarget/DeviceRTL/src/Workshare.cpp
index 071702e1fd02..89c10b1fa11f 100644
--- a/openmp/libomptarget/DeviceRTL/src/Workshare.cpp
+++ b/openmp/libomptarget/DeviceRTL/src/Workshare.cpp
@@ -114,14 +114,10 @@ template <typename T, typename ST> struct omptarget_nvptx_LoopSupport {
////////////////////////////////////////////////////////////////////////////////
// Support for Static Init
- static void for_static_init(int32_t gtid, int32_t schedtype,
+ static void for_static_init(int32_t, int32_t schedtype,
int32_t *plastiter, T *plower, T *pupper,
ST *pstride, ST chunk, bool IsSPMDExecutionMode) {
- // When IsRuntimeUninitialized is true, we assume that the caller is
- // in an L0 parallel region and that all worker threads participate.
-
- // Assume we are in teams region or that we use a single block
- // per target region
+ int32_t gtid = omp_get_thread_num();
int numberOfActiveOMPThreads = omp_get_num_threads();
// All warps that are in excess of the maximum requested, do
More information about the Openmp-commits
mailing list