summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/ompt-specific.cpp
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2019-02-28 20:55:39 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2019-02-28 20:55:39 +0000
commitad1ad7ae8be3807202669619dc2d9aa3dc650215 (patch)
tree5cc4278e3057d941359e0a8b096c61248bf9a6f1 /openmp/runtime/src/ompt-specific.cpp
parent12b75594ed86d67b909bf1e6b0429ecdde6a4547 (diff)
downloadbcm5719-llvm-ad1ad7ae8be3807202669619dc2d9aa3dc650215.tar.gz
bcm5719-llvm-ad1ad7ae8be3807202669619dc2d9aa3dc650215.zip
[OpenMP][OMPT] Distinguish different barrier kinds
This change makes the runtime decide the intended use of each barrier invocation, for the OMPT synchronization tool callbacks. The OpenMP 5.0 specification defines four possible barrier kinds -- implicit, explicit, implementation, and just normal barrier. Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D58247 llvm-svn: 355140
Diffstat (limited to 'openmp/runtime/src/ompt-specific.cpp')
-rw-r--r--openmp/runtime/src/ompt-specific.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/openmp/runtime/src/ompt-specific.cpp b/openmp/runtime/src/ompt-specific.cpp
index acd23896f18..f65048f3b00 100644
--- a/openmp/runtime/src/ompt-specific.cpp
+++ b/openmp/runtime/src/ompt-specific.cpp
@@ -448,3 +448,25 @@ static uint64_t __ompt_get_unique_id_internal() {
}
return ++ID;
}
+
+ompt_sync_region_t __ompt_get_barrier_kind(enum barrier_type bt,
+ kmp_info_t *thr) {
+ if (bt == bs_forkjoin_barrier)
+ return ompt_sync_region_barrier_implicit;
+
+ if (bt != bs_plain_barrier)
+ return ompt_sync_region_barrier_implementation;
+
+ if (!thr->th.th_ident)
+ return ompt_sync_region_barrier;
+
+ kmp_int32 flags = thr->th.th_ident->flags;
+
+ if ((flags & KMP_IDENT_BARRIER_EXPL) != 0)
+ return ompt_sync_region_barrier_explicit;
+
+ if ((flags & KMP_IDENT_BARRIER_IMPL) != 0)
+ return ompt_sync_region_barrier_implicit;
+
+ return ompt_sync_region_barrier_implementation;
+}
OpenPOWER on IntegriCloud