1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
/*
* ompd-specific.h -- OpenMP debug support
*/
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "kmp.h"
#include "omp-tools.h"
#include <stdint.h>
#ifndef __OMPD_SPECIFIC_H__
#define __OMPD_SPECIFIC_H__
#if OMPD_SUPPORT
void ompd_init();
#ifdef __cplusplus
extern "C" {
#endif
extern char *ompd_env_block;
extern ompd_size_t ompd_env_block_size;
extern char *__kmp_tool_verbose_init;
#ifdef __cplusplus
} /* extern "C" */
#endif
extern uint64_t ompd_state;
#define OMPD_ENABLE_BP 0x1
#define OMPD_FOREACH_ACCESS(OMPD_ACCESS) \
OMPD_ACCESS(kmp_base_info_t, th_current_task) \
OMPD_ACCESS(kmp_base_info_t, th_team) \
OMPD_ACCESS(kmp_base_info_t, th_info) \
OMPD_ACCESS(kmp_base_info_t, ompt_thread_info) \
\
OMPD_ACCESS(kmp_base_root_t, r_in_parallel) \
\
OMPD_ACCESS(kmp_base_team_t, ompt_team_info) \
OMPD_ACCESS(kmp_base_team_t, ompt_serialized_team_info) \
OMPD_ACCESS(kmp_base_team_t, t_active_level) \
OMPD_ACCESS(kmp_base_team_t, t_implicit_task_taskdata) \
OMPD_ACCESS(kmp_base_team_t, t_master_tid) \
OMPD_ACCESS(kmp_base_team_t, t_nproc) \
OMPD_ACCESS(kmp_base_team_t, t_level) \
OMPD_ACCESS(kmp_base_team_t, t_parent) \
OMPD_ACCESS(kmp_base_team_t, t_pkfn) \
OMPD_ACCESS(kmp_base_team_t, t_threads) \
\
OMPD_ACCESS(kmp_desc_t, ds) \
\
OMPD_ACCESS(kmp_desc_base_t, ds_thread) \
OMPD_ACCESS(kmp_desc_base_t, ds_tid) \
\
OMPD_ACCESS(kmp_info_t, th) \
\
OMPD_ACCESS(kmp_r_sched_t, r_sched_type) \
OMPD_ACCESS(kmp_r_sched_t, chunk) \
\
OMPD_ACCESS(kmp_root_t, r) \
\
OMPD_ACCESS(kmp_internal_control_t, dynamic) \
OMPD_ACCESS(kmp_internal_control_t, max_active_levels) \
OMPD_ACCESS(kmp_internal_control_t, nproc) \
OMPD_ACCESS(kmp_internal_control_t, proc_bind) \
OMPD_ACCESS(kmp_internal_control_t, sched) \
OMPD_ACCESS(kmp_internal_control_t, default_device) \
OMPD_ACCESS(kmp_internal_control_t, thread_limit) \
\
OMPD_ACCESS(kmp_taskdata_t, ompt_task_info) \
OMPD_ACCESS(kmp_taskdata_t, td_flags) \
OMPD_ACCESS(kmp_taskdata_t, td_icvs) \
OMPD_ACCESS(kmp_taskdata_t, td_parent) \
OMPD_ACCESS(kmp_taskdata_t, td_team) \
\
OMPD_ACCESS(kmp_task_t, routine) \
\
OMPD_ACCESS(kmp_team_p, t) \
\
OMPD_ACCESS(kmp_nested_nthreads_t, used) \
OMPD_ACCESS(kmp_nested_nthreads_t, nth) \
\
OMPD_ACCESS(kmp_nested_proc_bind_t, used) \
OMPD_ACCESS(kmp_nested_proc_bind_t, bind_types) \
\
OMPD_ACCESS(ompt_task_info_t, frame) \
OMPD_ACCESS(ompt_task_info_t, scheduling_parent) \
OMPD_ACCESS(ompt_task_info_t, task_data) \
\
OMPD_ACCESS(ompt_team_info_t, parallel_data) \
\
OMPD_ACCESS(ompt_thread_info_t, state) \
OMPD_ACCESS(ompt_thread_info_t, wait_id) \
OMPD_ACCESS(ompt_thread_info_t, thread_data) \
\
OMPD_ACCESS(ompt_data_t, value) \
OMPD_ACCESS(ompt_data_t, ptr) \
\
OMPD_ACCESS(ompt_frame_t, exit_frame) \
OMPD_ACCESS(ompt_frame_t, enter_frame) \
\
OMPD_ACCESS(ompt_lw_taskteam_t, parent) \
OMPD_ACCESS(ompt_lw_taskteam_t, ompt_team_info) \
OMPD_ACCESS(ompt_lw_taskteam_t, ompt_task_info)
#define OMPD_FOREACH_BITFIELD(OMPD_BITFIELD) \
OMPD_BITFIELD(kmp_tasking_flags_t, final) \
OMPD_BITFIELD(kmp_tasking_flags_t, tiedness) \
OMPD_BITFIELD(kmp_tasking_flags_t, tasktype) \
OMPD_BITFIELD(kmp_tasking_flags_t, task_serial) \
OMPD_BITFIELD(kmp_tasking_flags_t, tasking_ser) \
OMPD_BITFIELD(kmp_tasking_flags_t, team_serial) \
OMPD_BITFIELD(kmp_tasking_flags_t, started) \
OMPD_BITFIELD(kmp_tasking_flags_t, executing) \
OMPD_BITFIELD(kmp_tasking_flags_t, complete) \
OMPD_BITFIELD(kmp_tasking_flags_t, freed) \
OMPD_BITFIELD(kmp_tasking_flags_t, native)
#define OMPD_FOREACH_SIZEOF(OMPD_SIZEOF) \
OMPD_SIZEOF(kmp_info_t) \
OMPD_SIZEOF(kmp_taskdata_t) \
OMPD_SIZEOF(kmp_task_t) \
OMPD_SIZEOF(kmp_tasking_flags_t) \
OMPD_SIZEOF(kmp_thread_t) \
OMPD_SIZEOF(ompt_data_t) \
OMPD_SIZEOF(ompt_id_t) \
OMPD_SIZEOF(__kmp_avail_proc) \
OMPD_SIZEOF(__kmp_max_nth) \
OMPD_SIZEOF(__kmp_stksize) \
OMPD_SIZEOF(__kmp_omp_cancellation) \
OMPD_SIZEOF(__kmp_max_task_priority) \
OMPD_SIZEOF(__kmp_display_affinity) \
OMPD_SIZEOF(__kmp_affinity_format) \
OMPD_SIZEOF(__kmp_tool_libraries) \
OMPD_SIZEOF(__kmp_tool_verbose_init) \
OMPD_SIZEOF(__kmp_tool) \
OMPD_SIZEOF(ompd_state) \
OMPD_SIZEOF(kmp_nested_nthreads_t) \
OMPD_SIZEOF(__kmp_nested_nth) \
OMPD_SIZEOF(kmp_nested_proc_bind_t) \
OMPD_SIZEOF(__kmp_nested_proc_bind) \
OMPD_SIZEOF(int) \
OMPD_SIZEOF(char) \
OMPD_SIZEOF(__kmp_gtid) \
OMPD_SIZEOF(__kmp_nth)
#endif /* OMPD_SUPPORT */
#endif
|