blob: 64e8d2e8fd6d8d5c032be4e374401780321c6e58 [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
Andrey Churbanove5f44922015-04-29 16:22:07 +000017
18typedef 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
28typedef struct {
29 ompt_frame_t frame;
30 void* function;
31 ompt_task_id_t task_id;
32} ompt_task_info_t;
33
34
35typedef struct {
36 ompt_parallel_id_t parallel_id;
37 void *microtask;
38} ompt_team_info_t;
39
40
41typedef 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
48typedef 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
56typedef 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 Churbanove5f44922015-04-29 16:22:07 +000063extern ompt_callbacks_t ompt_callbacks;
64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
Jonathan Peyton82a13bf2015-09-21 18:01:02 +000069void ompt_pre_init(void);
70void ompt_post_init(void);
Andrey Churbanove5f44922015-04-29 16:22:07 +000071void ompt_fini(void);
72
Jonathan Peytonb68a85d2015-09-21 18:11:22 +000073extern int ompt_enabled;
74
Andrey Churbanove5f44922015-04-29 16:22:07 +000075#ifdef __cplusplus
76};
77#endif
78
79#endif