3 * include/50/omp-tools.h.var
6 //===----------------------------------------------------------------------===//
8 // The LLVM Compiler Infrastructure
10 // This file is dual licensed under the MIT and the University of Illinois Open
11 // Source Licenses. See LICENSE.txt for details.
13 //===----------------------------------------------------------------------===//
18 /*****************************************************************************
19 * system include files
20 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
29 #define FOREACH_OMPT_INQUIRY_FN(macro) \
30 macro (ompt_enumerate_states) \
31 macro (ompt_enumerate_mutex_impls) \
33 macro (ompt_set_callback) \
34 macro (ompt_get_callback) \
36 macro (ompt_get_state) \
38 macro (ompt_get_parallel_info) \
39 macro (ompt_get_task_info) \
40 macro (ompt_get_task_memory) \
41 macro (ompt_get_thread_data) \
42 macro (ompt_get_unique_id) \
43 macro (ompt_finalize_tool) \
45 macro(ompt_get_num_procs) \
46 macro(ompt_get_num_places) \
47 macro(ompt_get_place_proc_ids) \
48 macro(ompt_get_place_num) \
49 macro(ompt_get_partition_place_nums) \
50 macro(ompt_get_proc_id) \
52 macro(ompt_get_target_info) \
53 macro(ompt_get_num_devices)
55 #define FOREACH_OMPT_STATE(macro) \
57 /* first available state */ \
58 macro (ompt_state_undefined, 0x102) /* undefined thread state */ \
60 /* work states (0..15) */ \
61 macro (ompt_state_work_serial, 0x000) /* working outside parallel */ \
62 macro (ompt_state_work_parallel, 0x001) /* working within parallel */ \
63 macro (ompt_state_work_reduction, 0x002) /* performing a reduction */ \
65 /* barrier wait states (16..31) */ \
66 macro (ompt_state_wait_barrier, 0x010) /* waiting at a barrier */ \
67 macro (ompt_state_wait_barrier_implicit_parallel, 0x011) \
68 /* implicit barrier at the end of parallel region */\
69 macro (ompt_state_wait_barrier_implicit_workshare, 0x012) \
70 /* implicit barrier at the end of worksharing */ \
71 macro (ompt_state_wait_barrier_implicit, 0x013) /* implicit barrier */ \
72 macro (ompt_state_wait_barrier_explicit, 0x014) /* explicit barrier */ \
74 /* task wait states (32..63) */ \
75 macro (ompt_state_wait_taskwait, 0x020) /* waiting at a taskwait */ \
76 macro (ompt_state_wait_taskgroup, 0x021) /* waiting at a taskgroup */ \
78 /* mutex wait states (64..127) */ \
79 macro (ompt_state_wait_mutex, 0x040) \
80 macro (ompt_state_wait_lock, 0x041) /* waiting for lock */ \
81 macro (ompt_state_wait_critical, 0x042) /* waiting for critical */ \
82 macro (ompt_state_wait_atomic, 0x043) /* waiting for atomic */ \
83 macro (ompt_state_wait_ordered, 0x044) /* waiting for ordered */ \
85 /* target wait states (128..255) */ \
86 macro (ompt_state_wait_target, 0x080) /* waiting for target region */ \
87 macro (ompt_state_wait_target_map, 0x081) /* waiting for target data mapping operation */ \
88 macro (ompt_state_wait_target_update, 0x082) /* waiting for target update operation */ \
90 /* misc (256..511) */ \
91 macro (ompt_state_idle, 0x100) /* waiting for work */ \
92 macro (ompt_state_overhead, 0x101) /* overhead excluding wait states */ \
94 /* implementation-specific states (512..) */
97 #define FOREACH_KMP_MUTEX_IMPL(macro) \
98 macro (kmp_mutex_impl_none, 0) /* unknown implementation */ \
99 macro (kmp_mutex_impl_spin, 1) /* based on spin */ \
100 macro (kmp_mutex_impl_queuing, 2) /* based on some fair policy */ \
101 macro (kmp_mutex_impl_speculative, 3) /* based on HW-supported speculation */
103 #define FOREACH_OMPT_EVENT(macro) \
105 /*--- Mandatory Events ---*/ \
106 macro (ompt_callback_thread_begin, ompt_callback_thread_begin_t, 1) /* thread begin */ \
107 macro (ompt_callback_thread_end, ompt_callback_thread_end_t, 2) /* thread end */ \
109 macro (ompt_callback_parallel_begin, ompt_callback_parallel_begin_t, 3) /* parallel begin */ \
110 macro (ompt_callback_parallel_end, ompt_callback_parallel_end_t, 4) /* parallel end */ \
112 macro (ompt_callback_task_create, ompt_callback_task_create_t, 5) /* task begin */ \
113 macro (ompt_callback_task_schedule, ompt_callback_task_schedule_t, 6) /* task schedule */ \
114 macro (ompt_callback_implicit_task, ompt_callback_implicit_task_t, 7) /* implicit task */ \
116 macro (ompt_callback_target, ompt_callback_target_t, 8) /* target */ \
117 macro (ompt_callback_target_data_op, ompt_callback_target_data_op_t, 9) /* target data op */ \
118 macro (ompt_callback_target_submit, ompt_callback_target_submit_t, 10) /* target submit */ \
120 macro (ompt_callback_control_tool, ompt_callback_control_tool_t, 11) /* control tool */ \
122 macro (ompt_callback_device_initialize, ompt_callback_device_initialize_t, 12) /* device initialize */ \
123 macro (ompt_callback_device_finalize, ompt_callback_device_finalize_t, 13) /* device finalize */ \
125 macro (ompt_callback_device_load, ompt_callback_device_load_t, 14) /* device load */ \
126 macro (ompt_callback_device_unload, ompt_callback_device_unload_t, 15) /* device unload */ \
128 /* Optional Events */ \
129 macro (ompt_callback_sync_region_wait, ompt_callback_sync_region_t, 16) /* sync region wait begin or end */ \
131 macro (ompt_callback_mutex_released, ompt_callback_mutex_t, 17) /* mutex released */ \
133 macro (ompt_callback_dependences, ompt_callback_dependences_t, 18) /* report task dependences */ \
134 macro (ompt_callback_task_dependence, ompt_callback_task_dependence_t, 19) /* report task dependence */ \
136 macro (ompt_callback_work, ompt_callback_work_t, 20) /* task at work begin or end */ \
138 macro (ompt_callback_master, ompt_callback_master_t, 21) /* task at master begin or end */ \
140 macro (ompt_callback_target_map, ompt_callback_target_map_t, 22) /* target map */ \
142 macro (ompt_callback_sync_region, ompt_callback_sync_region_t, 23) /* sync region begin or end */ \
144 macro (ompt_callback_lock_init, ompt_callback_mutex_acquire_t, 24) /* lock init */ \
145 macro (ompt_callback_lock_destroy, ompt_callback_mutex_t, 25) /* lock destroy */ \
147 macro (ompt_callback_mutex_acquire, ompt_callback_mutex_acquire_t, 26) /* mutex acquire */ \
148 macro (ompt_callback_mutex_acquired, ompt_callback_mutex_t, 27) /* mutex acquired */ \
150 macro (ompt_callback_nest_lock, ompt_callback_nest_lock_t, 28) /* nest lock */ \
152 macro (ompt_callback_flush, ompt_callback_flush_t, 29) /* after executing flush */ \
154 macro (ompt_callback_cancel, ompt_callback_cancel_t, 30) /* cancel innermost binding region */ \
156 macro (ompt_callback_reduction, ompt_callback_sync_region_t, 31) /* reduction */ \
158 macro (ompt_callback_dispatch, ompt_callback_dispatch_t, 32) /* dispatch of work */
160 /*****************************************************************************
161 * implementation specific types
162 *****************************************************************************/
164 typedef enum kmp_mutex_impl_t {
165 #define kmp_mutex_impl_macro(impl, code) impl = code,
166 FOREACH_KMP_MUTEX_IMPL(kmp_mutex_impl_macro)
167 #undef kmp_mutex_impl_macro
170 /*****************************************************************************
171 * definitions generated from spec
172 *****************************************************************************/
174 typedef enum ompt_callbacks_t {
175 ompt_callback_thread_begin = 1,
176 ompt_callback_thread_end = 2,
177 ompt_callback_parallel_begin = 3,
178 ompt_callback_parallel_end = 4,
179 ompt_callback_task_create = 5,
180 ompt_callback_task_schedule = 6,
181 ompt_callback_implicit_task = 7,
182 ompt_callback_target = 8,
183 ompt_callback_target_data_op = 9,
184 ompt_callback_target_submit = 10,
185 ompt_callback_control_tool = 11,
186 ompt_callback_device_initialize = 12,
187 ompt_callback_device_finalize = 13,
188 ompt_callback_device_load = 14,
189 ompt_callback_device_unload = 15,
190 ompt_callback_sync_region_wait = 16,
191 ompt_callback_mutex_released = 17,
192 ompt_callback_dependences = 18,
193 ompt_callback_task_dependence = 19,
194 ompt_callback_work = 20,
195 ompt_callback_master = 21,
196 ompt_callback_target_map = 22,
197 ompt_callback_sync_region = 23,
198 ompt_callback_lock_init = 24,
199 ompt_callback_lock_destroy = 25,
200 ompt_callback_mutex_acquire = 26,
201 ompt_callback_mutex_acquired = 27,
202 ompt_callback_nest_lock = 28,
203 ompt_callback_flush = 29,
204 ompt_callback_cancel = 30,
205 ompt_callback_reduction = 31,
206 ompt_callback_dispatch = 32
209 typedef enum ompt_record_t {
210 ompt_record_ompt = 1,
211 ompt_record_native = 2,
212 ompt_record_invalid = 3
215 typedef enum ompt_record_native_t {
216 ompt_record_native_info = 1,
217 ompt_record_native_event = 2
218 } ompt_record_native_t;
220 typedef enum ompt_set_result_t {
223 ompt_set_impossible = 2,
224 ompt_set_sometimes = 3,
225 ompt_set_sometimes_paired = 4,
229 typedef uint64_t ompt_id_t;
231 typedef uint64_t ompt_device_time_t;
233 typedef uint64_t ompt_buffer_cursor_t;
235 typedef enum ompt_thread_t {
236 ompt_thread_initial = 1,
237 ompt_thread_worker = 2,
238 ompt_thread_other = 3,
239 ompt_thread_unknown = 4
242 typedef enum ompt_scope_endpoint_t {
243 ompt_scope_begin = 1,
245 } ompt_scope_endpoint_t;
247 typedef enum ompt_dispatch_t {
248 ompt_dispatch_iteration = 1,
249 ompt_dispatch_section = 2
252 typedef enum ompt_sync_region_t {
253 ompt_sync_region_barrier = 1,
254 ompt_sync_region_barrier_implicit = 2,
255 ompt_sync_region_barrier_explicit = 3,
256 ompt_sync_region_barrier_implementation = 4,
257 ompt_sync_region_taskwait = 5,
258 ompt_sync_region_taskgroup = 6,
259 ompt_sync_region_reduction = 7
260 } ompt_sync_region_t;
262 typedef enum ompt_target_data_op_t {
263 ompt_target_data_alloc = 1,
264 ompt_target_data_transfer_to_device = 2,
265 ompt_target_data_transfer_from_device = 3,
266 ompt_target_data_delete = 4,
267 ompt_target_data_associate = 5,
268 ompt_target_data_disassociate = 6
269 } ompt_target_data_op_t;
271 typedef enum ompt_work_t {
273 ompt_work_sections = 2,
274 ompt_work_single_executor = 3,
275 ompt_work_single_other = 4,
276 ompt_work_workshare = 5,
277 ompt_work_distribute = 6,
278 ompt_work_taskloop = 7
281 typedef enum ompt_mutex_t {
283 ompt_mutex_test_lock = 2,
284 ompt_mutex_nest_lock = 3,
285 ompt_mutex_test_nest_lock = 4,
286 ompt_mutex_critical = 5,
287 ompt_mutex_atomic = 6,
288 ompt_mutex_ordered = 7
291 typedef enum ompt_native_mon_flag_t {
292 ompt_native_data_motion_explicit = 0x01,
293 ompt_native_data_motion_implicit = 0x02,
294 ompt_native_kernel_invocation = 0x04,
295 ompt_native_kernel_execution = 0x08,
296 ompt_native_driver = 0x10,
297 ompt_native_runtime = 0x20,
298 ompt_native_overhead = 0x40,
299 ompt_native_idleness = 0x80
300 } ompt_native_mon_flag_t;
302 typedef enum ompt_task_flag_t {
303 ompt_task_initial = 0x00000001,
304 ompt_task_implicit = 0x00000002,
305 ompt_task_explicit = 0x00000004,
306 ompt_task_target = 0x00000008,
307 ompt_task_undeferred = 0x08000000,
308 ompt_task_untied = 0x10000000,
309 ompt_task_final = 0x20000000,
310 ompt_task_mergeable = 0x40000000,
311 ompt_task_merged = 0x80000000
314 typedef enum ompt_task_status_t {
315 ompt_task_complete = 1,
317 ompt_task_cancel = 3,
318 ompt_task_detach = 4,
319 ompt_task_early_fulfill = 5,
320 ompt_task_late_fulfill = 6,
322 } ompt_task_status_t;
324 typedef enum ompt_target_t {
326 ompt_target_enter_data = 2,
327 ompt_target_exit_data = 3,
328 ompt_target_update = 4
331 typedef enum ompt_parallel_flag_t {
332 ompt_parallel_invoker_program = 0x00000001,
333 ompt_parallel_invoker_runtime = 0x00000002,
334 ompt_parallel_league = 0x40000000,
335 ompt_parallel_team = 0x80000000
336 } ompt_parallel_flag_t;
338 typedef enum ompt_target_map_flag_t {
339 ompt_target_map_flag_to = 0x01,
340 ompt_target_map_flag_from = 0x02,
341 ompt_target_map_flag_alloc = 0x04,
342 ompt_target_map_flag_release = 0x08,
343 ompt_target_map_flag_delete = 0x10,
344 ompt_target_map_flag_implicit = 0x20
345 } ompt_target_map_flag_t;
347 typedef enum ompt_dependence_type_t {
348 ompt_dependence_type_in = 1,
349 ompt_dependence_type_out = 2,
350 ompt_dependence_type_inout = 3,
351 ompt_dependence_type_mutexinoutset = 4,
352 ompt_dependence_type_source = 5,
353 ompt_dependence_type_sink = 6
354 } ompt_dependence_type_t;
356 typedef enum ompt_cancel_flag_t {
357 ompt_cancel_parallel = 0x01,
358 ompt_cancel_sections = 0x02,
359 ompt_cancel_loop = 0x04,
360 ompt_cancel_taskgroup = 0x08,
361 ompt_cancel_activated = 0x10,
362 ompt_cancel_detected = 0x20,
363 ompt_cancel_discarded_task = 0x40
364 } ompt_cancel_flag_t;
366 typedef uint64_t ompt_hwid_t;
368 typedef uint64_t ompt_wait_id_t;
370 typedef enum ompt_frame_flag_t {
371 ompt_frame_runtime = 0x00,
372 ompt_frame_application = 0x01,
373 ompt_frame_cfa = 0x10,
374 ompt_frame_framepointer = 0x20,
375 ompt_frame_stackaddress = 0x30
378 typedef enum ompt_state_t {
379 ompt_state_work_serial = 0x000,
380 ompt_state_work_parallel = 0x001,
381 ompt_state_work_reduction = 0x002,
383 ompt_state_wait_barrier = 0x010,
384 ompt_state_wait_barrier_implicit_parallel = 0x011,
385 ompt_state_wait_barrier_implicit_workshare = 0x012,
386 ompt_state_wait_barrier_implicit = 0x013,
387 ompt_state_wait_barrier_explicit = 0x014,
389 ompt_state_wait_taskwait = 0x020,
390 ompt_state_wait_taskgroup = 0x021,
392 ompt_state_wait_mutex = 0x040,
393 ompt_state_wait_lock = 0x041,
394 ompt_state_wait_critical = 0x042,
395 ompt_state_wait_atomic = 0x043,
396 ompt_state_wait_ordered = 0x044,
398 ompt_state_wait_target = 0x080,
399 ompt_state_wait_target_map = 0x081,
400 ompt_state_wait_target_update = 0x082,
402 ompt_state_idle = 0x100,
403 ompt_state_overhead = 0x101,
404 ompt_state_undefined = 0x102
407 typedef uint64_t (*ompt_get_unique_id_t) (void);
409 typedef uint64_t ompd_size_t;
411 typedef uint64_t ompd_wait_id_t;
413 typedef uint64_t ompd_addr_t;
414 typedef int64_t ompd_word_t;
415 typedef uint64_t ompd_seg_t;
417 typedef uint64_t ompd_device_t;
419 typedef uint64_t ompd_thread_id_t;
421 typedef enum ompd_scope_t {
422 ompd_scope_global = 1,
423 ompd_scope_address_space = 2,
424 ompd_scope_thread = 3,
425 ompd_scope_parallel = 4,
426 ompd_scope_implicit_task = 5,
430 typedef uint64_t ompd_icv_id_t;
432 typedef enum ompd_rc_t {
434 ompd_rc_unavailable = 1,
435 ompd_rc_stale_handle = 2,
436 ompd_rc_bad_input = 3,
438 ompd_rc_unsupported = 5,
439 ompd_rc_needs_state_tracking = 6,
440 ompd_rc_incompatible = 7,
441 ompd_rc_device_read_error = 8,
442 ompd_rc_device_write_error = 9,
446 typedef void (*ompt_interface_fn_t) (void);
448 typedef ompt_interface_fn_t (*ompt_function_lookup_t) (
449 const char *interface_function_name
452 typedef union ompt_data_t {
457 typedef struct ompt_frame_t {
458 ompt_data_t exit_frame;
459 ompt_data_t enter_frame;
460 int exit_frame_flags;
461 int enter_frame_flags;
464 typedef void (*ompt_callback_t) (void);
466 typedef void ompt_device_t;
468 typedef void ompt_buffer_t;
470 typedef void (*ompt_callback_buffer_request_t) (
472 ompt_buffer_t **buffer,
476 typedef void (*ompt_callback_buffer_complete_t) (
478 ompt_buffer_t *buffer,
480 ompt_buffer_cursor_t begin,
484 typedef void (*ompt_finalize_t) (
485 ompt_data_t *tool_data
488 typedef int (*ompt_initialize_t) (
489 ompt_function_lookup_t lookup,
490 int initial_device_num,
491 ompt_data_t *tool_data
494 typedef struct ompt_start_tool_result_t {
495 ompt_initialize_t initialize;
496 ompt_finalize_t finalize;
497 ompt_data_t tool_data;
498 } ompt_start_tool_result_t;
500 typedef struct ompt_record_abstract_t {
501 ompt_record_native_t rclass;
503 ompt_device_time_t start_time;
504 ompt_device_time_t end_time;
506 } ompt_record_abstract_t;
508 typedef struct ompt_dependence_t {
509 ompt_data_t variable;
510 ompt_dependence_type_t dependence_type;
513 typedef int (*ompt_enumerate_states_t) (
516 const char **next_state_name
519 typedef int (*ompt_enumerate_mutex_impls_t) (
522 const char **next_impl_name
525 typedef ompt_set_result_t (*ompt_set_callback_t) (
526 ompt_callbacks_t event,
527 ompt_callback_t callback
530 typedef int (*ompt_get_callback_t) (
531 ompt_callbacks_t event,
532 ompt_callback_t *callback
535 typedef ompt_data_t *(*ompt_get_thread_data_t) (void);
537 typedef int (*ompt_get_num_procs_t) (void);
539 typedef int (*ompt_get_num_places_t) (void);
541 typedef int (*ompt_get_place_proc_ids_t) (
547 typedef int (*ompt_get_place_num_t) (void);
549 typedef int (*ompt_get_partition_place_nums_t) (
554 typedef int (*ompt_get_proc_id_t) (void);
556 typedef int (*ompt_get_state_t) (
557 ompt_wait_id_t *wait_id
560 typedef int (*ompt_get_parallel_info_t) (
562 ompt_data_t **parallel_data,
566 typedef int (*ompt_get_task_info_t) (
569 ompt_data_t **task_data,
570 ompt_frame_t **task_frame,
571 ompt_data_t **parallel_data,
575 typedef int (*ompt_get_task_memory_t)(
581 typedef int (*ompt_get_target_info_t) (
582 uint64_t *device_num,
583 ompt_id_t *target_id,
584 ompt_id_t *host_op_id
587 typedef int (*ompt_get_num_devices_t) (void);
589 typedef void (*ompt_finalize_tool_t) (void);
591 typedef int (*ompt_get_device_num_procs_t) (
592 ompt_device_t *device
595 typedef ompt_device_time_t (*ompt_get_device_time_t) (
596 ompt_device_t *device
599 typedef double (*ompt_translate_time_t) (
600 ompt_device_t *device,
601 ompt_device_time_t time
604 typedef ompt_set_result_t (*ompt_set_trace_ompt_t) (
605 ompt_device_t *device,
610 typedef ompt_set_result_t (*ompt_set_trace_native_t) (
611 ompt_device_t *device,
616 typedef int (*ompt_start_trace_t) (
617 ompt_device_t *device,
618 ompt_callback_buffer_request_t request,
619 ompt_callback_buffer_complete_t complete
622 typedef int (*ompt_pause_trace_t) (
623 ompt_device_t *device,
627 typedef int (*ompt_flush_trace_t) (
628 ompt_device_t *device
631 typedef int (*ompt_stop_trace_t) (
632 ompt_device_t *device
635 typedef int (*ompt_advance_buffer_cursor_t) (
636 ompt_device_t *device,
637 ompt_buffer_t *buffer,
639 ompt_buffer_cursor_t current,
640 ompt_buffer_cursor_t *next
643 typedef ompt_record_t (*ompt_get_record_type_t) (
644 ompt_buffer_t *buffer,
645 ompt_buffer_cursor_t current
648 typedef void *(*ompt_get_record_native_t) (
649 ompt_buffer_t *buffer,
650 ompt_buffer_cursor_t current,
651 ompt_id_t *host_op_id
654 typedef ompt_record_abstract_t *
655 (*ompt_get_record_abstract_t) (
659 typedef void (*ompt_callback_thread_begin_t) (
660 ompt_thread_t thread_type,
661 ompt_data_t *thread_data
664 typedef struct ompt_record_thread_begin_t {
665 ompt_thread_t thread_type;
666 } ompt_record_thread_begin_t;
668 typedef void (*ompt_callback_thread_end_t) (
669 ompt_data_t *thread_data
672 typedef void (*ompt_callback_parallel_begin_t) (
673 ompt_data_t *encountering_task_data,
674 const ompt_frame_t *encountering_task_frame,
675 ompt_data_t *parallel_data,
676 unsigned int requested_parallelism,
678 const void *codeptr_ra
681 typedef struct ompt_record_parallel_begin_t {
682 ompt_id_t encountering_task_id;
683 ompt_id_t parallel_id;
684 unsigned int requested_parallelism;
686 const void *codeptr_ra;
687 } ompt_record_parallel_begin_t;
689 typedef void (*ompt_callback_parallel_end_t) (
690 ompt_data_t *parallel_data,
691 ompt_data_t *encountering_task_data,
693 const void *codeptr_ra
696 typedef struct ompt_record_parallel_end_t {
697 ompt_id_t parallel_id;
698 ompt_id_t encountering_task_id;
700 const void *codeptr_ra;
701 } ompt_record_parallel_end_t;
703 typedef void (*ompt_callback_work_t) (
705 ompt_scope_endpoint_t endpoint,
706 ompt_data_t *parallel_data,
707 ompt_data_t *task_data,
709 const void *codeptr_ra
712 typedef struct ompt_record_work_t {
714 ompt_scope_endpoint_t endpoint;
715 ompt_id_t parallel_id;
718 const void *codeptr_ra;
719 } ompt_record_work_t;
721 typedef void (*ompt_callback_dispatch_t) (
722 ompt_data_t *parallel_data,
723 ompt_data_t *task_data,
724 ompt_dispatch_t kind,
728 typedef struct ompt_record_dispatch_t {
729 ompt_id_t parallel_id;
731 ompt_dispatch_t kind;
732 ompt_data_t instance;
733 } ompt_record_dispatch_t;
735 typedef void (*ompt_callback_task_create_t) (
736 ompt_data_t *encountering_task_data,
737 const ompt_frame_t *encountering_task_frame,
738 ompt_data_t *new_task_data,
741 const void *codeptr_ra
744 typedef struct ompt_record_task_create_t {
745 ompt_id_t encountering_task_id;
746 ompt_id_t new_task_id;
749 const void *codeptr_ra;
750 } ompt_record_task_create_t;
752 typedef void (*ompt_callback_dependences_t) (
753 ompt_data_t *task_data,
754 const ompt_dependence_t *deps,
758 typedef struct ompt_record_dependences_t {
760 ompt_dependence_t dep;
762 } ompt_record_dependences_t;
764 typedef void (*ompt_callback_task_dependence_t) (
765 ompt_data_t *src_task_data,
766 ompt_data_t *sink_task_data
769 typedef struct ompt_record_task_dependence_t {
770 ompt_id_t src_task_id;
771 ompt_id_t sink_task_id;
772 } ompt_record_task_dependence_t;
774 typedef void (*ompt_callback_task_schedule_t) (
775 ompt_data_t *prior_task_data,
776 ompt_task_status_t prior_task_status,
777 ompt_data_t *next_task_data
780 typedef struct ompt_record_task_schedule_t {
781 ompt_id_t prior_task_id;
782 ompt_task_status_t prior_task_status;
783 ompt_id_t next_task_id;
784 } ompt_record_task_schedule_t;
786 typedef void (*ompt_callback_implicit_task_t) (
787 ompt_scope_endpoint_t endpoint,
788 ompt_data_t *parallel_data,
789 ompt_data_t *task_data,
790 unsigned int actual_parallelism,
795 typedef struct ompt_record_implicit_task_t {
796 ompt_scope_endpoint_t endpoint;
797 ompt_id_t parallel_id;
799 unsigned int actual_parallelism;
802 } ompt_record_implicit_task_t;
804 typedef void (*ompt_callback_master_t) (
805 ompt_scope_endpoint_t endpoint,
806 ompt_data_t *parallel_data,
807 ompt_data_t *task_data,
808 const void *codeptr_ra
811 typedef struct ompt_record_master_t {
812 ompt_scope_endpoint_t endpoint;
813 ompt_id_t parallel_id;
815 const void *codeptr_ra;
816 } ompt_record_master_t;
818 typedef void (*ompt_callback_sync_region_t) (
819 ompt_sync_region_t kind,
820 ompt_scope_endpoint_t endpoint,
821 ompt_data_t *parallel_data,
822 ompt_data_t *task_data,
823 const void *codeptr_ra
826 typedef struct ompt_record_sync_region_t {
827 ompt_sync_region_t kind;
828 ompt_scope_endpoint_t endpoint;
829 ompt_id_t parallel_id;
831 const void *codeptr_ra;
832 } ompt_record_sync_region_t;
834 typedef void (*ompt_callback_mutex_acquire_t) (
838 ompt_wait_id_t wait_id,
839 const void *codeptr_ra
842 typedef struct ompt_record_mutex_acquire_t {
846 ompt_wait_id_t wait_id;
847 const void *codeptr_ra;
848 } ompt_record_mutex_acquire_t;
850 typedef void (*ompt_callback_mutex_t) (
852 ompt_wait_id_t wait_id,
853 const void *codeptr_ra
856 typedef struct ompt_record_mutex_t {
858 ompt_wait_id_t wait_id;
859 const void *codeptr_ra;
860 } ompt_record_mutex_t;
862 typedef void (*ompt_callback_nest_lock_t) (
863 ompt_scope_endpoint_t endpoint,
864 ompt_wait_id_t wait_id,
865 const void *codeptr_ra
868 typedef struct ompt_record_nest_lock_t {
869 ompt_scope_endpoint_t endpoint;
870 ompt_wait_id_t wait_id;
871 const void *codeptr_ra;
872 } ompt_record_nest_lock_t;
874 typedef void (*ompt_callback_flush_t) (
875 ompt_data_t *thread_data,
876 const void *codeptr_ra
879 typedef struct ompt_record_flush_t {
880 const void *codeptr_ra;
881 } ompt_record_flush_t;
883 typedef void (*ompt_callback_cancel_t) (
884 ompt_data_t *task_data,
886 const void *codeptr_ra
889 typedef struct ompt_record_cancel_t {
892 const void *codeptr_ra;
893 } ompt_record_cancel_t;
895 typedef void (*ompt_callback_device_initialize_t) (
898 ompt_device_t *device,
899 ompt_function_lookup_t lookup,
900 const char *documentation
903 typedef void (*ompt_callback_device_finalize_t) (
907 typedef void (*ompt_callback_device_load_t) (
909 const char *filename,
910 int64_t offset_in_file,
918 typedef void (*ompt_callback_device_unload_t) (
923 typedef void (*ompt_callback_target_data_op_t) (
925 ompt_id_t host_op_id,
926 ompt_target_data_op_t optype,
932 const void *codeptr_ra
935 typedef struct ompt_record_target_data_op_t {
936 ompt_id_t host_op_id;
937 ompt_target_data_op_t optype;
943 ompt_device_time_t end_time;
944 const void *codeptr_ra;
945 } ompt_record_target_data_op_t;
947 typedef void (*ompt_callback_target_t) (
949 ompt_scope_endpoint_t endpoint,
951 ompt_data_t *task_data,
953 const void *codeptr_ra
956 typedef struct ompt_record_target_t {
958 ompt_scope_endpoint_t endpoint;
962 const void *codeptr_ra;
963 } ompt_record_target_t;
965 typedef void (*ompt_callback_target_map_t) (
971 unsigned int *mapping_flags,
972 const void *codeptr_ra
975 typedef struct ompt_record_target_map_t {
981 unsigned int *mapping_flags;
982 const void *codeptr_ra;
983 } ompt_record_target_map_t;
985 typedef void (*ompt_callback_target_submit_t) (
987 ompt_id_t host_op_id,
988 unsigned int requested_num_teams
991 typedef struct ompt_record_target_kernel_t {
992 ompt_id_t host_op_id;
993 unsigned int requested_num_teams;
994 unsigned int granted_num_teams;
995 ompt_device_time_t end_time;
996 } ompt_record_target_kernel_t;
998 typedef int (*ompt_callback_control_tool_t) (
1002 const void *codeptr_ra
1005 typedef struct ompt_record_control_tool_t {
1008 const void *codeptr_ra;
1009 } ompt_record_control_tool_t;
1011 typedef struct ompd_address_t {
1013 ompd_addr_t address;
1016 typedef struct ompd_frame_info_t {
1017 ompd_address_t frame_address;
1018 ompd_word_t frame_flag;
1019 } ompd_frame_info_t;
1021 typedef struct _ompd_aspace_handle ompd_address_space_handle_t;
1022 typedef struct _ompd_thread_handle ompd_thread_handle_t;
1023 typedef struct _ompd_parallel_handle ompd_parallel_handle_t;
1024 typedef struct _ompd_task_handle ompd_task_handle_t;
1026 typedef struct _ompd_aspace_cont ompd_address_space_context_t;
1027 typedef struct _ompd_thread_cont ompd_thread_context_t;
1029 typedef struct ompd_device_type_sizes_t {
1030 uint8_t sizeof_char;
1031 uint8_t sizeof_short;
1033 uint8_t sizeof_long;
1034 uint8_t sizeof_long_long;
1035 uint8_t sizeof_pointer;
1036 } ompd_device_type_sizes_t;
1038 typedef struct ompt_record_ompt_t {
1039 ompt_callbacks_t type;
1040 ompt_device_time_t time;
1041 ompt_id_t thread_id;
1042 ompt_id_t target_id;
1044 ompt_record_thread_begin_t thread_begin;
1045 ompt_record_parallel_begin_t parallel_begin;
1046 ompt_record_parallel_end_t parallel_end;
1047 ompt_record_work_t work;
1048 ompt_record_dispatch_t dispatch;
1049 ompt_record_task_create_t task_create;
1050 ompt_record_dependences_t dependences;
1051 ompt_record_task_dependence_t task_dependence;
1052 ompt_record_task_schedule_t task_schedule;
1053 ompt_record_implicit_task_t implicit_task;
1054 ompt_record_master_t master;
1055 ompt_record_sync_region_t sync_region;
1056 ompt_record_mutex_acquire_t mutex_acquire;
1057 ompt_record_mutex_t mutex;
1058 ompt_record_nest_lock_t nest_lock;
1059 ompt_record_flush_t flush;
1060 ompt_record_cancel_t cancel;
1061 ompt_record_target_t target;
1062 ompt_record_target_data_op_t target_data_op;
1063 ompt_record_target_map_t target_map;
1064 ompt_record_target_kernel_t target_kernel;
1065 ompt_record_control_tool_t control_tool;
1067 } ompt_record_ompt_t;
1069 typedef ompt_record_ompt_t *(*ompt_get_record_ompt_t) (
1070 ompt_buffer_t *buffer,
1071 ompt_buffer_cursor_t current
1074 #define ompt_id_none 0
1075 #define ompt_data_none {0}
1076 #define ompt_time_none 0
1077 #define ompt_hwid_none 0
1078 #define ompt_addr_none ~0
1079 #define ompt_mutex_impl_none 0
1080 #define ompt_wait_id_none 0
1082 #define ompd_segment_none 0
1084 #endif /* __OMPT__ */