summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/kmp_runtime.cpp
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2018-02-23 16:46:25 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2018-02-23 16:46:25 +0000
commit82768d0ba173d24ffa9fbf5debe596ffa872d236 (patch)
tree4bc2d7709c2810e22f7cb05d87023f76565633bb /openmp/runtime/src/kmp_runtime.cpp
parent5e440698571f64545f8f8f4107f18e20e6f9d9b6 (diff)
downloadbcm5719-llvm-82768d0ba173d24ffa9fbf5debe596ffa872d236.tar.gz
bcm5719-llvm-82768d0ba173d24ffa9fbf5debe596ffa872d236.zip
[OMPT] Fix parallel_data in implicit barrier-end
This is required to be NULL for implicit barriers at the end of a parallel region. Noticed in review of D43191. Differential Revision: https://reviews.llvm.org/D43308 llvm-svn: 325922
Diffstat (limited to 'openmp/runtime/src/kmp_runtime.cpp')
-rw-r--r--openmp/runtime/src/kmp_runtime.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/openmp/runtime/src/kmp_runtime.cpp b/openmp/runtime/src/kmp_runtime.cpp
index c05e973ae0f..f902f049477 100644
--- a/openmp/runtime/src/kmp_runtime.cpp
+++ b/openmp/runtime/src/kmp_runtime.cpp
@@ -7164,10 +7164,10 @@ void __kmp_internal_join(ident_t *id, int gtid, kmp_team_t *team) {
__kmp_join_barrier(gtid); /* wait for everyone */
#if OMPT_SUPPORT
- int ds_tid = this_thr->th.th_info.ds.ds_tid;
- if (this_thr->th.ompt_thread_info.state == omp_state_wait_barrier_implicit) {
- ompt_data_t *tId = OMPT_CUR_TASK_DATA(this_thr);
- ompt_data_t *pId = OMPT_CUR_TEAM_DATA(this_thr);
+ if (ompt_enabled.enabled &&
+ this_thr->th.ompt_thread_info.state == omp_state_wait_barrier_implicit) {
+ int ds_tid = this_thr->th.th_info.ds.ds_tid;
+ ompt_data_t *task_data = OMPT_CUR_TASK_DATA(this_thr);
this_thr->th.ompt_thread_info.state = omp_state_overhead;
#if OMPT_OPTIONAL
void *codeptr = NULL;
@@ -7178,19 +7178,17 @@ void __kmp_internal_join(ident_t *id, int gtid, kmp_team_t *team) {
if (ompt_enabled.ompt_callback_sync_region_wait) {
ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait)(
- ompt_sync_region_barrier, ompt_scope_end, pId, tId, codeptr);
+ ompt_sync_region_barrier, ompt_scope_end, NULL, task_data, codeptr);
}
if (ompt_enabled.ompt_callback_sync_region) {
ompt_callbacks.ompt_callback(ompt_callback_sync_region)(
- ompt_sync_region_barrier, ompt_scope_end, pId, tId, codeptr);
+ ompt_sync_region_barrier, ompt_scope_end, NULL, task_data, codeptr);
}
#endif
if (!KMP_MASTER_TID(ds_tid) && ompt_enabled.ompt_callback_implicit_task) {
ompt_callbacks.ompt_callback(ompt_callback_implicit_task)(
- ompt_scope_end, NULL, tId, 0, ds_tid);
+ ompt_scope_end, NULL, task_data, 0, ds_tid);
}
- // return to idle state
- this_thr->th.ompt_thread_info.state = omp_state_overhead;
}
#endif
OpenPOWER on IntegriCloud