LLVM OpenMP* Runtime Library
ompt-internal.h
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 #define OMPT_INVOKER(x) \
12  ((x == fork_context_gnu) ? ompt_invoker_program : ompt_invoker_runtime)
13 
14 
15 #define ompt_callback(e) e ## _callback
16 
17 
18 typedef 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 
28 typedef struct {
29  ompt_frame_t frame;
30  void* function;
31  ompt_task_id_t task_id;
32 } ompt_task_info_t;
33 
34 
35 typedef struct {
36  ompt_parallel_id_t parallel_id;
37  void *microtask;
38 } ompt_team_info_t;
39 
40 
41 typedef 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 
48 typedef 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 
56 typedef struct {
57  ompt_state_t state;
58  ompt_wait_id_t wait_id;
59  void *idle_frame;
60 } ompt_thread_info_t;
61 
62 
63 extern ompt_callbacks_t ompt_callbacks;
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68 
69 void ompt_pre_init(void);
70 void ompt_post_init(void);
71 void ompt_fini(void);
72 
73 extern int ompt_enabled;
74 
75 #ifdef __cplusplus
76 };
77 #endif
78 
79 #endif