diff options
author | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-01-13 14:47:02 +0000 |
---|---|---|
committer | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-01-13 14:47:02 +0000 |
commit | 3984da560874aa206e37d3e0927f463cb08feff8 (patch) | |
tree | 152a848eaedcf879c5532b9cee9d0bfa2f6ff4d4 | |
parent | cbda868206d5fd866c1e1a193c2f92273d3c46ee (diff) | |
download | bcm5719-llvm-3984da560874aa206e37d3e0927f463cb08feff8.tar.gz bcm5719-llvm-3984da560874aa206e37d3e0927f463cb08feff8.zip |
small fixes to the hierarchical barrier
llvm-svn: 225793
-rw-r--r-- | openmp/runtime/src/kmp_barrier.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openmp/runtime/src/kmp_barrier.cpp b/openmp/runtime/src/kmp_barrier.cpp index cbd1edd9e7c..79cfd3afa93 100644 --- a/openmp/runtime/src/kmp_barrier.cpp +++ b/openmp/runtime/src/kmp_barrier.cpp @@ -834,6 +834,9 @@ __kmp_hierarchical_barrier_gather(enum barrier_type bt, kmp_info_t *this_thr, KA_TRACE(20, ("__kmp_hierarchical_barrier_gather: T#%d(%d:%d) set team %d arrived(%p) = %u\n", gtid, team->t.t_id, tid, team->t.t_id, &team->t.t_bar[bt].b_arrived, team->t.t_bar[bt].b_arrived)); } + // If nested, but outer level is top-level, resume use of oncore optimization + if (this_thr->th.th_team->t.t_level <=2) thr_bar->use_oncore_barrier = 1; + else thr_bar->use_oncore_barrier = 0; // Is the team access below unsafe or just technically invalid? KA_TRACE(20, ("__kmp_hierarchical_barrier_gather: T#%d(%d:%d) exit for barrier type %d\n", gtid, team->t.t_id, tid, bt)); @@ -896,7 +899,7 @@ __kmp_hierarchical_barrier_release(enum barrier_type bt, kmp_info_t *this_thr, i KMP_MB(); // Flush all pending memory write invalidates. } - if (this_thr->th.th_team->t.t_level == 1) thr_bar->use_oncore_barrier = 1; + if (this_thr->th.th_team->t.t_level <= 1) thr_bar->use_oncore_barrier = 1; else thr_bar->use_oncore_barrier = 0; nproc = this_thr->th.th_team_nproc; |