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 | |
| 17 | /* track and track_callback share a bit so that one can test whether either is |
| 18 | * set by anding a bit. |
| 19 | */ |
| 20 | typedef enum { |
| 21 | ompt_status_disabled = 0x0, |
| 22 | ompt_status_ready = 0x1, |
| 23 | ompt_status_track = 0x2, |
| 24 | ompt_status_track_callback = 0x6, |
| 25 | } ompt_status_t; |
| 26 | |
| 27 | |
| 28 | typedef struct ompt_callbacks_s { |
| 29 | #define ompt_event_macro(event, callback, eventid) callback ompt_callback(event); |
| 30 | |
| 31 | FOREACH_OMPT_EVENT(ompt_event_macro) |
| 32 | |
| 33 | #undef ompt_event_macro |
| 34 | } ompt_callbacks_t; |
| 35 | |
| 36 | |
| 37 | |
| 38 | typedef struct { |
| 39 | ompt_frame_t frame; |
| 40 | void* function; |
| 41 | ompt_task_id_t task_id; |
| 42 | } ompt_task_info_t; |
| 43 | |
| 44 | |
| 45 | typedef struct { |
| 46 | ompt_parallel_id_t parallel_id; |
| 47 | void *microtask; |
| 48 | } ompt_team_info_t; |
| 49 | |
| 50 | |
| 51 | typedef struct ompt_lw_taskteam_s { |
| 52 | ompt_team_info_t ompt_team_info; |
| 53 | ompt_task_info_t ompt_task_info; |
| 54 | struct ompt_lw_taskteam_s *parent; |
| 55 | } ompt_lw_taskteam_t; |
| 56 | |
| 57 | |
| 58 | typedef struct ompt_parallel_info_s { |
| 59 | ompt_task_id_t parent_task_id; /* id of parent task */ |
| 60 | ompt_parallel_id_t parallel_id; /* id of parallel region */ |
| 61 | ompt_frame_t *parent_task_frame; /* frame data of parent task */ |
| 62 | void *parallel_function; /* pointer to outlined function */ |
| 63 | } ompt_parallel_info_t; |
| 64 | |
| 65 | |
| 66 | typedef struct { |
| 67 | ompt_state_t state; |
| 68 | ompt_wait_id_t wait_id; |
| 69 | void *idle_frame; |
| 70 | } ompt_thread_info_t; |
| 71 | |
| 72 | |
| 73 | extern ompt_status_t ompt_status; |
| 74 | extern ompt_callbacks_t ompt_callbacks; |
| 75 | |
| 76 | #ifdef __cplusplus |
| 77 | extern "C" { |
| 78 | #endif |
| 79 | |
Jonathan Peyton | 82a13bf | 2015-09-21 18:01:02 +0000 | [diff] [blame^] | 80 | void ompt_pre_init(void); |
| 81 | void ompt_post_init(void); |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 82 | void ompt_fini(void); |
| 83 | |
| 84 | #ifdef __cplusplus |
| 85 | }; |
| 86 | #endif |
| 87 | |
| 88 | #endif |