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