blob: 6d9f6f0291f525e14ee5266ba557e36f500c8a60 [file] [log] [blame]
Andrey Churbanove5f44922015-04-29 16:22:07 +00001#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 Peyton3fdf3292015-07-21 18:03:30 +000011#define OMPT_INVOKER(x) \
12 ((x == fork_context_gnu) ? ompt_invoker_program : ompt_invoker_runtime)
Andrey Churbanove5f44922015-04-29 16:22:07 +000013
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 */
20typedef 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
28typedef 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
38typedef struct {
39 ompt_frame_t frame;
40 void* function;
41 ompt_task_id_t task_id;
42} ompt_task_info_t;
43
44
45typedef struct {
46 ompt_parallel_id_t parallel_id;
47 void *microtask;
48} ompt_team_info_t;
49
50
51typedef 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
58typedef 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
66typedef struct {
67 ompt_state_t state;
68 ompt_wait_id_t wait_id;
69 void *idle_frame;
70} ompt_thread_info_t;
71
72
73extern ompt_status_t ompt_status;
74extern ompt_callbacks_t ompt_callbacks;
75
76#ifdef __cplusplus
77extern "C" {
78#endif
79
Jonathan Peyton82a13bf2015-09-21 18:01:02 +000080void ompt_pre_init(void);
81void ompt_post_init(void);
Andrey Churbanove5f44922015-04-29 16:22:07 +000082void ompt_fini(void);
83
84#ifdef __cplusplus
85};
86#endif
87
88#endif