diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-07-09 18:16:58 +0000 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-07-09 18:16:58 +0000 |
commit | 8fbb49ab78ec4192189d42166a79a3e072802232 (patch) | |
tree | 7ec5fcc358609283ab284f824ea3edb848d146ef /openmp/runtime/src/kmp_barrier.cpp | |
parent | 0373d53ae4eeca83f0c895b95cd7f9e4d6511845 (diff) | |
download | bcm5719-llvm-8fbb49ab78ec4192189d42166a79a3e072802232.tar.gz bcm5719-llvm-8fbb49ab78ec4192189d42166a79a3e072802232.zip |
Enable debugger support
These changes enable external debuggers to conveniently interface with
the LLVM OpenMP Library. Structures are added which describe the important
internal structures of the OpenMP Library e.g., teams, threads, etc.
This feature is turned on by default (CMake variable LIBOMP_USE_DEBUGGER)
and can be turned off with -DLIBOMP_USE_DEBUGGER=off.
Differential Revision: http://reviews.llvm.org/D10038
llvm-svn: 241832
Diffstat (limited to 'openmp/runtime/src/kmp_barrier.cpp')
-rw-r--r-- | openmp/runtime/src/kmp_barrier.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/openmp/runtime/src/kmp_barrier.cpp b/openmp/runtime/src/kmp_barrier.cpp index ea345b0a9ad..a2a24f2e98b 100644 --- a/openmp/runtime/src/kmp_barrier.cpp +++ b/openmp/runtime/src/kmp_barrier.cpp @@ -1104,7 +1104,14 @@ __kmp_barrier(enum barrier_type bt, int gtid, int is_split, size_t reduce_size, if (__itt_sync_create_ptr || KMP_ITT_DEBUG) __kmp_itt_barrier_starting(gtid, itt_sync_obj); #endif /* USE_ITT_BUILD */ - +#if USE_DEBUGGER + // Let the debugger know: the thread arrived to the barrier and waiting. + if (KMP_MASTER_TID(tid)) { // Master counter is stored in team structure. + team->t.t_bar[bt].b_master_arrived += 1; + } else { + this_thr->th.th_bar[bt].bb.b_worker_arrived += 1; + } // if +#endif /* USE_DEBUGGER */ if (reduce != NULL) { //KMP_DEBUG_ASSERT( is_split == TRUE ); // #C69956 this_thr->th.th_local.reduce_data = reduce_data; @@ -1142,7 +1149,10 @@ __kmp_barrier(enum barrier_type bt, int gtid, int is_split, size_t reduce_size, USE_ITT_BUILD_ARG(itt_sync_obj) ); __kmp_task_team_setup(this_thr, team, 0, 0); // use 0,0 to only setup the current team if nthreads > 1 } - +#if USE_DEBUGGER + // Let the debugger know: All threads are arrived and starting leaving the barrier. + team->t.t_bar[bt].b_team_arrived += 1; +#endif #if USE_ITT_BUILD /* TODO: In case of split reduction barrier, master thread may send acquired event early, |