blob: eae0577f391938e6ee1d82d817744d6cbd88cda1 [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
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 */
18typedef 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
26typedef 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
36typedef struct {
37 ompt_frame_t frame;
38 void* function;
39 ompt_task_id_t task_id;
40} ompt_task_info_t;
41
42
43typedef struct {
44 ompt_parallel_id_t parallel_id;
45 void *microtask;
46} ompt_team_info_t;
47
48
49typedef 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
56typedef 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
64typedef struct {
65 ompt_state_t state;
66 ompt_wait_id_t wait_id;
67 void *idle_frame;
68} ompt_thread_info_t;
69
70
71extern ompt_status_t ompt_status;
72extern ompt_callbacks_t ompt_callbacks;
73
74#ifdef __cplusplus
75extern "C" {
76#endif
77
78void ompt_init(void);
79void ompt_fini(void);
80
81#ifdef __cplusplus
82};
83#endif
84
85#endif