Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 1 | #ifndef __OMPT_INTERNAL_H__ |
| 2 | #define __OMPT_INTERNAL_H__ |
| 3 | |
| 4 | #include "ompt.h" |
| 5 | #include "ompt-event-specific.h" |
| 6 | |
| 7 | #define OMPT_VERSION 1 |
| 8 | |
| 9 | #define _OMP_EXTERN extern "C" |
| 10 | |
Jonathan Peyton | 3fdf329 | 2015-07-21 18:03:30 +0000 | [diff] [blame] | 11 | #define OMPT_INVOKER(x) \ |
| 12 | ((x == fork_context_gnu) ? ompt_invoker_program : ompt_invoker_runtime) |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 13 | |
| 14 | |
| 15 | #define ompt_callback(e) e ## _callback |
| 16 | |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 17 | |
| 18 | typedef struct ompt_callbacks_s { |
| 19 | #define ompt_event_macro(event, callback, eventid) callback ompt_callback(event); |
| 20 | |
| 21 | FOREACH_OMPT_EVENT(ompt_event_macro) |
| 22 | |
| 23 | #undef ompt_event_macro |
| 24 | } ompt_callbacks_t; |
| 25 | |
| 26 | |
| 27 | |
| 28 | typedef struct { |
| 29 | ompt_frame_t frame; |
| 30 | void* function; |
| 31 | ompt_task_id_t task_id; |
| 32 | } ompt_task_info_t; |
| 33 | |
| 34 | |
| 35 | typedef struct { |
| 36 | ompt_parallel_id_t parallel_id; |
| 37 | void *microtask; |
| 38 | } ompt_team_info_t; |
| 39 | |
| 40 | |
| 41 | typedef struct ompt_lw_taskteam_s { |
| 42 | ompt_team_info_t ompt_team_info; |
| 43 | ompt_task_info_t ompt_task_info; |
| 44 | struct ompt_lw_taskteam_s *parent; |
| 45 | } ompt_lw_taskteam_t; |
| 46 | |
| 47 | |
| 48 | typedef struct ompt_parallel_info_s { |
| 49 | ompt_task_id_t parent_task_id; /* id of parent task */ |
| 50 | ompt_parallel_id_t parallel_id; /* id of parallel region */ |
| 51 | ompt_frame_t *parent_task_frame; /* frame data of parent task */ |
| 52 | void *parallel_function; /* pointer to outlined function */ |
| 53 | } ompt_parallel_info_t; |
| 54 | |
| 55 | |
| 56 | typedef struct { |
| 57 | ompt_state_t state; |
| 58 | ompt_wait_id_t wait_id; |
| 59 | void *idle_frame; |
| 60 | } ompt_thread_info_t; |
| 61 | |
| 62 | |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 63 | extern ompt_callbacks_t ompt_callbacks; |
| 64 | |
| 65 | #ifdef __cplusplus |
| 66 | extern "C" { |
| 67 | #endif |
| 68 | |
Jonathan Peyton | 82a13bf | 2015-09-21 18:01:02 +0000 | [diff] [blame] | 69 | void ompt_pre_init(void); |
| 70 | void ompt_post_init(void); |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 71 | void ompt_fini(void); |
| 72 | |
Jonathan Peyton | b68a85d | 2015-09-21 18:11:22 +0000 | [diff] [blame^] | 73 | extern int ompt_enabled; |
| 74 | |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 75 | #ifdef __cplusplus |
| 76 | }; |
| 77 | #endif |
| 78 | |
| 79 | #endif |