rocprofiler-sdk/ompt/api_args.h Source File

rocprofiler-sdk/ompt/api_args.h Source File#

Rocprofiler SDK Developer API: rocprofiler-sdk/ompt/api_args.h Source File
Rocprofiler SDK Developer API 0.6.0
ROCm Profiling API and tools
api_args.h
Go to the documentation of this file.
1// MIT License
2//
3// Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21// THE SOFTWARE.
22
23#pragma once
24
27
29
30#include <stdint.h>
31
32ROCPROFILER_EXTERN_C_INIT
33
34// all the available callback interface runtime entry points
54
55// Empty struct has a size of 0 in C but size of 1 in C++.
56// This struct is added to the union members which represent
57// functions with no arguments to ensure ABI compatibility
62
64{
65 // The ompt_data_t* values passed to the client tool are proxies.
66 // This allows the client tool to use them as it would in their own
67 // OMPT tool.
68 // We keepa a map from the address of the ompt_data_t passed to the SDK's
69 // callback to the proxy object and keep it in sync when a callback is done
70 // to the client tool.
71 struct
72 {
73 ompt_thread_t thread_type;
74 ompt_data_t* thread_data;
76
77 struct
78 {
79 ompt_data_t* thread_data;
81
82 struct
83 {
84 ompt_data_t* encountering_task_data;
85 const ompt_frame_t* encountering_task_frame;
86 ompt_data_t* parallel_data;
87 unsigned int requested_parallelism;
88 int flags;
89 const void* codeptr_ra;
91
92 struct
93 {
94 ompt_data_t* parallel_data;
95 ompt_data_t* encountering_task_data;
96 int flags;
97 const void* codeptr_ra;
99
100 struct
101 {
102 ompt_data_t* encountering_task_data;
103 const ompt_frame_t* encountering_task_frame;
104 ompt_data_t* new_task_data;
105 int flags;
106 int has_dependences;
107 const void* codeptr_ra;
109
110 struct
111 {
112 ompt_data_t* prior_task_data;
113 ompt_task_status_t prior_task_status;
114 ompt_data_t* next_task_data;
116
117 struct
118 {
119 ompt_scope_endpoint_t endpoint;
120 ompt_data_t* parallel_data;
121 ompt_data_t* task_data;
122 unsigned int actual_parallelism;
123 unsigned int index;
124 int flags;
126
127 struct
128 {
129 int device_num;
130 const char* type;
131 ompt_device_t* device;
133 const char* documentation;
135
136 struct
137 {
138 int device_num;
140
141 struct
142 {
143 int device_num;
144 const char* filename;
145 int64_t offset_in_file;
146 void* vma_in_file;
147 size_t bytes;
148 void* host_addr;
149 void* device_addr;
150 uint64_t module_id;
152
153 // struct
154 // {
155 // int device_num;
156 // uint64_t module_id;
157 // } device_unload;
158
159 struct
160 {
162 ompt_scope_endpoint_t endpoint;
163 ompt_data_t* parallel_data;
164 ompt_data_t* task_data;
165 const void* codeptr_ra;
167
168 struct
169 {
170 ompt_mutex_t kind;
171 ompt_wait_id_t wait_id;
172 const void* codeptr_ra;
174
175 struct
176 {
177 ompt_data_t* task_data;
178 const ompt_dependence_t* deps;
179 int ndeps;
181
182 struct
183 {
184 ompt_data_t* src_task_data;
185 ompt_data_t* sink_task_data;
187
188 struct
189 {
190 ompt_work_t work_type;
191 ompt_scope_endpoint_t endpoint;
192 ompt_data_t* parallel_data;
193 ompt_data_t* task_data;
194 uint64_t count;
195 const void* codeptr_ra;
197
198 struct
199 {
200 ompt_scope_endpoint_t endpoint;
201 ompt_data_t* parallel_data;
202 ompt_data_t* task_data;
203 const void* codeptr_ra;
205
206 struct
207 {
209 ompt_scope_endpoint_t endpoint;
210 ompt_data_t* parallel_data;
211 ompt_data_t* task_data;
212 const void* codeptr_ra;
214
215 struct
216 {
217 ompt_mutex_t kind;
218 unsigned int hint;
219 unsigned int impl;
220 ompt_wait_id_t wait_id;
221 const void* codeptr_ra;
223
224 struct
225 {
226 ompt_mutex_t kind;
227 ompt_wait_id_t wait_id;
228 const void* codeptr_ra;
230
231 struct
232 {
233 ompt_mutex_t kind;
234 unsigned int hint;
235 unsigned int impl;
236 ompt_wait_id_t wait_id;
237 const void* codeptr_ra;
239
240 struct
241 {
242 ompt_mutex_t kind;
243 ompt_wait_id_t wait_id;
244 const void* codeptr_ra;
246
247 struct
248 {
249 ompt_scope_endpoint_t endpoint;
250 ompt_wait_id_t wait_id;
251 const void* codeptr_ra;
253
254 struct
255 {
256 ompt_data_t* thread_data;
257 const void* codeptr_ra;
259
260 struct
261 {
262 ompt_data_t* task_data;
263 int flags;
264 const void* codeptr_ra;
266
267 struct
268 {
270 ompt_scope_endpoint_t endpoint;
271 ompt_data_t* parallel_data;
272 ompt_data_t* task_data;
273 const void* codeptr_ra;
275
276 struct
277 {
278 ompt_data_t* parallel_data;
279 ompt_data_t* task_data;
280 ompt_dispatch_t kind;
281 ompt_data_t instance;
283
284 struct
285 {
286 ompt_target_t kind;
287 ompt_scope_endpoint_t endpoint;
288 int device_num;
289 ompt_data_t* task_data;
290 ompt_data_t* target_task_data;
291 ompt_data_t* target_data;
292 const void* codeptr_ra;
294
295 struct
296 {
297 ompt_scope_endpoint_t endpoint;
298 ompt_data_t* target_task_data;
299 ompt_data_t* target_data;
300 ompt_data_t* host_op_id;
302 void* src_address;
303 int src_device_num;
304 void* dst_address;
305 int dst_device_num;
306 size_t bytes;
307 const void* codeptr_ra;
309
310 struct
311 {
312 ompt_scope_endpoint_t endpoint;
313 ompt_data_t* target_data;
314 ompt_data_t* host_op_id;
315 unsigned int requested_num_teams;
317
318 // struct
319 // {
320 // unsigned int nitems;
321 // void** host_addr;
322 // void** device_addr;
323 // size_t* bytes;
324 // unsigned int* mapping_flags;
325 // const void* codeptr_ra;
326 // } target_map_emi;
327
328 struct
329 {
330 ompt_severity_t severity;
331 const char* message;
332 size_t length;
333 const void* codeptr_ra;
335
337
339
340ROCPROFILER_EXTERN_C_FINI
int(* ompt_enumerate_states_t)(int current_state, int *next_state, const char **next_state_name)
Definition omp-tools.h:631
ompt_task_status_t
Definition omp-tools.h:404
ompt_data_t *(* ompt_get_thread_data_t)(void)
Definition omp-tools.h:643
int(* ompt_get_place_proc_ids_t)(int place_num, int ids_size, int *ids)
Definition omp-tools.h:649
int(* ompt_get_partition_place_nums_t)(int place_nums_size, int *place_nums)
Definition omp-tools.h:653
ompt_severity_t
Definition omp-tools.h:459
ompt_interface_fn_t(* ompt_function_lookup_t)(const char *interface_function_name)
Definition omp-tools.h:565
int(* ompt_get_num_devices_t)(void)
Definition omp-tools.h:676
ompt_mutex_t
Definition omp-tools.h:367
int(* ompt_get_place_num_t)(void)
Definition omp-tools.h:651
int(* ompt_get_num_procs_t)(void)
Definition omp-tools.h:645
int(* ompt_enumerate_mutex_impls_t)(int current_impl, int *next_impl, const char **next_impl_name)
Definition omp-tools.h:635
ompt_target_data_op_t
Definition omp-tools.h:337
ompt_sync_region_t
Definition omp-tools.h:323
uint64_t(* ompt_get_unique_id_t)(void)
Definition omp-tools.h:520
ompt_work_t
Definition omp-tools.h:351
int(* ompt_get_state_t)(ompt_wait_id_t *wait_id)
Definition omp-tools.h:657
int(* ompt_get_parallel_info_t)(int ancestor_level, ompt_data_t **parallel_data, int *team_size)
Definition omp-tools.h:659
ompt_dispatch_t
Definition omp-tools.h:314
int(* ompt_get_num_places_t)(void)
Definition omp-tools.h:647
uint64_t ompt_wait_id_t
Definition omp-tools.h:477
ompt_scope_endpoint_t
Definition omp-tools.h:307
ompt_target_t
Definition omp-tools.h:416
int(* ompt_get_task_info_t)(int ancestor_level, int *flags, ompt_data_t **task_data, ompt_frame_t **task_frame, ompt_data_t **parallel_data, int *thread_num)
Definition omp-tools.h:663
void ompt_device_t
Definition omp-tools.h:583
ompt_thread_t
Definition omp-tools.h:299
int(* ompt_get_target_info_t)(uint64_t *device_num, ompt_id_t *target_id, ompt_id_t *host_op_id)
Definition omp-tools.h:672
int(* ompt_get_proc_id_t)(void)
Definition omp-tools.h:655
int(* ompt_get_task_memory_t)(void **addr, unsigned long *size, int block)
Definition omp-tools.h:670
struct rocprofiler_ompt_args_t::@687 parallel_begin
struct rocprofiler_ompt_args_t::@705 mutex_acquired
struct rocprofiler_ompt_args_t::@706 nest_lock
ompt_get_num_devices_t ompt_get_num_devices
Definition api_args.h:49
ompt_get_place_num_t ompt_get_place_num
Definition api_args.h:42
struct rocprofiler_ompt_args_t::@711 target_emi
ompt_get_parallel_info_t ompt_get_parallel_info
Definition api_args.h:46
ompt_enumerate_states_t ompt_enumerate_states
Definition api_args.h:37
struct rocprofiler_ompt_args_t::@703 lock_destroy
struct rocprofiler_ompt_args_t::@702 lock_init
struct rocprofiler_ompt_args_t::@693 device_finalize
struct rocprofiler_ompt_args_t::@685 thread_begin
ompt_get_task_memory_t ompt_get_task_memory
Definition api_args.h:48
struct rocprofiler_ompt_args_t::@700 masked
struct rocprofiler_ompt_args_t::@695 sync_region_wait
ompt_get_unique_id_t ompt_get_unique_id
Definition api_args.h:52
struct rocprofiler_ompt_args_t::@701 sync_region
struct rocprofiler_ompt_args_t::@708 cancel
struct rocprofiler_ompt_args_t::@697 dependences
struct rocprofiler_ompt_args_t::@688 parallel_end
struct rocprofiler_ompt_args_t::@709 reduction
struct rocprofiler_ompt_args_t::@712 target_data_op_emi
struct rocprofiler_ompt_args_t::@694 device_load
struct rocprofiler_ompt_args_t::@713 target_submit_emi
struct rocprofiler_ompt_args_t::@696 mutex_released
ompt_get_task_info_t ompt_get_task_info
Definition api_args.h:47
ompt_get_place_proc_ids_t ompt_get_place_proc_ids
Definition api_args.h:41
ompt_get_thread_data_t ompt_get_thread_data
Definition api_args.h:39
ompt_get_proc_id_t ompt_get_proc_id
Definition api_args.h:44
struct rocprofiler_ompt_args_t::@710 dispatch
struct rocprofiler_ompt_args_t::@691 implicit_task
ompt_get_num_places_t ompt_get_num_places
Definition api_args.h:40
struct rocprofiler_ompt_args_t::@707 flush
rocprofiler_ompt_callback_functions_t callback_functions
Definition api_args.h:336
struct rocprofiler_ompt_args_t::@704 mutex_acquire
struct rocprofiler_ompt_args_t::@690 task_schedule
struct rocprofiler_ompt_args_t::@699 work
struct rocprofiler_ompt_args_t::@689 task_create
ompt_get_target_info_t ompt_get_target_info
Definition api_args.h:51
struct rocprofiler_ompt_args_t::@686 thread_end
struct rocprofiler_ompt_args_t::@714 error
ompt_get_num_procs_t ompt_get_num_procs
Definition api_args.h:50
struct rocprofiler_ompt_args_t::@692 device_initialize
ompt_get_partition_place_nums_t ompt_get_partition_place_nums
Definition api_args.h:43
struct rocprofiler_ompt_args_t::@698 task_dependence
ompt_enumerate_mutex_impls_t ompt_enumerate_mutex_impls
Definition api_args.h:38