diff options
| author | Vignesh Balasubramanian <Vignesh.Balasubrmanian@amd.com> | 2021-08-19 12:46:07 +0530 |
|---|---|---|
| committer | Vignesh Balasubramanian <Vignesh.Balasubrmanian@amd.com> | 2021-08-20 14:36:22 +0530 |
| commit | 589519b9ab47694159e8c20fa89ae802380f185f (patch) | |
| tree | b029bf3e41450050020f2afd71395695bc10ee91 /openmp/runtime/src/kmp_csupport.cpp | |
| parent | d1883bc3220d58dec96278abeb98590df8801044 (diff) | |
[OpenMP][OMPD]Code movement required for OMPD
These changes don't come under OMPD guard as it is a movement of existing code to capture parallel behavior correctly.
"Runtime Entry Points for OMPD" like "ompd_bp_parallel_begin" and "ompd_bp_parallel_begin" should be placed at the correct execution point for the debugging tool to access proper handles/data.
Without the below changes, in certain cases, debugging tool will pick the wrong parallel and task handle.
Reviewed By: @hbae
Differential Revision: https://reviews.llvm.org/D100366
Diffstat (limited to 'openmp/runtime/src/kmp_csupport.cpp')
| -rw-r--r-- | openmp/runtime/src/kmp_csupport.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/openmp/runtime/src/kmp_csupport.cpp b/openmp/runtime/src/kmp_csupport.cpp index 2a7c9a8cb2ec..0b5f899cfd8f 100644 --- a/openmp/runtime/src/kmp_csupport.cpp +++ b/openmp/runtime/src/kmp_csupport.cpp @@ -578,9 +578,6 @@ void __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32 global_tid) { __kmp_free(top); } - // if( serial_team -> t.t_serialized > 1 ) - serial_team->t.t_level--; - /* pop dispatch buffers stack */ KMP_DEBUG_ASSERT(serial_team->t.t_dispatch->th_disp_buffer); { @@ -605,6 +602,7 @@ void __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32 global_tid) { } #endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */ + __kmp_pop_current_task_from_thread(this_thr); #if OMPD_SUPPORT if (ompd_state & OMPD_ENABLE_BP) ompd_bp_parallel_end(); @@ -623,8 +621,6 @@ void __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32 global_tid) { this_thr->th.th_dispatch = &this_thr->th.th_team->t.t_dispatch[serial_team->t.t_master_tid]; - __kmp_pop_current_task_from_thread(this_thr); - KMP_ASSERT(this_thr->th.th_current_task->td_flags.executing == 0); this_thr->th.th_current_task->td_flags.executing = 1; @@ -645,6 +641,7 @@ void __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32 global_tid) { } } + serial_team->t.t_level--; if (__kmp_env_consistency_check) __kmp_pop_parallel(global_tid, NULL); #if OMPT_SUPPORT |
