1/* 2 * include/omp-tools.h.var 3 */ 4 5//===----------------------------------------------------------------------===// 6// 7// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 8// See https://llvm.org/LICENSE.txt for license information. 9// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 10// 11//===----------------------------------------------------------------------===// 12 13#ifndef __OMPT__ 14#define __OMPT__ 15 16/***************************************************************************** 17 * system include files 18 *****************************************************************************/ 19 20#include <stdint.h> 21#include <stddef.h> 22 23#ifdef DEPRECATION_WARNINGS 24# ifdef __cplusplus 25# define DEPRECATED_51 [[deprecated("as of 5.1")]] 26# else 27# define DEPRECATED_51 __attribute__((deprecated("as of 5.1"))) 28#endif 29#else 30#define DEPRECATED_51 31#endif 32 33/***************************************************************************** 34 * iteration macros 35 *****************************************************************************/ 36 37#define FOREACH_OMPT_INQUIRY_FN(macro) \ 38 macro (ompt_enumerate_states) \ 39 macro (ompt_enumerate_mutex_impls) \ 40 \ 41 macro (ompt_set_callback) \ 42 macro (ompt_get_callback) \ 43 \ 44 macro (ompt_get_state) \ 45 \ 46 macro (ompt_get_parallel_info) \ 47 macro (ompt_get_task_info) \ 48 macro (ompt_get_task_memory) \ 49 macro (ompt_get_thread_data) \ 50 macro (ompt_get_unique_id) \ 51 macro (ompt_finalize_tool) \ 52 \ 53 macro(ompt_get_num_procs) \ 54 macro(ompt_get_num_places) \ 55 macro(ompt_get_place_proc_ids) \ 56 macro(ompt_get_place_num) \ 57 macro(ompt_get_partition_place_nums) \ 58 macro(ompt_get_proc_id) \ 59 \ 60 macro(ompt_get_target_info) \ 61 macro(ompt_get_num_devices) 62 63#define FOREACH_OMPT_STATE(macro) \ 64 \ 65 /* first available state */ \ 66 macro (ompt_state_undefined, 0x102) /* undefined thread state */ \ 67 \ 68 /* work states (0..15) */ \ 69 macro (ompt_state_work_serial, 0x000) /* working outside parallel */ \ 70 macro (ompt_state_work_parallel, 0x001) /* working within parallel */ \ 71 macro (ompt_state_work_reduction, 0x002) /* performing a reduction */ \ 72 \ 73 /* barrier wait states (16..31) */ \ 74 macro (ompt_state_wait_barrier, 0x010) /* waiting at a barrier */ \ 75 macro (ompt_state_wait_barrier_implicit_parallel, 0x011) \ 76 /* implicit barrier at the end of parallel region */\ 77 macro (ompt_state_wait_barrier_implicit_workshare, 0x012) \ 78 /* implicit barrier at the end of worksharing */ \ 79 macro (ompt_state_wait_barrier_implicit, 0x013) /* implicit barrier */ \ 80 macro (ompt_state_wait_barrier_explicit, 0x014) /* explicit barrier */ \ 81 \ 82 /* task wait states (32..63) */ \ 83 macro (ompt_state_wait_taskwait, 0x020) /* waiting at a taskwait */ \ 84 macro (ompt_state_wait_taskgroup, 0x021) /* waiting at a taskgroup */ \ 85 \ 86 /* mutex wait states (64..127) */ \ 87 macro (ompt_state_wait_mutex, 0x040) \ 88 macro (ompt_state_wait_lock, 0x041) /* waiting for lock */ \ 89 macro (ompt_state_wait_critical, 0x042) /* waiting for critical */ \ 90 macro (ompt_state_wait_atomic, 0x043) /* waiting for atomic */ \ 91 macro (ompt_state_wait_ordered, 0x044) /* waiting for ordered */ \ 92 \ 93 /* target wait states (128..255) */ \ 94 macro (ompt_state_wait_target, 0x080) /* waiting for target region */ \ 95 macro (ompt_state_wait_target_map, 0x081) /* waiting for target data mapping operation */ \ 96 macro (ompt_state_wait_target_update, 0x082) /* waiting for target update operation */ \ 97 \ 98 /* misc (256..511) */ \ 99 macro (ompt_state_idle, 0x100) /* waiting for work */ \ 100 macro (ompt_state_overhead, 0x101) /* overhead excluding wait states */ \ 101 \ 102 /* implementation-specific states (512..) */ 103 104 105#define FOREACH_KMP_MUTEX_IMPL(macro) \ 106 macro (kmp_mutex_impl_none, 0) /* unknown implementation */ \ 107 macro (kmp_mutex_impl_spin, 1) /* based on spin */ \ 108 macro (kmp_mutex_impl_queuing, 2) /* based on some fair policy */ \ 109 macro (kmp_mutex_impl_speculative, 3) /* based on HW-supported speculation */ 110 111#define FOREACH_OMPT_HOST_EVENT(macro) \ 112 \ 113 /*--- Mandatory Events ---*/ \ 114 macro (ompt_callback_thread_begin, ompt_callback_thread_begin_t, 1) /* thread begin */ \ 115 macro (ompt_callback_thread_end, ompt_callback_thread_end_t, 2) /* thread end */ \ 116 \ 117 macro (ompt_callback_parallel_begin, ompt_callback_parallel_begin_t, 3) /* parallel begin */ \ 118 macro (ompt_callback_parallel_end, ompt_callback_parallel_end_t, 4) /* parallel end */ \ 119 \ 120 macro (ompt_callback_task_create, ompt_callback_task_create_t, 5) /* task begin */ \ 121 macro (ompt_callback_task_schedule, ompt_callback_task_schedule_t, 6) /* task schedule */ \ 122 macro (ompt_callback_implicit_task, ompt_callback_implicit_task_t, 7) /* implicit task */ \ 123 \ 124 macro (ompt_callback_control_tool, ompt_callback_control_tool_t, 11) /* control tool */ \ 125 \ 126 /* Optional Events */ \ 127 macro (ompt_callback_sync_region_wait, ompt_callback_sync_region_t, 16) /* sync region wait begin or end */ \ 128 \ 129 macro (ompt_callback_mutex_released, ompt_callback_mutex_t, 17) /* mutex released */ \ 130 \ 131 macro (ompt_callback_dependences, ompt_callback_dependences_t, 18) /* report task dependences */ \ 132 macro (ompt_callback_task_dependence, ompt_callback_task_dependence_t, 19) /* report task dependence */ \ 133 \ 134 macro (ompt_callback_work, ompt_callback_work_t, 20) /* task at work begin or end */ \ 135 \ 136 macro (ompt_callback_masked, ompt_callback_masked_t, 21) /* task at masked begin or end */ \ 137 \ 138 macro (ompt_callback_sync_region, ompt_callback_sync_region_t, 23) /* sync region begin or end */ \ 139 \ 140 macro (ompt_callback_lock_init, ompt_callback_mutex_acquire_t, 24) /* lock init */ \ 141 macro (ompt_callback_lock_destroy, ompt_callback_mutex_t, 25) /* lock destroy */ \ 142 \ 143 macro (ompt_callback_mutex_acquire, ompt_callback_mutex_acquire_t, 26) /* mutex acquire */ \ 144 macro (ompt_callback_mutex_acquired, ompt_callback_mutex_t, 27) /* mutex acquired */ \ 145 \ 146 macro (ompt_callback_nest_lock, ompt_callback_nest_lock_t, 28) /* nest lock */ \ 147 \ 148 macro (ompt_callback_flush, ompt_callback_flush_t, 29) /* after executing flush */ \ 149 \ 150 macro (ompt_callback_cancel, ompt_callback_cancel_t, 30) /* cancel innermost binding region */ \ 151 \ 152 macro (ompt_callback_reduction, ompt_callback_sync_region_t, 31) /* reduction */ \ 153 \ 154 macro (ompt_callback_dispatch, ompt_callback_dispatch_t, 32) /* dispatch of work */ \ 155 macro (ompt_callback_error, ompt_callback_error_t, 37) /* error */ 156 157#define FOREACH_OMPT_DEVICE_EVENT(macro) \ 158 /*--- Mandatory Events ---*/ \ 159 macro (ompt_callback_device_initialize, ompt_callback_device_initialize_t, 12) /* device initialize */ \ 160 macro (ompt_callback_device_finalize, ompt_callback_device_finalize_t, 13) /* device finalize */ \ 161 \ 162 macro (ompt_callback_device_load, ompt_callback_device_load_t, 14) /* device load */ \ 163 macro (ompt_callback_device_unload, ompt_callback_device_unload_t, 15) /* device unload */ 164 165#define FOREACH_OMPT_NOEMI_EVENT(macro) \ 166 /*--- Mandatory Events ---*/ \ 167 macro (ompt_callback_target, ompt_callback_target_t, 8) /* target */ \ 168 macro (ompt_callback_target_data_op, ompt_callback_target_data_op_t, 9) /* target data op */ \ 169 macro (ompt_callback_target_submit, ompt_callback_target_submit_t, 10) /* target submit */ \ 170 /* Optional Events */ \ 171 macro (ompt_callback_target_map, ompt_callback_target_map_t, 22) /* target map */ 172 173#define FOREACH_OMPT_EMI_EVENT(macro) \ 174 /*--- Mandatory Events ---*/ \ 175 macro (ompt_callback_target_emi, ompt_callback_target_emi_t, 33) /* target */ \ 176 macro (ompt_callback_target_data_op_emi,ompt_callback_target_data_op_emi_t,34) /* target data op */ \ 177 macro (ompt_callback_target_submit_emi, ompt_callback_target_submit_emi_t, 35) /* target submit */ \ 178 /* Optional Events */ \ 179 macro (ompt_callback_target_map_emi, ompt_callback_target_map_emi_t, 36) /* target map */ 180 181#define FOREACH_OMPT_50_TARGET_EVENT(macro) \ 182 FOREACH_OMPT_DEVICE_EVENT(macro) \ 183 FOREACH_OMPT_NOEMI_EVENT(macro) 184 185#define FOREACH_OMPT_51_TARGET_EVENT(macro) \ 186 FOREACH_OMPT_DEVICE_EVENT(macro) \ 187 FOREACH_OMPT_EMI_EVENT(macro) 188 189#define FOREACH_OMPT_EVENT(macro) \ 190 FOREACH_OMPT_HOST_EVENT(macro) \ 191 FOREACH_OMPT_DEVICE_EVENT(macro) \ 192 FOREACH_OMPT_NOEMI_EVENT(macro) \ 193 FOREACH_OMPT_EMI_EVENT(macro) 194 195#define FOREACH_OMPT_51_EVENT(macro) \ 196 FOREACH_OMPT_HOST_EVENT(macro) \ 197 FOREACH_OMPT_DEVICE_EVENT(macro) \ 198 FOREACH_OMPT_EMI_EVENT(macro) 199 200/***************************************************************************** 201 * implementation specific types 202 *****************************************************************************/ 203 204typedef enum kmp_mutex_impl_t { 205#define kmp_mutex_impl_macro(impl, code) impl = code, 206 FOREACH_KMP_MUTEX_IMPL(kmp_mutex_impl_macro) 207#undef kmp_mutex_impl_macro 208} kmp_mutex_impl_t; 209 210/***************************************************************************** 211 * definitions generated from spec 212 *****************************************************************************/ 213 214typedef enum ompt_callbacks_t { 215 ompt_callback_thread_begin = 1, 216 ompt_callback_thread_end = 2, 217 ompt_callback_parallel_begin = 3, 218 ompt_callback_parallel_end = 4, 219 ompt_callback_task_create = 5, 220 ompt_callback_task_schedule = 6, 221 ompt_callback_implicit_task = 7, 222 ompt_callback_target = 8, 223 ompt_callback_target_data_op = 9, 224 ompt_callback_target_submit = 10, 225 ompt_callback_control_tool = 11, 226 ompt_callback_device_initialize = 12, 227 ompt_callback_device_finalize = 13, 228 ompt_callback_device_load = 14, 229 ompt_callback_device_unload = 15, 230 ompt_callback_sync_region_wait = 16, 231 ompt_callback_mutex_released = 17, 232 ompt_callback_dependences = 18, 233 ompt_callback_task_dependence = 19, 234 ompt_callback_work = 20, 235 ompt_callback_master DEPRECATED_51 = 21, 236 ompt_callback_masked = 21, 237 ompt_callback_target_map = 22, 238 ompt_callback_sync_region = 23, 239 ompt_callback_lock_init = 24, 240 ompt_callback_lock_destroy = 25, 241 ompt_callback_mutex_acquire = 26, 242 ompt_callback_mutex_acquired = 27, 243 ompt_callback_nest_lock = 28, 244 ompt_callback_flush = 29, 245 ompt_callback_cancel = 30, 246 ompt_callback_reduction = 31, 247 ompt_callback_dispatch = 32, 248 ompt_callback_target_emi = 33, 249 ompt_callback_target_data_op_emi = 34, 250 ompt_callback_target_submit_emi = 35, 251 ompt_callback_target_map_emi = 36, 252 ompt_callback_error = 37 253} ompt_callbacks_t; 254 255typedef enum ompt_record_t { 256 ompt_record_ompt = 1, 257 ompt_record_native = 2, 258 ompt_record_invalid = 3 259} ompt_record_t; 260 261typedef enum ompt_record_native_t { 262 ompt_record_native_info = 1, 263 ompt_record_native_event = 2 264} ompt_record_native_t; 265 266typedef enum ompt_set_result_t { 267 ompt_set_error = 0, 268 ompt_set_never = 1, 269 ompt_set_impossible = 2, 270 ompt_set_sometimes = 3, 271 ompt_set_sometimes_paired = 4, 272 ompt_set_always = 5 273} ompt_set_result_t; 274 275typedef uint64_t ompt_id_t; 276 277typedef uint64_t ompt_device_time_t; 278 279typedef uint64_t ompt_buffer_cursor_t; 280 281typedef enum ompt_thread_t { 282 ompt_thread_initial = 1, 283 ompt_thread_worker = 2, 284 ompt_thread_other = 3, 285 ompt_thread_unknown = 4 286} ompt_thread_t; 287 288typedef enum ompt_scope_endpoint_t { 289 ompt_scope_begin = 1, 290 ompt_scope_end = 2, 291 ompt_scope_beginend = 3 292} ompt_scope_endpoint_t; 293 294typedef enum ompt_dispatch_t { 295 ompt_dispatch_iteration = 1, 296 ompt_dispatch_section = 2, 297 ompt_dispatch_ws_loop_chunk = 3, 298 ompt_dispatch_taskloop_chunk = 4, 299 ompt_dispatch_distribute_chunk = 5 300} ompt_dispatch_t; 301 302typedef enum ompt_sync_region_t { 303 ompt_sync_region_barrier DEPRECATED_51 = 1, 304 ompt_sync_region_barrier_implicit DEPRECATED_51 = 2, 305 ompt_sync_region_barrier_explicit = 3, 306 ompt_sync_region_barrier_implementation = 4, 307 ompt_sync_region_taskwait = 5, 308 ompt_sync_region_taskgroup = 6, 309 ompt_sync_region_reduction = 7, 310 ompt_sync_region_barrier_implicit_workshare = 8, 311 ompt_sync_region_barrier_implicit_parallel = 9, 312 ompt_sync_region_barrier_teams = 10 313} ompt_sync_region_t; 314 315typedef enum ompt_target_data_op_t { 316 ompt_target_data_alloc = 1, 317 ompt_target_data_transfer_to_device = 2, 318 ompt_target_data_transfer_from_device = 3, 319 ompt_target_data_delete = 4, 320 ompt_target_data_associate = 5, 321 ompt_target_data_disassociate = 6, 322 ompt_target_data_alloc_async = 17, 323 ompt_target_data_transfer_to_device_async = 18, 324 ompt_target_data_transfer_from_device_async = 19, 325 ompt_target_data_delete_async = 20 326} ompt_target_data_op_t; 327 328typedef enum ompt_work_t { 329 ompt_work_loop = 1, 330 ompt_work_sections = 2, 331 ompt_work_single_executor = 3, 332 ompt_work_single_other = 4, 333 ompt_work_workshare = 5, 334 ompt_work_distribute = 6, 335 ompt_work_taskloop = 7, 336 ompt_work_scope = 8, 337 ompt_work_loop_static = 10, 338 ompt_work_loop_dynamic = 11, 339 ompt_work_loop_guided = 12, 340 ompt_work_loop_other = 13 341} ompt_work_t; 342 343typedef enum ompt_mutex_t { 344 ompt_mutex_lock = 1, 345 ompt_mutex_test_lock = 2, 346 ompt_mutex_nest_lock = 3, 347 ompt_mutex_test_nest_lock = 4, 348 ompt_mutex_critical = 5, 349 ompt_mutex_atomic = 6, 350 ompt_mutex_ordered = 7 351} ompt_mutex_t; 352 353typedef enum ompt_native_mon_flag_t { 354 ompt_native_data_motion_explicit = 0x01, 355 ompt_native_data_motion_implicit = 0x02, 356 ompt_native_kernel_invocation = 0x04, 357 ompt_native_kernel_execution = 0x08, 358 ompt_native_driver = 0x10, 359 ompt_native_runtime = 0x20, 360 ompt_native_overhead = 0x40, 361 ompt_native_idleness = 0x80 362} ompt_native_mon_flag_t; 363 364typedef enum ompt_task_flag_t { 365 ompt_task_initial = 0x00000001, 366 ompt_task_implicit = 0x00000002, 367 ompt_task_explicit = 0x00000004, 368 ompt_task_target = 0x00000008, 369 ompt_task_taskwait = 0x00000010, 370 ompt_task_undeferred = 0x08000000, 371 ompt_task_untied = 0x10000000, 372 ompt_task_final = 0x20000000, 373 ompt_task_mergeable = 0x40000000, 374 ompt_task_merged = 0x80000000 375} ompt_task_flag_t; 376 377typedef enum ompt_task_status_t { 378 ompt_task_complete = 1, 379 ompt_task_yield = 2, 380 ompt_task_cancel = 3, 381 ompt_task_detach = 4, 382 ompt_task_early_fulfill = 5, 383 ompt_task_late_fulfill = 6, 384 ompt_task_switch = 7, 385 ompt_taskwait_complete = 8 386} ompt_task_status_t; 387 388typedef enum ompt_target_t { 389 ompt_target = 1, 390 ompt_target_enter_data = 2, 391 ompt_target_exit_data = 3, 392 ompt_target_update = 4, 393 ompt_target_nowait = 9, 394 ompt_target_enter_data_nowait = 10, 395 ompt_target_exit_data_nowait = 11, 396 ompt_target_update_nowait = 12 397} ompt_target_t; 398 399typedef enum ompt_parallel_flag_t { 400 ompt_parallel_invoker_program = 0x00000001, 401 ompt_parallel_invoker_runtime = 0x00000002, 402 ompt_parallel_league = 0x40000000, 403 ompt_parallel_team = 0x80000000 404} ompt_parallel_flag_t; 405 406typedef enum ompt_target_map_flag_t { 407 ompt_target_map_flag_to = 0x01, 408 ompt_target_map_flag_from = 0x02, 409 ompt_target_map_flag_alloc = 0x04, 410 ompt_target_map_flag_release = 0x08, 411 ompt_target_map_flag_delete = 0x10, 412 ompt_target_map_flag_implicit = 0x20 413} ompt_target_map_flag_t; 414 415typedef enum ompt_dependence_type_t { 416 ompt_dependence_type_in = 1, 417 ompt_dependence_type_out = 2, 418 ompt_dependence_type_inout = 3, 419 ompt_dependence_type_mutexinoutset = 4, 420 ompt_dependence_type_source = 5, 421 ompt_dependence_type_sink = 6, 422 ompt_dependence_type_inoutset = 7 423} ompt_dependence_type_t; 424 425typedef enum ompt_severity_t { 426 ompt_warning = 1, 427 ompt_fatal = 2 428} ompt_severity_t; 429 430typedef enum ompt_cancel_flag_t { 431 ompt_cancel_parallel = 0x01, 432 ompt_cancel_sections = 0x02, 433 ompt_cancel_loop = 0x04, 434 ompt_cancel_taskgroup = 0x08, 435 ompt_cancel_activated = 0x10, 436 ompt_cancel_detected = 0x20, 437 ompt_cancel_discarded_task = 0x40 438} ompt_cancel_flag_t; 439 440typedef uint64_t ompt_hwid_t; 441 442typedef uint64_t ompt_wait_id_t; 443 444typedef enum ompt_frame_flag_t { 445 ompt_frame_runtime = 0x00, 446 ompt_frame_application = 0x01, 447 ompt_frame_cfa = 0x10, 448 ompt_frame_framepointer = 0x20, 449 ompt_frame_stackaddress = 0x30 450} ompt_frame_flag_t; 451 452typedef enum ompt_state_t { 453 ompt_state_work_serial = 0x000, 454 ompt_state_work_parallel = 0x001, 455 ompt_state_work_reduction = 0x002, 456 457 ompt_state_wait_barrier DEPRECATED_51 = 0x010, 458 ompt_state_wait_barrier_implicit_parallel = 0x011, 459 ompt_state_wait_barrier_implicit_workshare = 0x012, 460 ompt_state_wait_barrier_implicit DEPRECATED_51 = 0x013, 461 ompt_state_wait_barrier_explicit = 0x014, 462 ompt_state_wait_barrier_implementation = 0x015, 463 ompt_state_wait_barrier_teams = 0x016, 464 465 ompt_state_wait_taskwait = 0x020, 466 ompt_state_wait_taskgroup = 0x021, 467 468 ompt_state_wait_mutex = 0x040, 469 ompt_state_wait_lock = 0x041, 470 ompt_state_wait_critical = 0x042, 471 ompt_state_wait_atomic = 0x043, 472 ompt_state_wait_ordered = 0x044, 473 474 ompt_state_wait_target = 0x080, 475 ompt_state_wait_target_map = 0x081, 476 ompt_state_wait_target_update = 0x082, 477 478 ompt_state_idle = 0x100, 479 ompt_state_overhead = 0x101, 480 ompt_state_undefined = 0x102 481} ompt_state_t; 482 483typedef uint64_t (*ompt_get_unique_id_t) (void); 484 485typedef uint64_t ompd_size_t; 486 487typedef uint64_t ompd_wait_id_t; 488 489typedef uint64_t ompd_addr_t; 490typedef int64_t ompd_word_t; 491typedef uint64_t ompd_seg_t; 492 493typedef uint64_t ompd_device_t; 494 495typedef uint64_t ompd_thread_id_t; 496 497typedef enum ompd_scope_t { 498 ompd_scope_global = 1, 499 ompd_scope_address_space = 2, 500 ompd_scope_thread = 3, 501 ompd_scope_parallel = 4, 502 ompd_scope_implicit_task = 5, 503 ompd_scope_task = 6 504} ompd_scope_t; 505 506typedef uint64_t ompd_icv_id_t; 507 508typedef enum ompd_rc_t { 509 ompd_rc_ok = 0, 510 ompd_rc_unavailable = 1, 511 ompd_rc_stale_handle = 2, 512 ompd_rc_bad_input = 3, 513 ompd_rc_error = 4, 514 ompd_rc_unsupported = 5, 515 ompd_rc_needs_state_tracking = 6, 516 ompd_rc_incompatible = 7, 517 ompd_rc_device_read_error = 8, 518 ompd_rc_device_write_error = 9, 519 ompd_rc_nomem = 10, 520 ompd_rc_incomplete = 11, 521 ompd_rc_callback_error = 12 522} ompd_rc_t; 523 524typedef void (*ompt_interface_fn_t) (void); 525 526typedef ompt_interface_fn_t (*ompt_function_lookup_t) ( 527 const char *interface_function_name 528); 529 530typedef union ompt_data_t { 531 uint64_t value; 532 void *ptr; 533} ompt_data_t; 534 535typedef struct ompt_frame_t { 536 ompt_data_t exit_frame; 537 ompt_data_t enter_frame; 538 int exit_frame_flags; 539 int enter_frame_flags; 540} ompt_frame_t; 541 542typedef void (*ompt_callback_t) (void); 543 544typedef void ompt_device_t; 545 546typedef void ompt_buffer_t; 547 548typedef void (*ompt_callback_buffer_request_t) ( 549 int device_num, 550 ompt_buffer_t **buffer, 551 size_t *bytes 552); 553 554typedef void (*ompt_callback_buffer_complete_t) ( 555 int device_num, 556 ompt_buffer_t *buffer, 557 size_t bytes, 558 ompt_buffer_cursor_t begin, 559 int buffer_owned 560); 561 562typedef void (*ompt_finalize_t) ( 563 ompt_data_t *tool_data 564); 565 566typedef int (*ompt_initialize_t) ( 567 ompt_function_lookup_t lookup, 568 int initial_device_num, 569 ompt_data_t *tool_data 570); 571 572typedef struct ompt_start_tool_result_t { 573 ompt_initialize_t initialize; 574 ompt_finalize_t finalize; 575 ompt_data_t tool_data; 576} ompt_start_tool_result_t; 577 578typedef struct ompt_record_abstract_t { 579 ompt_record_native_t rclass; 580 const char *type; 581 ompt_device_time_t start_time; 582 ompt_device_time_t end_time; 583 ompt_hwid_t hwid; 584} ompt_record_abstract_t; 585 586typedef struct ompt_dependence_t { 587 ompt_data_t variable; 588 ompt_dependence_type_t dependence_type; 589} ompt_dependence_t; 590 591typedef struct ompt_dispatch_chunk_t { 592 uint64_t start; 593 uint64_t iterations; 594} ompt_dispatch_chunk_t; 595 596typedef int (*ompt_enumerate_states_t) ( 597 int current_state, 598 int *next_state, 599 const char **next_state_name 600); 601 602typedef int (*ompt_enumerate_mutex_impls_t) ( 603 int current_impl, 604 int *next_impl, 605 const char **next_impl_name 606); 607 608typedef ompt_set_result_t (*ompt_set_callback_t) ( 609 ompt_callbacks_t event, 610 ompt_callback_t callback 611); 612 613typedef int (*ompt_get_callback_t) ( 614 ompt_callbacks_t event, 615 ompt_callback_t *callback 616); 617 618typedef ompt_data_t *(*ompt_get_thread_data_t) (void); 619 620typedef int (*ompt_get_num_procs_t) (void); 621 622typedef int (*ompt_get_num_places_t) (void); 623 624typedef int (*ompt_get_place_proc_ids_t) ( 625 int place_num, 626 int ids_size, 627 int *ids 628); 629 630typedef int (*ompt_get_place_num_t) (void); 631 632typedef int (*ompt_get_partition_place_nums_t) ( 633 int place_nums_size, 634 int *place_nums 635); 636 637typedef int (*ompt_get_proc_id_t) (void); 638 639typedef int (*ompt_get_state_t) ( 640 ompt_wait_id_t *wait_id 641); 642 643typedef int (*ompt_get_parallel_info_t) ( 644 int ancestor_level, 645 ompt_data_t **parallel_data, 646 int *team_size 647); 648 649typedef int (*ompt_get_task_info_t) ( 650 int ancestor_level, 651 int *flags, 652 ompt_data_t **task_data, 653 ompt_frame_t **task_frame, 654 ompt_data_t **parallel_data, 655 int *thread_num 656); 657 658typedef int (*ompt_get_task_memory_t)( 659 void **addr, 660 size_t *size, 661 int block 662); 663 664typedef int (*ompt_get_target_info_t) ( 665 uint64_t *device_num, 666 ompt_id_t *target_id, 667 ompt_id_t *host_op_id 668); 669 670typedef int (*ompt_get_num_devices_t) (void); 671 672typedef void (*ompt_finalize_tool_t) (void); 673 674typedef int (*ompt_get_device_num_procs_t) ( 675 ompt_device_t *device 676); 677 678typedef ompt_device_time_t (*ompt_get_device_time_t) ( 679 ompt_device_t *device 680); 681 682typedef double (*ompt_translate_time_t) ( 683 ompt_device_t *device, 684 ompt_device_time_t time 685); 686 687typedef ompt_set_result_t (*ompt_set_trace_ompt_t) ( 688 ompt_device_t *device, 689 unsigned int enable, 690 unsigned int etype 691); 692 693typedef ompt_set_result_t (*ompt_set_trace_native_t) ( 694 ompt_device_t *device, 695 int enable, 696 int flags 697); 698 699typedef int (*ompt_start_trace_t) ( 700 ompt_device_t *device, 701 ompt_callback_buffer_request_t request, 702 ompt_callback_buffer_complete_t complete 703); 704 705typedef int (*ompt_pause_trace_t) ( 706 ompt_device_t *device, 707 int begin_pause 708); 709 710typedef int (*ompt_flush_trace_t) ( 711 ompt_device_t *device 712); 713 714typedef int (*ompt_stop_trace_t) ( 715 ompt_device_t *device 716); 717 718typedef int (*ompt_advance_buffer_cursor_t) ( 719 ompt_device_t *device, 720 ompt_buffer_t *buffer, 721 size_t size, 722 ompt_buffer_cursor_t current, 723 ompt_buffer_cursor_t *next 724); 725 726typedef ompt_record_t (*ompt_get_record_type_t) ( 727 ompt_buffer_t *buffer, 728 ompt_buffer_cursor_t current 729); 730 731typedef void *(*ompt_get_record_native_t) ( 732 ompt_buffer_t *buffer, 733 ompt_buffer_cursor_t current, 734 ompt_id_t *host_op_id 735); 736 737typedef ompt_record_abstract_t * 738(*ompt_get_record_abstract_t) ( 739 void *native_record 740); 741 742typedef void (*ompt_callback_thread_begin_t) ( 743 ompt_thread_t thread_type, 744 ompt_data_t *thread_data 745); 746 747typedef struct ompt_record_thread_begin_t { 748 ompt_thread_t thread_type; 749} ompt_record_thread_begin_t; 750 751typedef void (*ompt_callback_thread_end_t) ( 752 ompt_data_t *thread_data 753); 754 755typedef void (*ompt_callback_parallel_begin_t) ( 756 ompt_data_t *encountering_task_data, 757 const ompt_frame_t *encountering_task_frame, 758 ompt_data_t *parallel_data, 759 unsigned int requested_parallelism, 760 int flags, 761 const void *codeptr_ra 762); 763 764typedef struct ompt_record_parallel_begin_t { 765 ompt_id_t encountering_task_id; 766 ompt_id_t parallel_id; 767 unsigned int requested_parallelism; 768 int flags; 769 const void *codeptr_ra; 770} ompt_record_parallel_begin_t; 771 772typedef void (*ompt_callback_parallel_end_t) ( 773 ompt_data_t *parallel_data, 774 ompt_data_t *encountering_task_data, 775 int flags, 776 const void *codeptr_ra 777); 778 779typedef struct ompt_record_parallel_end_t { 780 ompt_id_t parallel_id; 781 ompt_id_t encountering_task_id; 782 int flags; 783 const void *codeptr_ra; 784} ompt_record_parallel_end_t; 785 786typedef void (*ompt_callback_work_t) ( 787 ompt_work_t work_type, 788 ompt_scope_endpoint_t endpoint, 789 ompt_data_t *parallel_data, 790 ompt_data_t *task_data, 791 uint64_t count, 792 const void *codeptr_ra 793); 794 795typedef struct ompt_record_work_t { 796 ompt_work_t work_type; 797 ompt_scope_endpoint_t endpoint; 798 ompt_id_t parallel_id; 799 ompt_id_t task_id; 800 uint64_t count; 801 const void *codeptr_ra; 802} ompt_record_work_t; 803 804typedef void (*ompt_callback_dispatch_t) ( 805 ompt_data_t *parallel_data, 806 ompt_data_t *task_data, 807 ompt_dispatch_t kind, 808 ompt_data_t instance 809); 810 811typedef struct ompt_record_dispatch_t { 812 ompt_id_t parallel_id; 813 ompt_id_t task_id; 814 ompt_dispatch_t kind; 815 ompt_data_t instance; 816} ompt_record_dispatch_t; 817 818typedef void (*ompt_callback_task_create_t) ( 819 ompt_data_t *encountering_task_data, 820 const ompt_frame_t *encountering_task_frame, 821 ompt_data_t *new_task_data, 822 int flags, 823 int has_dependences, 824 const void *codeptr_ra 825); 826 827typedef struct ompt_record_task_create_t { 828 ompt_id_t encountering_task_id; 829 ompt_id_t new_task_id; 830 int flags; 831 int has_dependences; 832 const void *codeptr_ra; 833} ompt_record_task_create_t; 834 835typedef void (*ompt_callback_dependences_t) ( 836 ompt_data_t *task_data, 837 const ompt_dependence_t *deps, 838 int ndeps 839); 840 841typedef struct ompt_record_dependences_t { 842 ompt_id_t task_id; 843 ompt_dependence_t dep; 844 int ndeps; 845} ompt_record_dependences_t; 846 847typedef void (*ompt_callback_task_dependence_t) ( 848 ompt_data_t *src_task_data, 849 ompt_data_t *sink_task_data 850); 851 852typedef struct ompt_record_task_dependence_t { 853 ompt_id_t src_task_id; 854 ompt_id_t sink_task_id; 855} ompt_record_task_dependence_t; 856 857typedef void (*ompt_callback_task_schedule_t) ( 858 ompt_data_t *prior_task_data, 859 ompt_task_status_t prior_task_status, 860 ompt_data_t *next_task_data 861); 862 863typedef struct ompt_record_task_schedule_t { 864 ompt_id_t prior_task_id; 865 ompt_task_status_t prior_task_status; 866 ompt_id_t next_task_id; 867} ompt_record_task_schedule_t; 868 869typedef void (*ompt_callback_implicit_task_t) ( 870 ompt_scope_endpoint_t endpoint, 871 ompt_data_t *parallel_data, 872 ompt_data_t *task_data, 873 unsigned int actual_parallelism, 874 unsigned int index, 875 int flags 876); 877 878typedef struct ompt_record_implicit_task_t { 879 ompt_scope_endpoint_t endpoint; 880 ompt_id_t parallel_id; 881 ompt_id_t task_id; 882 unsigned int actual_parallelism; 883 unsigned int index; 884 int flags; 885} ompt_record_implicit_task_t; 886 887typedef void (*ompt_callback_masked_t) ( 888 ompt_scope_endpoint_t endpoint, 889 ompt_data_t *parallel_data, 890 ompt_data_t *task_data, 891 const void *codeptr_ra 892); 893 894typedef ompt_callback_masked_t ompt_callback_master_t DEPRECATED_51; 895 896typedef struct ompt_record_masked_t { 897 ompt_scope_endpoint_t endpoint; 898 ompt_id_t parallel_id; 899 ompt_id_t task_id; 900 const void *codeptr_ra; 901} ompt_record_masked_t; 902 903typedef void (*ompt_callback_sync_region_t) ( 904 ompt_sync_region_t kind, 905 ompt_scope_endpoint_t endpoint, 906 ompt_data_t *parallel_data, 907 ompt_data_t *task_data, 908 const void *codeptr_ra 909); 910 911typedef struct ompt_record_sync_region_t { 912 ompt_sync_region_t kind; 913 ompt_scope_endpoint_t endpoint; 914 ompt_id_t parallel_id; 915 ompt_id_t task_id; 916 const void *codeptr_ra; 917} ompt_record_sync_region_t; 918 919typedef void (*ompt_callback_mutex_acquire_t) ( 920 ompt_mutex_t kind, 921 unsigned int hint, 922 unsigned int impl, 923 ompt_wait_id_t wait_id, 924 const void *codeptr_ra 925); 926 927typedef struct ompt_record_mutex_acquire_t { 928 ompt_mutex_t kind; 929 unsigned int hint; 930 unsigned int impl; 931 ompt_wait_id_t wait_id; 932 const void *codeptr_ra; 933} ompt_record_mutex_acquire_t; 934 935typedef void (*ompt_callback_mutex_t) ( 936 ompt_mutex_t kind, 937 ompt_wait_id_t wait_id, 938 const void *codeptr_ra 939); 940 941typedef struct ompt_record_mutex_t { 942 ompt_mutex_t kind; 943 ompt_wait_id_t wait_id; 944 const void *codeptr_ra; 945} ompt_record_mutex_t; 946 947typedef void (*ompt_callback_nest_lock_t) ( 948 ompt_scope_endpoint_t endpoint, 949 ompt_wait_id_t wait_id, 950 const void *codeptr_ra 951); 952 953typedef struct ompt_record_nest_lock_t { 954 ompt_scope_endpoint_t endpoint; 955 ompt_wait_id_t wait_id; 956 const void *codeptr_ra; 957} ompt_record_nest_lock_t; 958 959typedef void (*ompt_callback_flush_t) ( 960 ompt_data_t *thread_data, 961 const void *codeptr_ra 962); 963 964typedef struct ompt_record_flush_t { 965 const void *codeptr_ra; 966} ompt_record_flush_t; 967 968typedef void (*ompt_callback_cancel_t) ( 969 ompt_data_t *task_data, 970 int flags, 971 const void *codeptr_ra 972); 973 974typedef struct ompt_record_cancel_t { 975 ompt_id_t task_id; 976 int flags; 977 const void *codeptr_ra; 978} ompt_record_cancel_t; 979 980typedef void (*ompt_callback_device_initialize_t) ( 981 int device_num, 982 const char *type, 983 ompt_device_t *device, 984 ompt_function_lookup_t lookup, 985 const char *documentation 986); 987 988typedef void (*ompt_callback_device_finalize_t) ( 989 int device_num 990); 991 992typedef void (*ompt_callback_device_load_t) ( 993 int device_num, 994 const char *filename, 995 int64_t offset_in_file, 996 void *vma_in_file, 997 size_t bytes, 998 void *host_addr, 999 void *device_addr, 1000 uint64_t module_id 1001); 1002 1003typedef void (*ompt_callback_device_unload_t) ( 1004 int device_num, 1005 uint64_t module_id 1006); 1007 1008typedef void (*ompt_callback_target_data_op_emi_t) ( 1009 ompt_scope_endpoint_t endpoint, 1010 ompt_data_t *target_task_data, 1011 ompt_data_t *target_data, 1012 ompt_id_t *host_op_id, 1013 ompt_target_data_op_t optype, 1014 void *src_addr, 1015 int src_device_num, 1016 void *dest_addr, 1017 int dest_device_num, 1018 size_t bytes, 1019 const void *codeptr_ra 1020); 1021 1022typedef void (*ompt_callback_target_data_op_t) ( 1023 ompt_id_t target_id, 1024 ompt_id_t host_op_id, 1025 ompt_target_data_op_t optype, 1026 void *src_addr, 1027 int src_device_num, 1028 void *dest_addr, 1029 int dest_device_num, 1030 size_t bytes, 1031 const void *codeptr_ra 1032); 1033 1034typedef struct ompt_record_target_data_op_t { 1035 ompt_id_t host_op_id; 1036 ompt_target_data_op_t optype; 1037 void *src_addr; 1038 int src_device_num; 1039 void *dest_addr; 1040 int dest_device_num; 1041 size_t bytes; 1042 ompt_device_time_t end_time; 1043 const void *codeptr_ra; 1044} ompt_record_target_data_op_t; 1045 1046typedef void (*ompt_callback_target_emi_t) ( 1047 ompt_target_t kind, 1048 ompt_scope_endpoint_t endpoint, 1049 int device_num, 1050 ompt_data_t *task_data, 1051 ompt_data_t *target_task_data, 1052 ompt_data_t *target_data, 1053 const void *codeptr_ra 1054); 1055 1056typedef void (*ompt_callback_target_t) ( 1057 ompt_target_t kind, 1058 ompt_scope_endpoint_t endpoint, 1059 int device_num, 1060 ompt_data_t *task_data, 1061 ompt_id_t target_id, 1062 const void *codeptr_ra 1063); 1064 1065typedef struct ompt_record_target_t { 1066 ompt_target_t kind; 1067 ompt_scope_endpoint_t endpoint; 1068 int device_num; 1069 ompt_id_t task_id; 1070 ompt_id_t target_id; 1071 const void *codeptr_ra; 1072} ompt_record_target_t; 1073 1074typedef void (*ompt_callback_target_map_emi_t) ( 1075 ompt_data_t *target_data, 1076 unsigned int nitems, 1077 void **host_addr, 1078 void **device_addr, 1079 size_t *bytes, 1080 unsigned int *mapping_flags, 1081 const void *codeptr_ra 1082); 1083 1084typedef void (*ompt_callback_target_map_t) ( 1085 ompt_id_t target_id, 1086 unsigned int nitems, 1087 void **host_addr, 1088 void **device_addr, 1089 size_t *bytes, 1090 unsigned int *mapping_flags, 1091 const void *codeptr_ra 1092); 1093 1094typedef struct ompt_record_target_map_t { 1095 ompt_id_t target_id; 1096 unsigned int nitems; 1097 void **host_addr; 1098 void **device_addr; 1099 size_t *bytes; 1100 unsigned int *mapping_flags; 1101 const void *codeptr_ra; 1102} ompt_record_target_map_t; 1103 1104typedef void (*ompt_callback_target_submit_emi_t) ( 1105 ompt_scope_endpoint_t endpoint, 1106 ompt_data_t *target_data, 1107 ompt_id_t *host_op_id, 1108 unsigned int requested_num_teams 1109); 1110 1111typedef void (*ompt_callback_target_submit_t) ( 1112 ompt_id_t target_id, 1113 ompt_id_t host_op_id, 1114 unsigned int requested_num_teams 1115); 1116 1117typedef struct ompt_record_target_kernel_t { 1118 ompt_id_t host_op_id; 1119 unsigned int requested_num_teams; 1120 unsigned int granted_num_teams; 1121 ompt_device_time_t end_time; 1122} ompt_record_target_kernel_t; 1123 1124typedef int (*ompt_callback_control_tool_t) ( 1125 uint64_t command, 1126 uint64_t modifier, 1127 void *arg, 1128 const void *codeptr_ra 1129); 1130 1131typedef struct ompt_record_control_tool_t { 1132 uint64_t command; 1133 uint64_t modifier; 1134 const void *codeptr_ra; 1135} ompt_record_control_tool_t; 1136 1137typedef void (*ompt_callback_error_t) ( 1138 ompt_severity_t severity, 1139 const char *message, size_t length, 1140 const void *codeptr_ra 1141); 1142 1143typedef struct ompt_record_error_t { 1144 ompt_severity_t severity; 1145 const char *message; 1146 size_t length; 1147 const void *codeptr_ra; 1148} ompt_record_error_t; 1149 1150typedef struct ompd_address_t { 1151 ompd_seg_t segment; 1152 ompd_addr_t address; 1153} ompd_address_t; 1154 1155typedef struct ompd_frame_info_t { 1156 ompd_address_t frame_address; 1157 ompd_word_t frame_flag; 1158} ompd_frame_info_t; 1159 1160typedef struct _ompd_aspace_handle ompd_address_space_handle_t; 1161typedef struct _ompd_thread_handle ompd_thread_handle_t; 1162typedef struct _ompd_parallel_handle ompd_parallel_handle_t; 1163typedef struct _ompd_task_handle ompd_task_handle_t; 1164 1165typedef struct _ompd_aspace_cont ompd_address_space_context_t; 1166typedef struct _ompd_thread_cont ompd_thread_context_t; 1167 1168typedef struct ompd_device_type_sizes_t { 1169 uint8_t sizeof_char; 1170 uint8_t sizeof_short; 1171 uint8_t sizeof_int; 1172 uint8_t sizeof_long; 1173 uint8_t sizeof_long_long; 1174 uint8_t sizeof_pointer; 1175} ompd_device_type_sizes_t; 1176 1177void ompd_dll_locations_valid(void); 1178 1179typedef ompd_rc_t (*ompd_callback_memory_alloc_fn_t)(ompd_size_t nbytes, 1180 void **ptr); 1181 1182typedef ompd_rc_t (*ompd_callback_memory_free_fn_t)(void *ptr); 1183 1184typedef ompd_rc_t (*ompd_callback_get_thread_context_for_thread_id_fn_t)( 1185 ompd_address_space_context_t *address_space_context, ompd_thread_id_t kind, 1186 ompd_size_t sizeof_thread_id, const void *thread_id, 1187 ompd_thread_context_t **thread_context); 1188 1189typedef ompd_rc_t (*ompd_callback_sizeof_fn_t)( 1190 ompd_address_space_context_t *address_space_context, 1191 ompd_device_type_sizes_t *sizes); 1192 1193typedef ompd_rc_t (*ompd_callback_symbol_addr_fn_t)( 1194 ompd_address_space_context_t *address_space_context, 1195 ompd_thread_context_t *thread_context, const char *symbol_name, 1196 ompd_address_t *symbol_addr, const char *file_name); 1197 1198typedef ompd_rc_t (*ompd_callback_memory_read_fn_t)( 1199 ompd_address_space_context_t *address_space_context, 1200 ompd_thread_context_t *thread_context, const ompd_address_t *addr, 1201 ompd_size_t nbytes, void *buffer); 1202 1203typedef ompd_rc_t (*ompd_callback_memory_write_fn_t)( 1204 ompd_address_space_context_t *address_space_context, 1205 ompd_thread_context_t *thread_context, const ompd_address_t *addr, 1206 ompd_size_t nbytes, const void *buffer); 1207 1208typedef ompd_rc_t (*ompd_callback_device_host_fn_t)( 1209 ompd_address_space_context_t *address_space_context, const void *input, 1210 ompd_size_t unit_size, ompd_size_t count, void *output); 1211 1212typedef ompd_rc_t (*ompd_callback_print_string_fn_t)(const char *string, 1213 int category); 1214 1215typedef struct ompd_callbacks_t { 1216 ompd_callback_memory_alloc_fn_t alloc_memory; 1217 ompd_callback_memory_free_fn_t free_memory; 1218 ompd_callback_print_string_fn_t print_string; 1219 ompd_callback_sizeof_fn_t sizeof_type; 1220 ompd_callback_symbol_addr_fn_t symbol_addr_lookup; 1221 ompd_callback_memory_read_fn_t read_memory; 1222 ompd_callback_memory_write_fn_t write_memory; 1223 ompd_callback_memory_read_fn_t read_string; 1224 ompd_callback_device_host_fn_t device_to_host; 1225 ompd_callback_device_host_fn_t host_to_device; 1226 ompd_callback_get_thread_context_for_thread_id_fn_t 1227 get_thread_context_for_thread_id; 1228} ompd_callbacks_t; 1229 1230void ompd_bp_parallel_begin(void); 1231 1232void ompd_bp_parallel_end(void); 1233 1234void ompd_bp_task_begin(void); 1235 1236void ompd_bp_task_end(void); 1237 1238void ompd_bp_thread_begin(void); 1239 1240void ompd_bp_thread_end(void); 1241 1242void ompd_bp_device_begin(void); 1243 1244void ompd_bp_device_end(void); 1245 1246ompd_rc_t ompd_initialize(ompd_word_t api_version, 1247 const ompd_callbacks_t *callbacks); 1248 1249ompd_rc_t ompd_get_api_version(ompd_word_t *version); 1250 1251ompd_rc_t ompd_get_version_string(const char **string); 1252 1253ompd_rc_t ompd_finalize(void); 1254 1255ompd_rc_t ompd_process_initialize(ompd_address_space_context_t *context, 1256 ompd_address_space_handle_t **handle); 1257 1258ompd_rc_t ompd_device_initialize(ompd_address_space_handle_t *process_handle, 1259 ompd_address_space_context_t *device_context, 1260 ompd_device_t kind, ompd_size_t sizeof_id, 1261 void *id, 1262 ompd_address_space_handle_t **device_handle); 1263 1264ompd_rc_t ompd_rel_address_space_handle(ompd_address_space_handle_t *handle); 1265 1266ompd_rc_t ompd_get_omp_version(ompd_address_space_handle_t *address_space, 1267 ompd_word_t *omp_version); 1268 1269ompd_rc_t 1270ompd_get_omp_version_string(ompd_address_space_handle_t *address_space, 1271 const char **string); 1272 1273ompd_rc_t ompd_get_thread_in_parallel(ompd_parallel_handle_t *parallel_handle, 1274 int thread_num, 1275 ompd_thread_handle_t **thread_handle); 1276 1277ompd_rc_t ompd_get_thread_handle(ompd_address_space_handle_t *handle, 1278 ompd_thread_id_t kind, 1279 ompd_size_t sizeof_thread_id, 1280 const void *thread_id, 1281 ompd_thread_handle_t **thread_handle); 1282 1283ompd_rc_t ompd_rel_thread_handle(ompd_thread_handle_t *thread_handle); 1284 1285ompd_rc_t ompd_thread_handle_compare(ompd_thread_handle_t *thread_handle_1, 1286 ompd_thread_handle_t *thread_handle_2, 1287 int *cmp_value); 1288 1289ompd_rc_t ompd_get_thread_id(ompd_thread_handle_t *thread_handle, 1290 ompd_thread_id_t kind, 1291 ompd_size_t sizeof_thread_id, void *thread_id); 1292 1293ompd_rc_t 1294ompd_get_curr_parallel_handle(ompd_thread_handle_t *thread_handle, 1295 ompd_parallel_handle_t **parallel_handle); 1296 1297ompd_rc_t ompd_get_enclosing_parallel_handle( 1298 ompd_parallel_handle_t *parallel_handle, 1299 ompd_parallel_handle_t **enclosing_parallel_handle); 1300 1301ompd_rc_t 1302ompd_get_task_parallel_handle(ompd_task_handle_t *task_handle, 1303 ompd_parallel_handle_t **task_parallel_handle); 1304 1305ompd_rc_t ompd_rel_parallel_handle(ompd_parallel_handle_t *parallel_handle); 1306 1307ompd_rc_t 1308ompd_parallel_handle_compare(ompd_parallel_handle_t *parallel_handle_1, 1309 ompd_parallel_handle_t *parallel_handle_2, 1310 int *cmp_value); 1311 1312ompd_rc_t ompd_get_curr_task_handle(ompd_thread_handle_t *thread_handle, 1313 ompd_task_handle_t **task_handle); 1314 1315ompd_rc_t 1316ompd_get_generating_task_handle(ompd_task_handle_t *task_handle, 1317 ompd_task_handle_t **generating_task_handle); 1318 1319ompd_rc_t 1320ompd_get_scheduling_task_handle(ompd_task_handle_t *task_handle, 1321 ompd_task_handle_t **scheduling_task_handle); 1322 1323ompd_rc_t ompd_get_task_in_parallel(ompd_parallel_handle_t *parallel_handle, 1324 int thread_num, 1325 ompd_task_handle_t **task_handle); 1326 1327ompd_rc_t ompd_rel_task_handle(ompd_task_handle_t *task_handle); 1328 1329ompd_rc_t ompd_task_handle_compare(ompd_task_handle_t *task_handle_1, 1330 ompd_task_handle_t *task_handle_2, 1331 int *cmp_value); 1332 1333ompd_rc_t ompd_get_task_function(ompd_task_handle_t *task_handle, 1334 ompd_address_t *entry_point); 1335 1336ompd_rc_t ompd_get_task_frame(ompd_task_handle_t *task_handle, 1337 ompd_frame_info_t *exit_frame, 1338 ompd_frame_info_t *enter_frame); 1339 1340ompd_rc_t 1341ompd_enumerate_states(ompd_address_space_handle_t *address_space_handle, 1342 ompd_word_t current_state, ompd_word_t *next_state, 1343 const char **next_state_name, ompd_word_t *more_enums); 1344 1345ompd_rc_t ompd_get_state(ompd_thread_handle_t *thread_handle, 1346 ompd_word_t *state, ompd_wait_id_t *wait_id); 1347 1348ompd_rc_t 1349ompd_get_display_control_vars(ompd_address_space_handle_t *address_space_handle, 1350 const char *const **control_vars); 1351 1352ompd_rc_t ompd_rel_display_control_vars(const char *const **control_vars); 1353 1354ompd_rc_t ompd_enumerate_icvs(ompd_address_space_handle_t *handle, 1355 ompd_icv_id_t current, ompd_icv_id_t *next_id, 1356 const char **next_icv_name, 1357 ompd_scope_t *next_scope, int *more); 1358 1359ompd_rc_t ompd_get_icv_from_scope(void *handle, ompd_scope_t scope, 1360 ompd_icv_id_t icv_id, ompd_word_t *icv_value); 1361 1362ompd_rc_t ompd_get_icv_string_from_scope(void *handle, ompd_scope_t scope, 1363 ompd_icv_id_t icv_id, 1364 const char **icv_string); 1365 1366ompd_rc_t ompd_get_tool_data(void *handle, ompd_scope_t scope, 1367 ompd_word_t *value, ompd_address_t *ptr); 1368 1369typedef struct ompt_record_ompt_t { 1370 ompt_callbacks_t type; 1371 ompt_device_time_t time; 1372 ompt_id_t thread_id; 1373 ompt_id_t target_id; 1374 union { 1375 ompt_record_thread_begin_t thread_begin; 1376 ompt_record_parallel_begin_t parallel_begin; 1377 ompt_record_parallel_end_t parallel_end; 1378 ompt_record_work_t work; 1379 ompt_record_dispatch_t dispatch; 1380 ompt_record_task_create_t task_create; 1381 ompt_record_dependences_t dependences; 1382 ompt_record_task_dependence_t task_dependence; 1383 ompt_record_task_schedule_t task_schedule; 1384 ompt_record_implicit_task_t implicit_task; 1385 ompt_record_masked_t masked; 1386 ompt_record_sync_region_t sync_region; 1387 ompt_record_mutex_acquire_t mutex_acquire; 1388 ompt_record_mutex_t mutex; 1389 ompt_record_nest_lock_t nest_lock; 1390 ompt_record_flush_t flush; 1391 ompt_record_cancel_t cancel; 1392 ompt_record_target_t target; 1393 ompt_record_target_data_op_t target_data_op; 1394 ompt_record_target_map_t target_map; 1395 ompt_record_target_kernel_t target_kernel; 1396 ompt_record_control_tool_t control_tool; 1397 } record; 1398} ompt_record_ompt_t; 1399 1400typedef ompt_record_ompt_t *(*ompt_get_record_ompt_t) ( 1401 ompt_buffer_t *buffer, 1402 ompt_buffer_cursor_t current 1403); 1404 1405#define ompt_id_none 0 1406#define ompt_data_none {0} 1407#define ompt_time_none 0 1408#define ompt_hwid_none 0 1409#define ompt_addr_none ~0 1410#define ompt_mutex_impl_none 0 1411#define ompt_wait_id_none 0 1412 1413#define ompd_segment_none 0 1414 1415#endif /* __OMPT__ */ 1416