diff options
| author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-11-09 15:57:04 +0000 |
|---|---|---|
| committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-11-09 15:57:04 +0000 |
| commit | 960ea2f6779e92f1b8577456a187a7ab9864ce63 (patch) | |
| tree | d803d61855835e8531483dab54668c65d7408bec /openmp/runtime | |
| parent | 301130ef7cc5f2150e7babfaffd3b3366bf6481c (diff) | |
| download | bcm5719-llvm-960ea2f6779e92f1b8577456a187a7ab9864ce63.tar.gz bcm5719-llvm-960ea2f6779e92f1b8577456a187a7ab9864ce63.zip | |
[OMPT] Add OMPT events for the OpenMP taskwait construct.
llvm-svn: 252472
Diffstat (limited to 'openmp/runtime')
| -rw-r--r-- | openmp/runtime/src/kmp_tasking.c | 25 | ||||
| -rw-r--r-- | openmp/runtime/src/ompt-event-specific.h | 4 |
2 files changed, 27 insertions, 2 deletions
diff --git a/openmp/runtime/src/kmp_tasking.c b/openmp/runtime/src/kmp_tasking.c index a4c3fd34422..686b8f90e32 100644 --- a/openmp/runtime/src/kmp_tasking.c +++ b/openmp/runtime/src/kmp_tasking.c @@ -1304,6 +1304,23 @@ __kmpc_omp_taskwait( ident_t *loc_ref, kmp_int32 gtid ) thread = __kmp_threads[ gtid ]; taskdata = thread -> th.th_current_task; + +#if OMPT_SUPPORT && OMPT_TRACE + ompt_task_id_t my_task_id; + ompt_parallel_id_t my_parallel_id; + + if (ompt_enabled) { + kmp_team_t *team = thread->th.th_team; + my_task_id = taskdata->ompt_task_info.task_id; + my_parallel_id = team->t.ompt_team_info.parallel_id; + + if (ompt_callbacks.ompt_callback(ompt_event_taskwait_begin)) { + ompt_callbacks.ompt_callback(ompt_event_taskwait_begin)( + my_parallel_id, my_task_id); + } + } +#endif + #if USE_ITT_BUILD // Note: These values are used by ITT events as well. #endif /* USE_ITT_BUILD */ @@ -1337,6 +1354,14 @@ __kmpc_omp_taskwait( ident_t *loc_ref, kmp_int32 gtid ) // GEH TODO: shouldn't we have some sort of OMPRAP API calls here to mark end of wait? taskdata->td_taskwait_thread = - taskdata->td_taskwait_thread; + +#if OMPT_SUPPORT && OMPT_TRACE + if (ompt_enabled && + ompt_callbacks.ompt_callback(ompt_event_taskwait_end)) { + ompt_callbacks.ompt_callback(ompt_event_taskwait_end)( + my_parallel_id, my_task_id); + } +#endif } KA_TRACE(10, ("__kmpc_omp_taskwait(exit): T#%d task %p finished waiting, " diff --git a/openmp/runtime/src/ompt-event-specific.h b/openmp/runtime/src/ompt-event-specific.h index 5acab16a334..b4dabcc89e6 100644 --- a/openmp/runtime/src/ompt-event-specific.h +++ b/openmp/runtime/src/ompt-event-specific.h @@ -113,8 +113,8 @@ #define ompt_event_barrier_begin_implemented ompt_event_MAY_ALWAYS_TRACE #define ompt_event_barrier_end_implemented ompt_event_MAY_ALWAYS_TRACE -#define ompt_event_taskwait_begin_implemented ompt_event_UNIMPLEMENTED -#define ompt_event_taskwait_end_implemented ompt_event_UNIMPLEMENTED +#define ompt_event_taskwait_begin_implemented ompt_event_MAY_ALWAYS_TRACE +#define ompt_event_taskwait_end_implemented ompt_event_MAY_ALWAYS_TRACE #define ompt_event_taskgroup_begin_implemented ompt_event_UNIMPLEMENTED #define ompt_event_taskgroup_end_implemented ompt_event_UNIMPLEMENTED |

