[OMPT] Add OMPT events for the OpenMP taskwait construct.

llvm-svn: 252472
This commit is contained in:
Jonathan Peyton 2015-11-09 15:57:04 +00:00
parent 301130ef7c
commit 960ea2f677
2 changed files with 27 additions and 2 deletions

View File

@ -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, "

View File

@ -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