xref: /freebsd-src/contrib/llvm-project/openmp/runtime/src/include/omp-tools.h.var (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
10b57cec5SDimitry Andric/*
20b57cec5SDimitry Andric * include/omp-tools.h.var
30b57cec5SDimitry Andric */
40b57cec5SDimitry Andric
50b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
60b57cec5SDimitry Andric//
70b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
80b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
90b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
100b57cec5SDimitry Andric//
110b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric
130b57cec5SDimitry Andric#ifndef __OMPT__
140b57cec5SDimitry Andric#define __OMPT__
150b57cec5SDimitry Andric
160b57cec5SDimitry Andric/*****************************************************************************
170b57cec5SDimitry Andric * system include files
180b57cec5SDimitry Andric *****************************************************************************/
190b57cec5SDimitry Andric
200b57cec5SDimitry Andric#include <stdint.h>
210b57cec5SDimitry Andric#include <stddef.h>
220b57cec5SDimitry Andric
23e8d8bef9SDimitry Andric#ifdef DEPRECATION_WARNINGS
24e8d8bef9SDimitry Andric# ifdef __cplusplus
25e8d8bef9SDimitry Andric# define DEPRECATED_51 [[deprecated("as of 5.1")]]
26e8d8bef9SDimitry Andric# else
27e8d8bef9SDimitry Andric# define DEPRECATED_51 __attribute__((deprecated("as of 5.1")))
28e8d8bef9SDimitry Andric#endif
29e8d8bef9SDimitry Andric#else
30e8d8bef9SDimitry Andric#define DEPRECATED_51
31e8d8bef9SDimitry Andric#endif
32e8d8bef9SDimitry Andric
330b57cec5SDimitry Andric/*****************************************************************************
340b57cec5SDimitry Andric * iteration macros
350b57cec5SDimitry Andric *****************************************************************************/
360b57cec5SDimitry Andric
370b57cec5SDimitry Andric#define FOREACH_OMPT_INQUIRY_FN(macro)      \
380b57cec5SDimitry Andric    macro (ompt_enumerate_states)           \
390b57cec5SDimitry Andric    macro (ompt_enumerate_mutex_impls)      \
400b57cec5SDimitry Andric                                            \
410b57cec5SDimitry Andric    macro (ompt_set_callback)               \
420b57cec5SDimitry Andric    macro (ompt_get_callback)               \
430b57cec5SDimitry Andric                                            \
440b57cec5SDimitry Andric    macro (ompt_get_state)                  \
450b57cec5SDimitry Andric                                            \
460b57cec5SDimitry Andric    macro (ompt_get_parallel_info)          \
470b57cec5SDimitry Andric    macro (ompt_get_task_info)              \
480b57cec5SDimitry Andric    macro (ompt_get_task_memory)            \
490b57cec5SDimitry Andric    macro (ompt_get_thread_data)            \
500b57cec5SDimitry Andric    macro (ompt_get_unique_id)              \
510b57cec5SDimitry Andric    macro (ompt_finalize_tool)              \
520b57cec5SDimitry Andric                                            \
530b57cec5SDimitry Andric    macro(ompt_get_num_procs)               \
540b57cec5SDimitry Andric    macro(ompt_get_num_places)              \
550b57cec5SDimitry Andric    macro(ompt_get_place_proc_ids)          \
560b57cec5SDimitry Andric    macro(ompt_get_place_num)               \
570b57cec5SDimitry Andric    macro(ompt_get_partition_place_nums)    \
580b57cec5SDimitry Andric    macro(ompt_get_proc_id)                 \
590b57cec5SDimitry Andric                                            \
600b57cec5SDimitry Andric    macro(ompt_get_target_info)             \
610b57cec5SDimitry Andric    macro(ompt_get_num_devices)
620b57cec5SDimitry Andric
630b57cec5SDimitry Andric#define FOREACH_OMPT_STATE(macro)                                                                \
640b57cec5SDimitry Andric                                                                                                \
650b57cec5SDimitry Andric    /* first available state */                                                                 \
660b57cec5SDimitry Andric    macro (ompt_state_undefined, 0x102)      /* undefined thread state */                        \
670b57cec5SDimitry Andric                                                                                                \
680b57cec5SDimitry Andric    /* work states (0..15) */                                                                   \
690b57cec5SDimitry Andric    macro (ompt_state_work_serial, 0x000)    /* working outside parallel */                      \
700b57cec5SDimitry Andric    macro (ompt_state_work_parallel, 0x001)  /* working within parallel */                       \
710b57cec5SDimitry Andric    macro (ompt_state_work_reduction, 0x002) /* performing a reduction */                        \
720b57cec5SDimitry Andric                                                                                                \
730b57cec5SDimitry Andric    /* barrier wait states (16..31) */                                                          \
740b57cec5SDimitry Andric    macro (ompt_state_wait_barrier, 0x010)   /* waiting at a barrier */                          \
750b57cec5SDimitry Andric    macro (ompt_state_wait_barrier_implicit_parallel, 0x011)                                     \
760b57cec5SDimitry Andric                                            /* implicit barrier at the end of parallel region */\
770b57cec5SDimitry Andric    macro (ompt_state_wait_barrier_implicit_workshare, 0x012)                                    \
780b57cec5SDimitry Andric                                            /* implicit barrier at the end of worksharing */    \
790b57cec5SDimitry Andric    macro (ompt_state_wait_barrier_implicit, 0x013)  /* implicit barrier */                      \
800b57cec5SDimitry Andric    macro (ompt_state_wait_barrier_explicit, 0x014)  /* explicit barrier */                      \
81*0fca6ea1SDimitry Andric    macro (ompt_state_wait_barrier_implementation, 0x015) /* implementation barrier */           \
82*0fca6ea1SDimitry Andric    macro (ompt_state_wait_barrier_teams, 0x016)          /* teams barrier */                    \
830b57cec5SDimitry Andric                                                                                                \
840b57cec5SDimitry Andric    /* task wait states (32..63) */                                                             \
850b57cec5SDimitry Andric    macro (ompt_state_wait_taskwait, 0x020)  /* waiting at a taskwait */                         \
860b57cec5SDimitry Andric    macro (ompt_state_wait_taskgroup, 0x021) /* waiting at a taskgroup */                        \
870b57cec5SDimitry Andric                                                                                                \
880b57cec5SDimitry Andric    /* mutex wait states (64..127) */                                                           \
890b57cec5SDimitry Andric    macro (ompt_state_wait_mutex, 0x040)                                                         \
900b57cec5SDimitry Andric    macro (ompt_state_wait_lock, 0x041)      /* waiting for lock */                              \
910b57cec5SDimitry Andric    macro (ompt_state_wait_critical, 0x042)  /* waiting for critical */                          \
920b57cec5SDimitry Andric    macro (ompt_state_wait_atomic, 0x043)    /* waiting for atomic */                            \
930b57cec5SDimitry Andric    macro (ompt_state_wait_ordered, 0x044)   /* waiting for ordered */                           \
940b57cec5SDimitry Andric                                                                                                \
950b57cec5SDimitry Andric    /* target wait states (128..255) */                                                         \
960b57cec5SDimitry Andric    macro (ompt_state_wait_target, 0x080)        /* waiting for target region */                 \
970b57cec5SDimitry Andric    macro (ompt_state_wait_target_map, 0x081)    /* waiting for target data mapping operation */ \
980b57cec5SDimitry Andric    macro (ompt_state_wait_target_update, 0x082) /* waiting for target update operation */       \
990b57cec5SDimitry Andric                                                                                                \
1000b57cec5SDimitry Andric    /* misc (256..511) */                                                                       \
1010b57cec5SDimitry Andric    macro (ompt_state_idle, 0x100)           /* waiting for work */                              \
1020b57cec5SDimitry Andric    macro (ompt_state_overhead, 0x101)       /* overhead excluding wait states */                \
1030b57cec5SDimitry Andric                                                                                                \
1040b57cec5SDimitry Andric    /* implementation-specific states (512..) */
1050b57cec5SDimitry Andric
1060b57cec5SDimitry Andric
1070b57cec5SDimitry Andric#define FOREACH_KMP_MUTEX_IMPL(macro)                                                \
1080b57cec5SDimitry Andric    macro (kmp_mutex_impl_none, 0)         /* unknown implementation */              \
1090b57cec5SDimitry Andric    macro (kmp_mutex_impl_spin, 1)         /* based on spin */                       \
1100b57cec5SDimitry Andric    macro (kmp_mutex_impl_queuing, 2)      /* based on some fair policy */           \
1110b57cec5SDimitry Andric    macro (kmp_mutex_impl_speculative, 3)  /* based on HW-supported speculation */
1120b57cec5SDimitry Andric
113bdd1243dSDimitry Andric#define FOREACH_OMPT_HOST_EVENT(macro)                                                                                   \
1140b57cec5SDimitry Andric                                                                                                                         \
1150b57cec5SDimitry Andric    /*--- Mandatory Events ---*/                                                                                         \
1160b57cec5SDimitry Andric    macro (ompt_callback_thread_begin,      ompt_callback_thread_begin_t,       1) /* thread begin                    */ \
1170b57cec5SDimitry Andric    macro (ompt_callback_thread_end,        ompt_callback_thread_end_t,         2) /* thread end                      */ \
1180b57cec5SDimitry Andric                                                                                                                         \
1190b57cec5SDimitry Andric    macro (ompt_callback_parallel_begin,    ompt_callback_parallel_begin_t,     3) /* parallel begin                  */ \
1200b57cec5SDimitry Andric    macro (ompt_callback_parallel_end,      ompt_callback_parallel_end_t,       4) /* parallel end                    */ \
1210b57cec5SDimitry Andric                                                                                                                         \
1220b57cec5SDimitry Andric    macro (ompt_callback_task_create,       ompt_callback_task_create_t,        5) /* task begin                      */ \
1230b57cec5SDimitry Andric    macro (ompt_callback_task_schedule,     ompt_callback_task_schedule_t,      6) /* task schedule                   */ \
1240b57cec5SDimitry Andric    macro (ompt_callback_implicit_task,     ompt_callback_implicit_task_t,      7) /* implicit task                   */ \
1250b57cec5SDimitry Andric                                                                                                                         \
1260b57cec5SDimitry Andric    macro (ompt_callback_control_tool,      ompt_callback_control_tool_t,      11) /* control tool                    */ \
1270b57cec5SDimitry Andric                                                                                                                         \
1280b57cec5SDimitry Andric    /* Optional Events */                                                                                                \
1290b57cec5SDimitry Andric    macro (ompt_callback_sync_region_wait,  ompt_callback_sync_region_t,       16) /* sync region wait begin or end   */ \
1300b57cec5SDimitry Andric                                                                                                                         \
1310b57cec5SDimitry Andric    macro (ompt_callback_mutex_released,    ompt_callback_mutex_t,             17) /* mutex released                  */ \
1320b57cec5SDimitry Andric                                                                                                                         \
1330b57cec5SDimitry Andric    macro (ompt_callback_dependences,       ompt_callback_dependences_t,       18) /* report task dependences         */ \
1340b57cec5SDimitry Andric    macro (ompt_callback_task_dependence,   ompt_callback_task_dependence_t,   19) /* report task dependence          */ \
1350b57cec5SDimitry Andric                                                                                                                         \
1360b57cec5SDimitry Andric    macro (ompt_callback_work,              ompt_callback_work_t,              20) /* task at work begin or end       */ \
1370b57cec5SDimitry Andric                                                                                                                         \
138e8d8bef9SDimitry Andric    macro (ompt_callback_masked,            ompt_callback_masked_t,            21) /* task at masked begin or end     */ \
1390b57cec5SDimitry Andric                                                                                                                         \
1400b57cec5SDimitry Andric    macro (ompt_callback_sync_region,       ompt_callback_sync_region_t,       23) /* sync region begin or end        */ \
1410b57cec5SDimitry Andric                                                                                                                         \
1420b57cec5SDimitry Andric    macro (ompt_callback_lock_init,         ompt_callback_mutex_acquire_t,     24) /* lock init                       */ \
1430b57cec5SDimitry Andric    macro (ompt_callback_lock_destroy,      ompt_callback_mutex_t,             25) /* lock destroy                    */ \
1440b57cec5SDimitry Andric                                                                                                                         \
1450b57cec5SDimitry Andric    macro (ompt_callback_mutex_acquire,     ompt_callback_mutex_acquire_t,     26) /* mutex acquire                   */ \
1460b57cec5SDimitry Andric    macro (ompt_callback_mutex_acquired,    ompt_callback_mutex_t,             27) /* mutex acquired                  */ \
1470b57cec5SDimitry Andric                                                                                                                         \
1480b57cec5SDimitry Andric    macro (ompt_callback_nest_lock,         ompt_callback_nest_lock_t,         28) /* nest lock                       */ \
1490b57cec5SDimitry Andric                                                                                                                         \
1500b57cec5SDimitry Andric    macro (ompt_callback_flush,             ompt_callback_flush_t,             29) /* after executing flush           */ \
1510b57cec5SDimitry Andric                                                                                                                         \
1520b57cec5SDimitry Andric    macro (ompt_callback_cancel,            ompt_callback_cancel_t,            30) /* cancel innermost binding region */ \
1530b57cec5SDimitry Andric                                                                                                                         \
1540b57cec5SDimitry Andric    macro (ompt_callback_reduction,         ompt_callback_sync_region_t,       31) /* reduction                       */ \
1550b57cec5SDimitry Andric                                                                                                                         \
156e8d8bef9SDimitry Andric    macro (ompt_callback_dispatch,          ompt_callback_dispatch_t,          32) /* dispatch of work                */ \
157bdd1243dSDimitry Andric    macro (ompt_callback_error,             ompt_callback_error_t,             37) /* error                           */
158bdd1243dSDimitry Andric
159bdd1243dSDimitry Andric#define FOREACH_OMPT_DEVICE_EVENT(macro)                                                                                 \
160bdd1243dSDimitry Andric    /*--- Mandatory Events ---*/                                                                                         \
161bdd1243dSDimitry Andric    macro (ompt_callback_device_initialize, ompt_callback_device_initialize_t, 12) /* device initialize               */ \
162bdd1243dSDimitry Andric    macro (ompt_callback_device_finalize,   ompt_callback_device_finalize_t,   13) /* device finalize                 */ \
163bdd1243dSDimitry Andric                                                                                                                         \
164bdd1243dSDimitry Andric    macro (ompt_callback_device_load,       ompt_callback_device_load_t,       14) /* device load                     */ \
165bdd1243dSDimitry Andric    macro (ompt_callback_device_unload,     ompt_callback_device_unload_t,     15) /* device unload                   */
166bdd1243dSDimitry Andric
167bdd1243dSDimitry Andric#define FOREACH_OMPT_NOEMI_EVENT(macro)                                                                                  \
168bdd1243dSDimitry Andric    /*--- Mandatory Events ---*/                                                                                         \
169bdd1243dSDimitry Andric    macro (ompt_callback_target,            ompt_callback_target_t,             8) /* target                          */ \
170bdd1243dSDimitry Andric    macro (ompt_callback_target_data_op,    ompt_callback_target_data_op_t,     9) /* target data op                  */ \
171bdd1243dSDimitry Andric    macro (ompt_callback_target_submit,     ompt_callback_target_submit_t,     10) /* target  submit                  */ \
172bdd1243dSDimitry Andric    /* Optional Events */                                                                                                \
173bdd1243dSDimitry Andric    macro (ompt_callback_target_map,        ompt_callback_target_map_t,        22) /* target map                      */
174bdd1243dSDimitry Andric
175bdd1243dSDimitry Andric#define FOREACH_OMPT_EMI_EVENT(macro)                                                                                    \
176bdd1243dSDimitry Andric    /*--- Mandatory Events ---*/                                                                                         \
177e8d8bef9SDimitry Andric    macro (ompt_callback_target_emi,        ompt_callback_target_emi_t,        33) /* target                          */ \
178e8d8bef9SDimitry Andric    macro (ompt_callback_target_data_op_emi,ompt_callback_target_data_op_emi_t,34) /* target data op                  */ \
179e8d8bef9SDimitry Andric    macro (ompt_callback_target_submit_emi, ompt_callback_target_submit_emi_t, 35) /* target submit                   */ \
180bdd1243dSDimitry Andric    /* Optional Events */                                                                                                \
181bdd1243dSDimitry Andric    macro (ompt_callback_target_map_emi,    ompt_callback_target_map_emi_t,    36) /* target map                      */
182bdd1243dSDimitry Andric
183bdd1243dSDimitry Andric#define FOREACH_OMPT_50_TARGET_EVENT(macro)                                                                              \
184bdd1243dSDimitry Andric    FOREACH_OMPT_DEVICE_EVENT(macro)                                                                                     \
185bdd1243dSDimitry Andric    FOREACH_OMPT_NOEMI_EVENT(macro)
186bdd1243dSDimitry Andric
187bdd1243dSDimitry Andric#define FOREACH_OMPT_51_TARGET_EVENT(macro)                                                                              \
188bdd1243dSDimitry Andric    FOREACH_OMPT_DEVICE_EVENT(macro)                                                                                     \
189bdd1243dSDimitry Andric    FOREACH_OMPT_EMI_EVENT(macro)
190bdd1243dSDimitry Andric
191bdd1243dSDimitry Andric#define FOREACH_OMPT_EVENT(macro)                                                                                        \
192bdd1243dSDimitry Andric    FOREACH_OMPT_HOST_EVENT(macro)                                                                                       \
193bdd1243dSDimitry Andric    FOREACH_OMPT_DEVICE_EVENT(macro)                                                                                     \
194bdd1243dSDimitry Andric    FOREACH_OMPT_NOEMI_EVENT(macro)                                                                                      \
195bdd1243dSDimitry Andric    FOREACH_OMPT_EMI_EVENT(macro)
196bdd1243dSDimitry Andric
197bdd1243dSDimitry Andric#define FOREACH_OMPT_51_EVENT(macro)                                                                                     \
198bdd1243dSDimitry Andric    FOREACH_OMPT_HOST_EVENT(macro)                                                                                       \
199bdd1243dSDimitry Andric    FOREACH_OMPT_DEVICE_EVENT(macro)                                                                                     \
200bdd1243dSDimitry Andric    FOREACH_OMPT_EMI_EVENT(macro)
2010b57cec5SDimitry Andric
2020b57cec5SDimitry Andric/*****************************************************************************
2030b57cec5SDimitry Andric * implementation specific types
2040b57cec5SDimitry Andric *****************************************************************************/
2050b57cec5SDimitry Andric
2060b57cec5SDimitry Andrictypedef enum kmp_mutex_impl_t {
2070b57cec5SDimitry Andric#define kmp_mutex_impl_macro(impl, code) impl = code,
2080b57cec5SDimitry Andric    FOREACH_KMP_MUTEX_IMPL(kmp_mutex_impl_macro)
2090b57cec5SDimitry Andric#undef kmp_mutex_impl_macro
2100b57cec5SDimitry Andric} kmp_mutex_impl_t;
2110b57cec5SDimitry Andric
2120b57cec5SDimitry Andric/*****************************************************************************
2130b57cec5SDimitry Andric * definitions generated from spec
2140b57cec5SDimitry Andric *****************************************************************************/
2150b57cec5SDimitry Andric
216*0fca6ea1SDimitry Andric#if defined(__cplusplus)
217*0fca6ea1SDimitry Andricextern "C" {
218*0fca6ea1SDimitry Andric#endif
219*0fca6ea1SDimitry Andric
2200b57cec5SDimitry Andrictypedef enum ompt_callbacks_t {
2210b57cec5SDimitry Andric  ompt_callback_thread_begin             = 1,
2220b57cec5SDimitry Andric  ompt_callback_thread_end               = 2,
2230b57cec5SDimitry Andric  ompt_callback_parallel_begin           = 3,
2240b57cec5SDimitry Andric  ompt_callback_parallel_end             = 4,
2250b57cec5SDimitry Andric  ompt_callback_task_create              = 5,
2260b57cec5SDimitry Andric  ompt_callback_task_schedule            = 6,
2270b57cec5SDimitry Andric  ompt_callback_implicit_task            = 7,
2280b57cec5SDimitry Andric  ompt_callback_target                   = 8,
2290b57cec5SDimitry Andric  ompt_callback_target_data_op           = 9,
2300b57cec5SDimitry Andric  ompt_callback_target_submit            = 10,
2310b57cec5SDimitry Andric  ompt_callback_control_tool             = 11,
2320b57cec5SDimitry Andric  ompt_callback_device_initialize        = 12,
2330b57cec5SDimitry Andric  ompt_callback_device_finalize          = 13,
2340b57cec5SDimitry Andric  ompt_callback_device_load              = 14,
2350b57cec5SDimitry Andric  ompt_callback_device_unload            = 15,
2360b57cec5SDimitry Andric  ompt_callback_sync_region_wait         = 16,
2370b57cec5SDimitry Andric  ompt_callback_mutex_released           = 17,
2380b57cec5SDimitry Andric  ompt_callback_dependences              = 18,
2390b57cec5SDimitry Andric  ompt_callback_task_dependence          = 19,
2400b57cec5SDimitry Andric  ompt_callback_work                     = 20,
241e8d8bef9SDimitry Andric  ompt_callback_master     DEPRECATED_51 = 21,
242e8d8bef9SDimitry Andric  ompt_callback_masked                   = 21,
2430b57cec5SDimitry Andric  ompt_callback_target_map               = 22,
2440b57cec5SDimitry Andric  ompt_callback_sync_region              = 23,
2450b57cec5SDimitry Andric  ompt_callback_lock_init                = 24,
2460b57cec5SDimitry Andric  ompt_callback_lock_destroy             = 25,
2470b57cec5SDimitry Andric  ompt_callback_mutex_acquire            = 26,
2480b57cec5SDimitry Andric  ompt_callback_mutex_acquired           = 27,
2490b57cec5SDimitry Andric  ompt_callback_nest_lock                = 28,
2500b57cec5SDimitry Andric  ompt_callback_flush                    = 29,
2510b57cec5SDimitry Andric  ompt_callback_cancel                   = 30,
2520b57cec5SDimitry Andric  ompt_callback_reduction                = 31,
253e8d8bef9SDimitry Andric  ompt_callback_dispatch                 = 32,
254e8d8bef9SDimitry Andric  ompt_callback_target_emi               = 33,
255e8d8bef9SDimitry Andric  ompt_callback_target_data_op_emi       = 34,
256e8d8bef9SDimitry Andric  ompt_callback_target_submit_emi        = 35,
257e8d8bef9SDimitry Andric  ompt_callback_target_map_emi           = 36,
258e8d8bef9SDimitry Andric  ompt_callback_error                    = 37
2590b57cec5SDimitry Andric} ompt_callbacks_t;
2600b57cec5SDimitry Andric
2610b57cec5SDimitry Andrictypedef enum ompt_record_t {
2620b57cec5SDimitry Andric  ompt_record_ompt               = 1,
2630b57cec5SDimitry Andric  ompt_record_native             = 2,
2640b57cec5SDimitry Andric  ompt_record_invalid            = 3
2650b57cec5SDimitry Andric} ompt_record_t;
2660b57cec5SDimitry Andric
2670b57cec5SDimitry Andrictypedef enum ompt_record_native_t {
2680b57cec5SDimitry Andric  ompt_record_native_info  = 1,
2690b57cec5SDimitry Andric  ompt_record_native_event = 2
2700b57cec5SDimitry Andric} ompt_record_native_t;
2710b57cec5SDimitry Andric
2720b57cec5SDimitry Andrictypedef enum ompt_set_result_t {
2730b57cec5SDimitry Andric  ompt_set_error            = 0,
2740b57cec5SDimitry Andric  ompt_set_never            = 1,
2750b57cec5SDimitry Andric  ompt_set_impossible       = 2,
2760b57cec5SDimitry Andric  ompt_set_sometimes        = 3,
2770b57cec5SDimitry Andric  ompt_set_sometimes_paired = 4,
2780b57cec5SDimitry Andric  ompt_set_always           = 5
2790b57cec5SDimitry Andric} ompt_set_result_t;
2800b57cec5SDimitry Andric
2810b57cec5SDimitry Andrictypedef uint64_t ompt_id_t;
2820b57cec5SDimitry Andric
2830b57cec5SDimitry Andrictypedef uint64_t ompt_device_time_t;
2840b57cec5SDimitry Andric
2850b57cec5SDimitry Andrictypedef uint64_t ompt_buffer_cursor_t;
2860b57cec5SDimitry Andric
2870b57cec5SDimitry Andrictypedef enum ompt_thread_t {
2880b57cec5SDimitry Andric  ompt_thread_initial                 = 1,
2890b57cec5SDimitry Andric  ompt_thread_worker                  = 2,
2900b57cec5SDimitry Andric  ompt_thread_other                   = 3,
2910b57cec5SDimitry Andric  ompt_thread_unknown                 = 4
2920b57cec5SDimitry Andric} ompt_thread_t;
2930b57cec5SDimitry Andric
2940b57cec5SDimitry Andrictypedef enum ompt_scope_endpoint_t {
2950b57cec5SDimitry Andric  ompt_scope_begin                    = 1,
296e8d8bef9SDimitry Andric  ompt_scope_end                      = 2,
297e8d8bef9SDimitry Andric  ompt_scope_beginend                 = 3
2980b57cec5SDimitry Andric} ompt_scope_endpoint_t;
2990b57cec5SDimitry Andric
3000b57cec5SDimitry Andrictypedef enum ompt_dispatch_t {
3010b57cec5SDimitry Andric  ompt_dispatch_iteration             = 1,
30281ad6265SDimitry Andric  ompt_dispatch_section               = 2,
30381ad6265SDimitry Andric  ompt_dispatch_ws_loop_chunk         = 3,
30481ad6265SDimitry Andric  ompt_dispatch_taskloop_chunk        = 4,
30581ad6265SDimitry Andric  ompt_dispatch_distribute_chunk      = 5
3060b57cec5SDimitry Andric} ompt_dispatch_t;
3070b57cec5SDimitry Andric
3080b57cec5SDimitry Andrictypedef enum ompt_sync_region_t {
309e8d8bef9SDimitry Andric  ompt_sync_region_barrier                DEPRECATED_51 = 1,
310e8d8bef9SDimitry Andric  ompt_sync_region_barrier_implicit       DEPRECATED_51 = 2,
3110b57cec5SDimitry Andric  ompt_sync_region_barrier_explicit       = 3,
3120b57cec5SDimitry Andric  ompt_sync_region_barrier_implementation = 4,
3130b57cec5SDimitry Andric  ompt_sync_region_taskwait               = 5,
3140b57cec5SDimitry Andric  ompt_sync_region_taskgroup              = 6,
315e8d8bef9SDimitry Andric  ompt_sync_region_reduction              = 7,
316e8d8bef9SDimitry Andric  ompt_sync_region_barrier_implicit_workshare = 8,
317e8d8bef9SDimitry Andric  ompt_sync_region_barrier_implicit_parallel = 9,
318e8d8bef9SDimitry Andric  ompt_sync_region_barrier_teams = 10
3190b57cec5SDimitry Andric} ompt_sync_region_t;
3200b57cec5SDimitry Andric
3210b57cec5SDimitry Andrictypedef enum ompt_target_data_op_t {
3220b57cec5SDimitry Andric  ompt_target_data_alloc                      = 1,
3230b57cec5SDimitry Andric  ompt_target_data_transfer_to_device         = 2,
3240b57cec5SDimitry Andric  ompt_target_data_transfer_from_device       = 3,
3250b57cec5SDimitry Andric  ompt_target_data_delete                     = 4,
3260b57cec5SDimitry Andric  ompt_target_data_associate                  = 5,
327e8d8bef9SDimitry Andric  ompt_target_data_disassociate               = 6,
328e8d8bef9SDimitry Andric  ompt_target_data_alloc_async                = 17,
329e8d8bef9SDimitry Andric  ompt_target_data_transfer_to_device_async   = 18,
330e8d8bef9SDimitry Andric  ompt_target_data_transfer_from_device_async = 19,
331e8d8bef9SDimitry Andric  ompt_target_data_delete_async               = 20
3320b57cec5SDimitry Andric} ompt_target_data_op_t;
3330b57cec5SDimitry Andric
3340b57cec5SDimitry Andrictypedef enum ompt_work_t {
3350b57cec5SDimitry Andric  ompt_work_loop               = 1,
3360b57cec5SDimitry Andric  ompt_work_sections           = 2,
3370b57cec5SDimitry Andric  ompt_work_single_executor    = 3,
3380b57cec5SDimitry Andric  ompt_work_single_other       = 4,
3390b57cec5SDimitry Andric  ompt_work_workshare          = 5,
3400b57cec5SDimitry Andric  ompt_work_distribute         = 6,
341e8d8bef9SDimitry Andric  ompt_work_taskloop           = 7,
34281ad6265SDimitry Andric  ompt_work_scope              = 8,
34381ad6265SDimitry Andric  ompt_work_loop_static        = 10,
34481ad6265SDimitry Andric  ompt_work_loop_dynamic       = 11,
34581ad6265SDimitry Andric  ompt_work_loop_guided        = 12,
34681ad6265SDimitry Andric  ompt_work_loop_other         = 13
3470b57cec5SDimitry Andric} ompt_work_t;
3480b57cec5SDimitry Andric
3490b57cec5SDimitry Andrictypedef enum ompt_mutex_t {
3500b57cec5SDimitry Andric  ompt_mutex_lock                     = 1,
3510b57cec5SDimitry Andric  ompt_mutex_test_lock                = 2,
3520b57cec5SDimitry Andric  ompt_mutex_nest_lock                = 3,
3530b57cec5SDimitry Andric  ompt_mutex_test_nest_lock           = 4,
3540b57cec5SDimitry Andric  ompt_mutex_critical                 = 5,
3550b57cec5SDimitry Andric  ompt_mutex_atomic                   = 6,
3560b57cec5SDimitry Andric  ompt_mutex_ordered                  = 7
3570b57cec5SDimitry Andric} ompt_mutex_t;
3580b57cec5SDimitry Andric
3590b57cec5SDimitry Andrictypedef enum ompt_native_mon_flag_t {
3600b57cec5SDimitry Andric  ompt_native_data_motion_explicit    = 0x01,
3610b57cec5SDimitry Andric  ompt_native_data_motion_implicit    = 0x02,
3620b57cec5SDimitry Andric  ompt_native_kernel_invocation       = 0x04,
3630b57cec5SDimitry Andric  ompt_native_kernel_execution        = 0x08,
3640b57cec5SDimitry Andric  ompt_native_driver                  = 0x10,
3650b57cec5SDimitry Andric  ompt_native_runtime                 = 0x20,
3660b57cec5SDimitry Andric  ompt_native_overhead                = 0x40,
3670b57cec5SDimitry Andric  ompt_native_idleness                = 0x80
3680b57cec5SDimitry Andric} ompt_native_mon_flag_t;
3690b57cec5SDimitry Andric
3700b57cec5SDimitry Andrictypedef enum ompt_task_flag_t {
3710b57cec5SDimitry Andric  ompt_task_initial                   = 0x00000001,
3720b57cec5SDimitry Andric  ompt_task_implicit                  = 0x00000002,
3730b57cec5SDimitry Andric  ompt_task_explicit                  = 0x00000004,
3740b57cec5SDimitry Andric  ompt_task_target                    = 0x00000008,
375e8d8bef9SDimitry Andric  ompt_task_taskwait                  = 0x00000010,
3760b57cec5SDimitry Andric  ompt_task_undeferred                = 0x08000000,
3770b57cec5SDimitry Andric  ompt_task_untied                    = 0x10000000,
3780b57cec5SDimitry Andric  ompt_task_final                     = 0x20000000,
3790b57cec5SDimitry Andric  ompt_task_mergeable                 = 0x40000000,
3800b57cec5SDimitry Andric  ompt_task_merged                    = 0x80000000
3810b57cec5SDimitry Andric} ompt_task_flag_t;
3820b57cec5SDimitry Andric
3830b57cec5SDimitry Andrictypedef enum ompt_task_status_t {
3840b57cec5SDimitry Andric  ompt_task_complete      = 1,
3850b57cec5SDimitry Andric  ompt_task_yield         = 2,
3860b57cec5SDimitry Andric  ompt_task_cancel        = 3,
3870b57cec5SDimitry Andric  ompt_task_detach        = 4,
3880b57cec5SDimitry Andric  ompt_task_early_fulfill = 5,
3890b57cec5SDimitry Andric  ompt_task_late_fulfill  = 6,
390e8d8bef9SDimitry Andric  ompt_task_switch        = 7,
391e8d8bef9SDimitry Andric  ompt_taskwait_complete  = 8
3920b57cec5SDimitry Andric} ompt_task_status_t;
3930b57cec5SDimitry Andric
3940b57cec5SDimitry Andrictypedef enum ompt_target_t {
3950b57cec5SDimitry Andric  ompt_target                         = 1,
3960b57cec5SDimitry Andric  ompt_target_enter_data              = 2,
3970b57cec5SDimitry Andric  ompt_target_exit_data               = 3,
398e8d8bef9SDimitry Andric  ompt_target_update                  = 4,
399e8d8bef9SDimitry Andric  ompt_target_nowait                  = 9,
400e8d8bef9SDimitry Andric  ompt_target_enter_data_nowait       = 10,
401e8d8bef9SDimitry Andric  ompt_target_exit_data_nowait        = 11,
402e8d8bef9SDimitry Andric  ompt_target_update_nowait           = 12
4030b57cec5SDimitry Andric} ompt_target_t;
4040b57cec5SDimitry Andric
4050b57cec5SDimitry Andrictypedef enum ompt_parallel_flag_t {
4060b57cec5SDimitry Andric  ompt_parallel_invoker_program = 0x00000001,
4070b57cec5SDimitry Andric  ompt_parallel_invoker_runtime = 0x00000002,
4080b57cec5SDimitry Andric  ompt_parallel_league          = 0x40000000,
4090b57cec5SDimitry Andric  ompt_parallel_team            = 0x80000000
4100b57cec5SDimitry Andric} ompt_parallel_flag_t;
4110b57cec5SDimitry Andric
4120b57cec5SDimitry Andrictypedef enum ompt_target_map_flag_t {
4130b57cec5SDimitry Andric  ompt_target_map_flag_to             = 0x01,
4140b57cec5SDimitry Andric  ompt_target_map_flag_from           = 0x02,
4150b57cec5SDimitry Andric  ompt_target_map_flag_alloc          = 0x04,
4160b57cec5SDimitry Andric  ompt_target_map_flag_release        = 0x08,
4170b57cec5SDimitry Andric  ompt_target_map_flag_delete         = 0x10,
4180b57cec5SDimitry Andric  ompt_target_map_flag_implicit       = 0x20
4190b57cec5SDimitry Andric} ompt_target_map_flag_t;
4200b57cec5SDimitry Andric
4210b57cec5SDimitry Andrictypedef enum ompt_dependence_type_t {
4220b57cec5SDimitry Andric  ompt_dependence_type_in               = 1,
4230b57cec5SDimitry Andric  ompt_dependence_type_out              = 2,
4240b57cec5SDimitry Andric  ompt_dependence_type_inout            = 3,
4250b57cec5SDimitry Andric  ompt_dependence_type_mutexinoutset    = 4,
4260b57cec5SDimitry Andric  ompt_dependence_type_source           = 5,
427e8d8bef9SDimitry Andric  ompt_dependence_type_sink             = 6,
42806c3fb27SDimitry Andric  ompt_dependence_type_inoutset         = 7,
42906c3fb27SDimitry Andric  ompt_dependence_type_out_all_memory   = 34,
43006c3fb27SDimitry Andric  ompt_dependence_type_inout_all_memory = 35
4310b57cec5SDimitry Andric} ompt_dependence_type_t;
4320b57cec5SDimitry Andric
433e8d8bef9SDimitry Andrictypedef enum ompt_severity_t {
434e8d8bef9SDimitry Andric  ompt_warning                         = 1,
435e8d8bef9SDimitry Andric  ompt_fatal                           = 2
436e8d8bef9SDimitry Andric} ompt_severity_t;
437e8d8bef9SDimitry Andric
4380b57cec5SDimitry Andrictypedef enum ompt_cancel_flag_t {
4390b57cec5SDimitry Andric  ompt_cancel_parallel       = 0x01,
4400b57cec5SDimitry Andric  ompt_cancel_sections       = 0x02,
4410b57cec5SDimitry Andric  ompt_cancel_loop           = 0x04,
4420b57cec5SDimitry Andric  ompt_cancel_taskgroup      = 0x08,
4430b57cec5SDimitry Andric  ompt_cancel_activated      = 0x10,
4440b57cec5SDimitry Andric  ompt_cancel_detected       = 0x20,
4450b57cec5SDimitry Andric  ompt_cancel_discarded_task = 0x40
4460b57cec5SDimitry Andric} ompt_cancel_flag_t;
4470b57cec5SDimitry Andric
4480b57cec5SDimitry Andrictypedef uint64_t ompt_hwid_t;
4490b57cec5SDimitry Andric
4500b57cec5SDimitry Andrictypedef uint64_t ompt_wait_id_t;
4510b57cec5SDimitry Andric
4520b57cec5SDimitry Andrictypedef enum ompt_frame_flag_t {
4530b57cec5SDimitry Andric  ompt_frame_runtime        = 0x00,
4540b57cec5SDimitry Andric  ompt_frame_application    = 0x01,
4550b57cec5SDimitry Andric  ompt_frame_cfa            = 0x10,
4560b57cec5SDimitry Andric  ompt_frame_framepointer   = 0x20,
4570b57cec5SDimitry Andric  ompt_frame_stackaddress   = 0x30
4580b57cec5SDimitry Andric} ompt_frame_flag_t;
4590b57cec5SDimitry Andric
4600b57cec5SDimitry Andrictypedef enum ompt_state_t {
4610b57cec5SDimitry Andric  ompt_state_work_serial                      = 0x000,
4620b57cec5SDimitry Andric  ompt_state_work_parallel                    = 0x001,
4630b57cec5SDimitry Andric  ompt_state_work_reduction                   = 0x002,
4640b57cec5SDimitry Andric
465e8d8bef9SDimitry Andric  ompt_state_wait_barrier                     DEPRECATED_51 = 0x010,
4660b57cec5SDimitry Andric  ompt_state_wait_barrier_implicit_parallel   = 0x011,
4670b57cec5SDimitry Andric  ompt_state_wait_barrier_implicit_workshare  = 0x012,
468e8d8bef9SDimitry Andric  ompt_state_wait_barrier_implicit            DEPRECATED_51 = 0x013,
4690b57cec5SDimitry Andric  ompt_state_wait_barrier_explicit            = 0x014,
470e8d8bef9SDimitry Andric  ompt_state_wait_barrier_implementation      = 0x015,
471e8d8bef9SDimitry Andric  ompt_state_wait_barrier_teams               = 0x016,
4720b57cec5SDimitry Andric
4730b57cec5SDimitry Andric  ompt_state_wait_taskwait                    = 0x020,
4740b57cec5SDimitry Andric  ompt_state_wait_taskgroup                   = 0x021,
4750b57cec5SDimitry Andric
4760b57cec5SDimitry Andric  ompt_state_wait_mutex                       = 0x040,
4770b57cec5SDimitry Andric  ompt_state_wait_lock                        = 0x041,
4780b57cec5SDimitry Andric  ompt_state_wait_critical                    = 0x042,
4790b57cec5SDimitry Andric  ompt_state_wait_atomic                      = 0x043,
4800b57cec5SDimitry Andric  ompt_state_wait_ordered                     = 0x044,
4810b57cec5SDimitry Andric
4820b57cec5SDimitry Andric  ompt_state_wait_target                      = 0x080,
4830b57cec5SDimitry Andric  ompt_state_wait_target_map                  = 0x081,
4840b57cec5SDimitry Andric  ompt_state_wait_target_update               = 0x082,
4850b57cec5SDimitry Andric
4860b57cec5SDimitry Andric  ompt_state_idle                             = 0x100,
4870b57cec5SDimitry Andric  ompt_state_overhead                         = 0x101,
4880b57cec5SDimitry Andric  ompt_state_undefined                        = 0x102
4890b57cec5SDimitry Andric} ompt_state_t;
4900b57cec5SDimitry Andric
4910b57cec5SDimitry Andrictypedef uint64_t (*ompt_get_unique_id_t) (void);
4920b57cec5SDimitry Andric
4930b57cec5SDimitry Andrictypedef uint64_t ompd_size_t;
4940b57cec5SDimitry Andric
4950b57cec5SDimitry Andrictypedef uint64_t ompd_wait_id_t;
4960b57cec5SDimitry Andric
4970b57cec5SDimitry Andrictypedef uint64_t ompd_addr_t;
4980b57cec5SDimitry Andrictypedef int64_t  ompd_word_t;
4990b57cec5SDimitry Andrictypedef uint64_t ompd_seg_t;
5000b57cec5SDimitry Andric
5010b57cec5SDimitry Andrictypedef uint64_t ompd_device_t;
5020b57cec5SDimitry Andric
5030b57cec5SDimitry Andrictypedef uint64_t ompd_thread_id_t;
5040b57cec5SDimitry Andric
5050b57cec5SDimitry Andrictypedef enum ompd_scope_t {
5060b57cec5SDimitry Andric  ompd_scope_global = 1,
5070b57cec5SDimitry Andric  ompd_scope_address_space = 2,
5080b57cec5SDimitry Andric  ompd_scope_thread = 3,
5090b57cec5SDimitry Andric  ompd_scope_parallel = 4,
5100b57cec5SDimitry Andric  ompd_scope_implicit_task = 5,
5110b57cec5SDimitry Andric  ompd_scope_task = 6
5120b57cec5SDimitry Andric} ompd_scope_t;
5130b57cec5SDimitry Andric
5140b57cec5SDimitry Andrictypedef uint64_t ompd_icv_id_t;
5150b57cec5SDimitry Andric
5160b57cec5SDimitry Andrictypedef enum ompd_rc_t {
5170b57cec5SDimitry Andric  ompd_rc_ok = 0,
5180b57cec5SDimitry Andric  ompd_rc_unavailable = 1,
5190b57cec5SDimitry Andric  ompd_rc_stale_handle = 2,
5200b57cec5SDimitry Andric  ompd_rc_bad_input = 3,
5210b57cec5SDimitry Andric  ompd_rc_error = 4,
5220b57cec5SDimitry Andric  ompd_rc_unsupported = 5,
5230b57cec5SDimitry Andric  ompd_rc_needs_state_tracking = 6,
5240b57cec5SDimitry Andric  ompd_rc_incompatible = 7,
5250b57cec5SDimitry Andric  ompd_rc_device_read_error = 8,
5260b57cec5SDimitry Andric  ompd_rc_device_write_error = 9,
5270b57cec5SDimitry Andric  ompd_rc_nomem = 10,
528fe6060f1SDimitry Andric  ompd_rc_incomplete = 11,
529fe6060f1SDimitry Andric  ompd_rc_callback_error = 12
5300b57cec5SDimitry Andric} ompd_rc_t;
5310b57cec5SDimitry Andric
5320b57cec5SDimitry Andrictypedef void (*ompt_interface_fn_t) (void);
5330b57cec5SDimitry Andric
5340b57cec5SDimitry Andrictypedef ompt_interface_fn_t (*ompt_function_lookup_t) (
5350b57cec5SDimitry Andric  const char *interface_function_name
5360b57cec5SDimitry Andric);
5370b57cec5SDimitry Andric
5380b57cec5SDimitry Andrictypedef union ompt_data_t {
5390b57cec5SDimitry Andric  uint64_t value;
5400b57cec5SDimitry Andric  void *ptr;
5410b57cec5SDimitry Andric} ompt_data_t;
5420b57cec5SDimitry Andric
5430b57cec5SDimitry Andrictypedef struct ompt_frame_t {
5440b57cec5SDimitry Andric  ompt_data_t exit_frame;
5450b57cec5SDimitry Andric  ompt_data_t enter_frame;
5460b57cec5SDimitry Andric  int exit_frame_flags;
5470b57cec5SDimitry Andric  int enter_frame_flags;
5480b57cec5SDimitry Andric} ompt_frame_t;
5490b57cec5SDimitry Andric
5500b57cec5SDimitry Andrictypedef void (*ompt_callback_t) (void);
5510b57cec5SDimitry Andric
5520b57cec5SDimitry Andrictypedef void ompt_device_t;
5530b57cec5SDimitry Andric
5540b57cec5SDimitry Andrictypedef void ompt_buffer_t;
5550b57cec5SDimitry Andric
5560b57cec5SDimitry Andrictypedef void (*ompt_callback_buffer_request_t) (
5570b57cec5SDimitry Andric  int device_num,
5580b57cec5SDimitry Andric  ompt_buffer_t **buffer,
5590b57cec5SDimitry Andric  size_t *bytes
5600b57cec5SDimitry Andric);
5610b57cec5SDimitry Andric
5620b57cec5SDimitry Andrictypedef void (*ompt_callback_buffer_complete_t) (
5630b57cec5SDimitry Andric  int device_num,
5640b57cec5SDimitry Andric  ompt_buffer_t *buffer,
5650b57cec5SDimitry Andric  size_t bytes,
5660b57cec5SDimitry Andric  ompt_buffer_cursor_t begin,
5670b57cec5SDimitry Andric  int buffer_owned
5680b57cec5SDimitry Andric);
5690b57cec5SDimitry Andric
5700b57cec5SDimitry Andrictypedef void (*ompt_finalize_t) (
5710b57cec5SDimitry Andric  ompt_data_t *tool_data
5720b57cec5SDimitry Andric);
5730b57cec5SDimitry Andric
5740b57cec5SDimitry Andrictypedef int (*ompt_initialize_t) (
5750b57cec5SDimitry Andric  ompt_function_lookup_t lookup,
5760b57cec5SDimitry Andric  int initial_device_num,
5770b57cec5SDimitry Andric  ompt_data_t *tool_data
5780b57cec5SDimitry Andric);
5790b57cec5SDimitry Andric
5800b57cec5SDimitry Andrictypedef struct ompt_start_tool_result_t {
5810b57cec5SDimitry Andric  ompt_initialize_t initialize;
5820b57cec5SDimitry Andric  ompt_finalize_t finalize;
5830b57cec5SDimitry Andric  ompt_data_t tool_data;
5840b57cec5SDimitry Andric} ompt_start_tool_result_t;
5850b57cec5SDimitry Andric
5860b57cec5SDimitry Andrictypedef struct ompt_record_abstract_t {
5870b57cec5SDimitry Andric  ompt_record_native_t rclass;
5880b57cec5SDimitry Andric  const char *type;
5890b57cec5SDimitry Andric  ompt_device_time_t start_time;
5900b57cec5SDimitry Andric  ompt_device_time_t end_time;
5910b57cec5SDimitry Andric  ompt_hwid_t hwid;
5920b57cec5SDimitry Andric} ompt_record_abstract_t;
5930b57cec5SDimitry Andric
5940b57cec5SDimitry Andrictypedef struct ompt_dependence_t {
5950b57cec5SDimitry Andric  ompt_data_t variable;
5960b57cec5SDimitry Andric  ompt_dependence_type_t dependence_type;
5970b57cec5SDimitry Andric} ompt_dependence_t;
5980b57cec5SDimitry Andric
59981ad6265SDimitry Andrictypedef struct ompt_dispatch_chunk_t {
60081ad6265SDimitry Andric  uint64_t start;
60181ad6265SDimitry Andric  uint64_t iterations;
60281ad6265SDimitry Andric} ompt_dispatch_chunk_t;
60381ad6265SDimitry Andric
6040b57cec5SDimitry Andrictypedef int (*ompt_enumerate_states_t) (
6050b57cec5SDimitry Andric  int current_state,
6060b57cec5SDimitry Andric  int *next_state,
6070b57cec5SDimitry Andric  const char **next_state_name
6080b57cec5SDimitry Andric);
6090b57cec5SDimitry Andric
6100b57cec5SDimitry Andrictypedef int (*ompt_enumerate_mutex_impls_t) (
6110b57cec5SDimitry Andric  int current_impl,
6120b57cec5SDimitry Andric  int *next_impl,
6130b57cec5SDimitry Andric  const char **next_impl_name
6140b57cec5SDimitry Andric);
6150b57cec5SDimitry Andric
6160b57cec5SDimitry Andrictypedef ompt_set_result_t (*ompt_set_callback_t) (
6170b57cec5SDimitry Andric  ompt_callbacks_t event,
6180b57cec5SDimitry Andric  ompt_callback_t callback
6190b57cec5SDimitry Andric);
6200b57cec5SDimitry Andric
6210b57cec5SDimitry Andrictypedef int (*ompt_get_callback_t) (
6220b57cec5SDimitry Andric  ompt_callbacks_t event,
6230b57cec5SDimitry Andric  ompt_callback_t *callback
6240b57cec5SDimitry Andric);
6250b57cec5SDimitry Andric
6260b57cec5SDimitry Andrictypedef ompt_data_t *(*ompt_get_thread_data_t) (void);
6270b57cec5SDimitry Andric
6280b57cec5SDimitry Andrictypedef int (*ompt_get_num_procs_t) (void);
6290b57cec5SDimitry Andric
6300b57cec5SDimitry Andrictypedef int (*ompt_get_num_places_t) (void);
6310b57cec5SDimitry Andric
6320b57cec5SDimitry Andrictypedef int (*ompt_get_place_proc_ids_t) (
6330b57cec5SDimitry Andric  int place_num,
6340b57cec5SDimitry Andric  int ids_size,
6350b57cec5SDimitry Andric  int *ids
6360b57cec5SDimitry Andric);
6370b57cec5SDimitry Andric
6380b57cec5SDimitry Andrictypedef int (*ompt_get_place_num_t) (void);
6390b57cec5SDimitry Andric
6400b57cec5SDimitry Andrictypedef int (*ompt_get_partition_place_nums_t) (
6410b57cec5SDimitry Andric  int place_nums_size,
6420b57cec5SDimitry Andric  int *place_nums
6430b57cec5SDimitry Andric);
6440b57cec5SDimitry Andric
6450b57cec5SDimitry Andrictypedef int (*ompt_get_proc_id_t) (void);
6460b57cec5SDimitry Andric
6470b57cec5SDimitry Andrictypedef int (*ompt_get_state_t) (
6480b57cec5SDimitry Andric  ompt_wait_id_t *wait_id
6490b57cec5SDimitry Andric);
6500b57cec5SDimitry Andric
6510b57cec5SDimitry Andrictypedef int (*ompt_get_parallel_info_t) (
6520b57cec5SDimitry Andric  int ancestor_level,
6530b57cec5SDimitry Andric  ompt_data_t **parallel_data,
6540b57cec5SDimitry Andric  int *team_size
6550b57cec5SDimitry Andric);
6560b57cec5SDimitry Andric
6570b57cec5SDimitry Andrictypedef int (*ompt_get_task_info_t) (
6580b57cec5SDimitry Andric  int ancestor_level,
6590b57cec5SDimitry Andric  int *flags,
6600b57cec5SDimitry Andric  ompt_data_t **task_data,
6610b57cec5SDimitry Andric  ompt_frame_t **task_frame,
6620b57cec5SDimitry Andric  ompt_data_t **parallel_data,
6630b57cec5SDimitry Andric  int *thread_num
6640b57cec5SDimitry Andric);
6650b57cec5SDimitry Andric
6660b57cec5SDimitry Andrictypedef int (*ompt_get_task_memory_t)(
6670b57cec5SDimitry Andric  void **addr,
6680b57cec5SDimitry Andric  size_t *size,
6690b57cec5SDimitry Andric  int block
6700b57cec5SDimitry Andric);
6710b57cec5SDimitry Andric
6720b57cec5SDimitry Andrictypedef int (*ompt_get_target_info_t) (
6730b57cec5SDimitry Andric  uint64_t *device_num,
6740b57cec5SDimitry Andric  ompt_id_t *target_id,
6750b57cec5SDimitry Andric  ompt_id_t *host_op_id
6760b57cec5SDimitry Andric);
6770b57cec5SDimitry Andric
6780b57cec5SDimitry Andrictypedef int (*ompt_get_num_devices_t) (void);
6790b57cec5SDimitry Andric
6800b57cec5SDimitry Andrictypedef void (*ompt_finalize_tool_t) (void);
6810b57cec5SDimitry Andric
6820b57cec5SDimitry Andrictypedef int (*ompt_get_device_num_procs_t) (
6830b57cec5SDimitry Andric  ompt_device_t *device
6840b57cec5SDimitry Andric);
6850b57cec5SDimitry Andric
6860b57cec5SDimitry Andrictypedef ompt_device_time_t (*ompt_get_device_time_t) (
6870b57cec5SDimitry Andric  ompt_device_t *device
6880b57cec5SDimitry Andric);
6890b57cec5SDimitry Andric
6900b57cec5SDimitry Andrictypedef double (*ompt_translate_time_t) (
6910b57cec5SDimitry Andric  ompt_device_t *device,
6920b57cec5SDimitry Andric  ompt_device_time_t time
6930b57cec5SDimitry Andric);
6940b57cec5SDimitry Andric
6950b57cec5SDimitry Andrictypedef ompt_set_result_t (*ompt_set_trace_ompt_t) (
6960b57cec5SDimitry Andric  ompt_device_t *device,
6970b57cec5SDimitry Andric  unsigned int enable,
6980b57cec5SDimitry Andric  unsigned int etype
6990b57cec5SDimitry Andric);
7000b57cec5SDimitry Andric
7010b57cec5SDimitry Andrictypedef ompt_set_result_t (*ompt_set_trace_native_t) (
7020b57cec5SDimitry Andric  ompt_device_t *device,
7030b57cec5SDimitry Andric  int enable,
7040b57cec5SDimitry Andric  int flags
7050b57cec5SDimitry Andric);
7060b57cec5SDimitry Andric
7070b57cec5SDimitry Andrictypedef int (*ompt_start_trace_t) (
7080b57cec5SDimitry Andric  ompt_device_t *device,
7090b57cec5SDimitry Andric  ompt_callback_buffer_request_t request,
7100b57cec5SDimitry Andric  ompt_callback_buffer_complete_t complete
7110b57cec5SDimitry Andric);
7120b57cec5SDimitry Andric
7130b57cec5SDimitry Andrictypedef int (*ompt_pause_trace_t) (
7140b57cec5SDimitry Andric  ompt_device_t *device,
7150b57cec5SDimitry Andric  int begin_pause
7160b57cec5SDimitry Andric);
7170b57cec5SDimitry Andric
7180b57cec5SDimitry Andrictypedef int (*ompt_flush_trace_t) (
7190b57cec5SDimitry Andric  ompt_device_t *device
7200b57cec5SDimitry Andric);
7210b57cec5SDimitry Andric
7220b57cec5SDimitry Andrictypedef int (*ompt_stop_trace_t) (
7230b57cec5SDimitry Andric  ompt_device_t *device
7240b57cec5SDimitry Andric);
7250b57cec5SDimitry Andric
7260b57cec5SDimitry Andrictypedef int (*ompt_advance_buffer_cursor_t) (
7270b57cec5SDimitry Andric  ompt_device_t *device,
7280b57cec5SDimitry Andric  ompt_buffer_t *buffer,
7290b57cec5SDimitry Andric  size_t size,
7300b57cec5SDimitry Andric  ompt_buffer_cursor_t current,
7310b57cec5SDimitry Andric  ompt_buffer_cursor_t *next
7320b57cec5SDimitry Andric);
7330b57cec5SDimitry Andric
7340b57cec5SDimitry Andrictypedef ompt_record_t (*ompt_get_record_type_t) (
7350b57cec5SDimitry Andric  ompt_buffer_t *buffer,
7360b57cec5SDimitry Andric  ompt_buffer_cursor_t current
7370b57cec5SDimitry Andric);
7380b57cec5SDimitry Andric
7390b57cec5SDimitry Andrictypedef void *(*ompt_get_record_native_t) (
7400b57cec5SDimitry Andric  ompt_buffer_t *buffer,
7410b57cec5SDimitry Andric  ompt_buffer_cursor_t current,
7420b57cec5SDimitry Andric  ompt_id_t *host_op_id
7430b57cec5SDimitry Andric);
7440b57cec5SDimitry Andric
7450b57cec5SDimitry Andrictypedef ompt_record_abstract_t *
7460b57cec5SDimitry Andric(*ompt_get_record_abstract_t) (
7470b57cec5SDimitry Andric  void *native_record
7480b57cec5SDimitry Andric);
7490b57cec5SDimitry Andric
7500b57cec5SDimitry Andrictypedef void (*ompt_callback_thread_begin_t) (
7510b57cec5SDimitry Andric  ompt_thread_t thread_type,
7520b57cec5SDimitry Andric  ompt_data_t *thread_data
7530b57cec5SDimitry Andric);
7540b57cec5SDimitry Andric
7550b57cec5SDimitry Andrictypedef struct ompt_record_thread_begin_t {
7560b57cec5SDimitry Andric  ompt_thread_t thread_type;
7570b57cec5SDimitry Andric} ompt_record_thread_begin_t;
7580b57cec5SDimitry Andric
7590b57cec5SDimitry Andrictypedef void (*ompt_callback_thread_end_t) (
7600b57cec5SDimitry Andric  ompt_data_t *thread_data
7610b57cec5SDimitry Andric);
7620b57cec5SDimitry Andric
7630b57cec5SDimitry Andrictypedef void (*ompt_callback_parallel_begin_t) (
7640b57cec5SDimitry Andric  ompt_data_t *encountering_task_data,
7650b57cec5SDimitry Andric  const ompt_frame_t *encountering_task_frame,
7660b57cec5SDimitry Andric  ompt_data_t *parallel_data,
7670b57cec5SDimitry Andric  unsigned int requested_parallelism,
7680b57cec5SDimitry Andric  int flags,
7690b57cec5SDimitry Andric  const void *codeptr_ra
7700b57cec5SDimitry Andric);
7710b57cec5SDimitry Andric
7720b57cec5SDimitry Andrictypedef struct ompt_record_parallel_begin_t {
7730b57cec5SDimitry Andric  ompt_id_t encountering_task_id;
7740b57cec5SDimitry Andric  ompt_id_t parallel_id;
7750b57cec5SDimitry Andric  unsigned int requested_parallelism;
7760b57cec5SDimitry Andric  int flags;
7770b57cec5SDimitry Andric  const void *codeptr_ra;
7780b57cec5SDimitry Andric} ompt_record_parallel_begin_t;
7790b57cec5SDimitry Andric
7800b57cec5SDimitry Andrictypedef void (*ompt_callback_parallel_end_t) (
7810b57cec5SDimitry Andric  ompt_data_t *parallel_data,
7820b57cec5SDimitry Andric  ompt_data_t *encountering_task_data,
7830b57cec5SDimitry Andric  int flags,
7840b57cec5SDimitry Andric  const void *codeptr_ra
7850b57cec5SDimitry Andric);
7860b57cec5SDimitry Andric
7870b57cec5SDimitry Andrictypedef struct ompt_record_parallel_end_t {
7880b57cec5SDimitry Andric  ompt_id_t parallel_id;
7890b57cec5SDimitry Andric  ompt_id_t encountering_task_id;
7900b57cec5SDimitry Andric  int flags;
7910b57cec5SDimitry Andric  const void *codeptr_ra;
7920b57cec5SDimitry Andric} ompt_record_parallel_end_t;
7930b57cec5SDimitry Andric
7940b57cec5SDimitry Andrictypedef void (*ompt_callback_work_t) (
79581ad6265SDimitry Andric  ompt_work_t work_type,
7960b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint,
7970b57cec5SDimitry Andric  ompt_data_t *parallel_data,
7980b57cec5SDimitry Andric  ompt_data_t *task_data,
7990b57cec5SDimitry Andric  uint64_t count,
8000b57cec5SDimitry Andric  const void *codeptr_ra
8010b57cec5SDimitry Andric);
8020b57cec5SDimitry Andric
8030b57cec5SDimitry Andrictypedef struct ompt_record_work_t {
80481ad6265SDimitry Andric  ompt_work_t work_type;
8050b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint;
8060b57cec5SDimitry Andric  ompt_id_t parallel_id;
8070b57cec5SDimitry Andric  ompt_id_t task_id;
8080b57cec5SDimitry Andric  uint64_t count;
8090b57cec5SDimitry Andric  const void *codeptr_ra;
8100b57cec5SDimitry Andric} ompt_record_work_t;
8110b57cec5SDimitry Andric
8120b57cec5SDimitry Andrictypedef void (*ompt_callback_dispatch_t) (
8130b57cec5SDimitry Andric  ompt_data_t *parallel_data,
8140b57cec5SDimitry Andric  ompt_data_t *task_data,
8150b57cec5SDimitry Andric  ompt_dispatch_t kind,
8160b57cec5SDimitry Andric  ompt_data_t instance
8170b57cec5SDimitry Andric);
8180b57cec5SDimitry Andric
8190b57cec5SDimitry Andrictypedef struct ompt_record_dispatch_t {
8200b57cec5SDimitry Andric  ompt_id_t parallel_id;
8210b57cec5SDimitry Andric  ompt_id_t task_id;
8220b57cec5SDimitry Andric  ompt_dispatch_t kind;
8230b57cec5SDimitry Andric  ompt_data_t instance;
8240b57cec5SDimitry Andric} ompt_record_dispatch_t;
8250b57cec5SDimitry Andric
8260b57cec5SDimitry Andrictypedef void (*ompt_callback_task_create_t) (
8270b57cec5SDimitry Andric  ompt_data_t *encountering_task_data,
8280b57cec5SDimitry Andric  const ompt_frame_t *encountering_task_frame,
8290b57cec5SDimitry Andric  ompt_data_t *new_task_data,
8300b57cec5SDimitry Andric  int flags,
8310b57cec5SDimitry Andric  int has_dependences,
8320b57cec5SDimitry Andric  const void *codeptr_ra
8330b57cec5SDimitry Andric);
8340b57cec5SDimitry Andric
8350b57cec5SDimitry Andrictypedef struct ompt_record_task_create_t {
8360b57cec5SDimitry Andric  ompt_id_t encountering_task_id;
8370b57cec5SDimitry Andric  ompt_id_t new_task_id;
8380b57cec5SDimitry Andric  int flags;
8390b57cec5SDimitry Andric  int has_dependences;
8400b57cec5SDimitry Andric  const void *codeptr_ra;
8410b57cec5SDimitry Andric} ompt_record_task_create_t;
8420b57cec5SDimitry Andric
8430b57cec5SDimitry Andrictypedef void (*ompt_callback_dependences_t) (
8440b57cec5SDimitry Andric  ompt_data_t *task_data,
8450b57cec5SDimitry Andric  const ompt_dependence_t *deps,
8460b57cec5SDimitry Andric  int ndeps
8470b57cec5SDimitry Andric);
8480b57cec5SDimitry Andric
8490b57cec5SDimitry Andrictypedef struct ompt_record_dependences_t {
8500b57cec5SDimitry Andric  ompt_id_t task_id;
8510b57cec5SDimitry Andric  ompt_dependence_t dep;
8520b57cec5SDimitry Andric  int ndeps;
8530b57cec5SDimitry Andric} ompt_record_dependences_t;
8540b57cec5SDimitry Andric
8550b57cec5SDimitry Andrictypedef void (*ompt_callback_task_dependence_t) (
8560b57cec5SDimitry Andric  ompt_data_t *src_task_data,
8570b57cec5SDimitry Andric  ompt_data_t *sink_task_data
8580b57cec5SDimitry Andric);
8590b57cec5SDimitry Andric
8600b57cec5SDimitry Andrictypedef struct ompt_record_task_dependence_t {
8610b57cec5SDimitry Andric  ompt_id_t src_task_id;
8620b57cec5SDimitry Andric  ompt_id_t sink_task_id;
8630b57cec5SDimitry Andric} ompt_record_task_dependence_t;
8640b57cec5SDimitry Andric
8650b57cec5SDimitry Andrictypedef void (*ompt_callback_task_schedule_t) (
8660b57cec5SDimitry Andric  ompt_data_t *prior_task_data,
8670b57cec5SDimitry Andric  ompt_task_status_t prior_task_status,
8680b57cec5SDimitry Andric  ompt_data_t *next_task_data
8690b57cec5SDimitry Andric);
8700b57cec5SDimitry Andric
8710b57cec5SDimitry Andrictypedef struct ompt_record_task_schedule_t {
8720b57cec5SDimitry Andric  ompt_id_t prior_task_id;
8730b57cec5SDimitry Andric  ompt_task_status_t prior_task_status;
8740b57cec5SDimitry Andric  ompt_id_t next_task_id;
8750b57cec5SDimitry Andric} ompt_record_task_schedule_t;
8760b57cec5SDimitry Andric
8770b57cec5SDimitry Andrictypedef void (*ompt_callback_implicit_task_t) (
8780b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint,
8790b57cec5SDimitry Andric  ompt_data_t *parallel_data,
8800b57cec5SDimitry Andric  ompt_data_t *task_data,
8810b57cec5SDimitry Andric  unsigned int actual_parallelism,
8820b57cec5SDimitry Andric  unsigned int index,
8830b57cec5SDimitry Andric  int flags
8840b57cec5SDimitry Andric);
8850b57cec5SDimitry Andric
8860b57cec5SDimitry Andrictypedef struct ompt_record_implicit_task_t {
8870b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint;
8880b57cec5SDimitry Andric  ompt_id_t parallel_id;
8890b57cec5SDimitry Andric  ompt_id_t task_id;
8900b57cec5SDimitry Andric  unsigned int actual_parallelism;
8910b57cec5SDimitry Andric  unsigned int index;
8920b57cec5SDimitry Andric  int flags;
8930b57cec5SDimitry Andric} ompt_record_implicit_task_t;
8940b57cec5SDimitry Andric
895e8d8bef9SDimitry Andrictypedef void (*ompt_callback_masked_t) (
8960b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint,
8970b57cec5SDimitry Andric  ompt_data_t *parallel_data,
8980b57cec5SDimitry Andric  ompt_data_t *task_data,
8990b57cec5SDimitry Andric  const void *codeptr_ra
9000b57cec5SDimitry Andric);
9010b57cec5SDimitry Andric
902e8d8bef9SDimitry Andrictypedef ompt_callback_masked_t ompt_callback_master_t DEPRECATED_51;
903e8d8bef9SDimitry Andric
904e8d8bef9SDimitry Andrictypedef struct ompt_record_masked_t {
9050b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint;
9060b57cec5SDimitry Andric  ompt_id_t parallel_id;
9070b57cec5SDimitry Andric  ompt_id_t task_id;
9080b57cec5SDimitry Andric  const void *codeptr_ra;
909e8d8bef9SDimitry Andric} ompt_record_masked_t;
9100b57cec5SDimitry Andric
9110b57cec5SDimitry Andrictypedef void (*ompt_callback_sync_region_t) (
9120b57cec5SDimitry Andric  ompt_sync_region_t kind,
9130b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint,
9140b57cec5SDimitry Andric  ompt_data_t *parallel_data,
9150b57cec5SDimitry Andric  ompt_data_t *task_data,
9160b57cec5SDimitry Andric  const void *codeptr_ra
9170b57cec5SDimitry Andric);
9180b57cec5SDimitry Andric
9190b57cec5SDimitry Andrictypedef struct ompt_record_sync_region_t {
9200b57cec5SDimitry Andric  ompt_sync_region_t kind;
9210b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint;
9220b57cec5SDimitry Andric  ompt_id_t parallel_id;
9230b57cec5SDimitry Andric  ompt_id_t task_id;
9240b57cec5SDimitry Andric  const void *codeptr_ra;
9250b57cec5SDimitry Andric} ompt_record_sync_region_t;
9260b57cec5SDimitry Andric
9270b57cec5SDimitry Andrictypedef void (*ompt_callback_mutex_acquire_t) (
9280b57cec5SDimitry Andric  ompt_mutex_t kind,
9290b57cec5SDimitry Andric  unsigned int hint,
9300b57cec5SDimitry Andric  unsigned int impl,
9310b57cec5SDimitry Andric  ompt_wait_id_t wait_id,
9320b57cec5SDimitry Andric  const void *codeptr_ra
9330b57cec5SDimitry Andric);
9340b57cec5SDimitry Andric
9350b57cec5SDimitry Andrictypedef struct ompt_record_mutex_acquire_t {
9360b57cec5SDimitry Andric  ompt_mutex_t kind;
9370b57cec5SDimitry Andric  unsigned int hint;
9380b57cec5SDimitry Andric  unsigned int impl;
9390b57cec5SDimitry Andric  ompt_wait_id_t wait_id;
9400b57cec5SDimitry Andric  const void *codeptr_ra;
9410b57cec5SDimitry Andric} ompt_record_mutex_acquire_t;
9420b57cec5SDimitry Andric
9430b57cec5SDimitry Andrictypedef void (*ompt_callback_mutex_t) (
9440b57cec5SDimitry Andric  ompt_mutex_t kind,
9450b57cec5SDimitry Andric  ompt_wait_id_t wait_id,
9460b57cec5SDimitry Andric  const void *codeptr_ra
9470b57cec5SDimitry Andric);
9480b57cec5SDimitry Andric
9490b57cec5SDimitry Andrictypedef struct ompt_record_mutex_t {
9500b57cec5SDimitry Andric  ompt_mutex_t kind;
9510b57cec5SDimitry Andric  ompt_wait_id_t wait_id;
9520b57cec5SDimitry Andric  const void *codeptr_ra;
9530b57cec5SDimitry Andric} ompt_record_mutex_t;
9540b57cec5SDimitry Andric
9550b57cec5SDimitry Andrictypedef void (*ompt_callback_nest_lock_t) (
9560b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint,
9570b57cec5SDimitry Andric  ompt_wait_id_t wait_id,
9580b57cec5SDimitry Andric  const void *codeptr_ra
9590b57cec5SDimitry Andric);
9600b57cec5SDimitry Andric
9610b57cec5SDimitry Andrictypedef struct ompt_record_nest_lock_t {
9620b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint;
9630b57cec5SDimitry Andric  ompt_wait_id_t wait_id;
9640b57cec5SDimitry Andric  const void *codeptr_ra;
9650b57cec5SDimitry Andric} ompt_record_nest_lock_t;
9660b57cec5SDimitry Andric
9670b57cec5SDimitry Andrictypedef void (*ompt_callback_flush_t) (
9680b57cec5SDimitry Andric  ompt_data_t *thread_data,
9690b57cec5SDimitry Andric  const void *codeptr_ra
9700b57cec5SDimitry Andric);
9710b57cec5SDimitry Andric
9720b57cec5SDimitry Andrictypedef struct ompt_record_flush_t {
9730b57cec5SDimitry Andric  const void *codeptr_ra;
9740b57cec5SDimitry Andric} ompt_record_flush_t;
9750b57cec5SDimitry Andric
9760b57cec5SDimitry Andrictypedef void (*ompt_callback_cancel_t) (
9770b57cec5SDimitry Andric  ompt_data_t *task_data,
9780b57cec5SDimitry Andric  int flags,
9790b57cec5SDimitry Andric  const void *codeptr_ra
9800b57cec5SDimitry Andric);
9810b57cec5SDimitry Andric
9820b57cec5SDimitry Andrictypedef struct ompt_record_cancel_t {
9830b57cec5SDimitry Andric  ompt_id_t task_id;
9840b57cec5SDimitry Andric  int flags;
9850b57cec5SDimitry Andric  const void *codeptr_ra;
9860b57cec5SDimitry Andric} ompt_record_cancel_t;
9870b57cec5SDimitry Andric
9880b57cec5SDimitry Andrictypedef void (*ompt_callback_device_initialize_t) (
9890b57cec5SDimitry Andric  int device_num,
9900b57cec5SDimitry Andric  const char *type,
9910b57cec5SDimitry Andric  ompt_device_t *device,
9920b57cec5SDimitry Andric  ompt_function_lookup_t lookup,
9930b57cec5SDimitry Andric  const char *documentation
9940b57cec5SDimitry Andric);
9950b57cec5SDimitry Andric
9960b57cec5SDimitry Andrictypedef void (*ompt_callback_device_finalize_t) (
9970b57cec5SDimitry Andric  int device_num
9980b57cec5SDimitry Andric);
9990b57cec5SDimitry Andric
10000b57cec5SDimitry Andrictypedef void (*ompt_callback_device_load_t) (
10010b57cec5SDimitry Andric  int device_num,
10020b57cec5SDimitry Andric  const char *filename,
10030b57cec5SDimitry Andric  int64_t offset_in_file,
10040b57cec5SDimitry Andric  void *vma_in_file,
10050b57cec5SDimitry Andric  size_t bytes,
10060b57cec5SDimitry Andric  void *host_addr,
10070b57cec5SDimitry Andric  void *device_addr,
10080b57cec5SDimitry Andric  uint64_t module_id
10090b57cec5SDimitry Andric);
10100b57cec5SDimitry Andric
10110b57cec5SDimitry Andrictypedef void (*ompt_callback_device_unload_t) (
10120b57cec5SDimitry Andric  int device_num,
10130b57cec5SDimitry Andric  uint64_t module_id
10140b57cec5SDimitry Andric);
10150b57cec5SDimitry Andric
1016e8d8bef9SDimitry Andrictypedef void (*ompt_callback_target_data_op_emi_t) (
1017e8d8bef9SDimitry Andric  ompt_scope_endpoint_t endpoint,
1018e8d8bef9SDimitry Andric  ompt_data_t *target_task_data,
1019e8d8bef9SDimitry Andric  ompt_data_t *target_data,
1020e8d8bef9SDimitry Andric  ompt_id_t *host_op_id,
1021e8d8bef9SDimitry Andric  ompt_target_data_op_t optype,
1022e8d8bef9SDimitry Andric  void *src_addr,
1023e8d8bef9SDimitry Andric  int src_device_num,
1024e8d8bef9SDimitry Andric  void *dest_addr,
1025e8d8bef9SDimitry Andric  int dest_device_num,
1026e8d8bef9SDimitry Andric  size_t bytes,
1027e8d8bef9SDimitry Andric  const void *codeptr_ra
1028e8d8bef9SDimitry Andric);
1029e8d8bef9SDimitry Andric
10300b57cec5SDimitry Andrictypedef void (*ompt_callback_target_data_op_t) (
10310b57cec5SDimitry Andric  ompt_id_t target_id,
10320b57cec5SDimitry Andric  ompt_id_t host_op_id,
10330b57cec5SDimitry Andric  ompt_target_data_op_t optype,
10340b57cec5SDimitry Andric  void *src_addr,
10350b57cec5SDimitry Andric  int src_device_num,
10360b57cec5SDimitry Andric  void *dest_addr,
10370b57cec5SDimitry Andric  int dest_device_num,
10380b57cec5SDimitry Andric  size_t bytes,
10390b57cec5SDimitry Andric  const void *codeptr_ra
10400b57cec5SDimitry Andric);
10410b57cec5SDimitry Andric
10420b57cec5SDimitry Andrictypedef struct ompt_record_target_data_op_t {
10430b57cec5SDimitry Andric  ompt_id_t host_op_id;
10440b57cec5SDimitry Andric  ompt_target_data_op_t optype;
10450b57cec5SDimitry Andric  void *src_addr;
10460b57cec5SDimitry Andric  int src_device_num;
10470b57cec5SDimitry Andric  void *dest_addr;
10480b57cec5SDimitry Andric  int dest_device_num;
10490b57cec5SDimitry Andric  size_t bytes;
10500b57cec5SDimitry Andric  ompt_device_time_t end_time;
10510b57cec5SDimitry Andric  const void *codeptr_ra;
10520b57cec5SDimitry Andric} ompt_record_target_data_op_t;
10530b57cec5SDimitry Andric
1054e8d8bef9SDimitry Andrictypedef void (*ompt_callback_target_emi_t) (
1055e8d8bef9SDimitry Andric  ompt_target_t kind,
1056e8d8bef9SDimitry Andric  ompt_scope_endpoint_t endpoint,
1057e8d8bef9SDimitry Andric  int device_num,
1058e8d8bef9SDimitry Andric  ompt_data_t *task_data,
1059e8d8bef9SDimitry Andric  ompt_data_t *target_task_data,
1060e8d8bef9SDimitry Andric  ompt_data_t *target_data,
1061e8d8bef9SDimitry Andric  const void *codeptr_ra
1062e8d8bef9SDimitry Andric);
1063e8d8bef9SDimitry Andric
10640b57cec5SDimitry Andrictypedef void (*ompt_callback_target_t) (
10650b57cec5SDimitry Andric  ompt_target_t kind,
10660b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint,
10670b57cec5SDimitry Andric  int device_num,
10680b57cec5SDimitry Andric  ompt_data_t *task_data,
10690b57cec5SDimitry Andric  ompt_id_t target_id,
10700b57cec5SDimitry Andric  const void *codeptr_ra
10710b57cec5SDimitry Andric);
10720b57cec5SDimitry Andric
10730b57cec5SDimitry Andrictypedef struct ompt_record_target_t {
10740b57cec5SDimitry Andric  ompt_target_t kind;
10750b57cec5SDimitry Andric  ompt_scope_endpoint_t endpoint;
10760b57cec5SDimitry Andric  int device_num;
10770b57cec5SDimitry Andric  ompt_id_t task_id;
10780b57cec5SDimitry Andric  ompt_id_t target_id;
10790b57cec5SDimitry Andric  const void *codeptr_ra;
10800b57cec5SDimitry Andric} ompt_record_target_t;
10810b57cec5SDimitry Andric
1082e8d8bef9SDimitry Andrictypedef void (*ompt_callback_target_map_emi_t) (
1083e8d8bef9SDimitry Andric  ompt_data_t *target_data,
1084e8d8bef9SDimitry Andric  unsigned int nitems,
1085e8d8bef9SDimitry Andric  void **host_addr,
1086e8d8bef9SDimitry Andric  void **device_addr,
1087e8d8bef9SDimitry Andric  size_t *bytes,
1088e8d8bef9SDimitry Andric  unsigned int *mapping_flags,
1089e8d8bef9SDimitry Andric  const void *codeptr_ra
1090e8d8bef9SDimitry Andric);
1091e8d8bef9SDimitry Andric
10920b57cec5SDimitry Andrictypedef void (*ompt_callback_target_map_t) (
10930b57cec5SDimitry Andric  ompt_id_t target_id,
10940b57cec5SDimitry Andric  unsigned int nitems,
10950b57cec5SDimitry Andric  void **host_addr,
10960b57cec5SDimitry Andric  void **device_addr,
10970b57cec5SDimitry Andric  size_t *bytes,
10980b57cec5SDimitry Andric  unsigned int *mapping_flags,
10990b57cec5SDimitry Andric  const void *codeptr_ra
11000b57cec5SDimitry Andric);
11010b57cec5SDimitry Andric
11020b57cec5SDimitry Andrictypedef struct ompt_record_target_map_t {
11030b57cec5SDimitry Andric  ompt_id_t target_id;
11040b57cec5SDimitry Andric  unsigned int nitems;
11050b57cec5SDimitry Andric  void **host_addr;
11060b57cec5SDimitry Andric  void **device_addr;
11070b57cec5SDimitry Andric  size_t *bytes;
11080b57cec5SDimitry Andric  unsigned int *mapping_flags;
11090b57cec5SDimitry Andric  const void *codeptr_ra;
11100b57cec5SDimitry Andric} ompt_record_target_map_t;
11110b57cec5SDimitry Andric
1112e8d8bef9SDimitry Andrictypedef void (*ompt_callback_target_submit_emi_t) (
1113e8d8bef9SDimitry Andric  ompt_scope_endpoint_t endpoint,
1114e8d8bef9SDimitry Andric  ompt_data_t *target_data,
1115e8d8bef9SDimitry Andric  ompt_id_t *host_op_id,
1116e8d8bef9SDimitry Andric  unsigned int requested_num_teams
1117e8d8bef9SDimitry Andric);
1118e8d8bef9SDimitry Andric
11190b57cec5SDimitry Andrictypedef void (*ompt_callback_target_submit_t) (
11200b57cec5SDimitry Andric  ompt_id_t target_id,
11210b57cec5SDimitry Andric  ompt_id_t host_op_id,
11220b57cec5SDimitry Andric  unsigned int requested_num_teams
11230b57cec5SDimitry Andric);
11240b57cec5SDimitry Andric
11250b57cec5SDimitry Andrictypedef struct ompt_record_target_kernel_t {
11260b57cec5SDimitry Andric  ompt_id_t host_op_id;
11270b57cec5SDimitry Andric  unsigned int requested_num_teams;
11280b57cec5SDimitry Andric  unsigned int granted_num_teams;
11290b57cec5SDimitry Andric  ompt_device_time_t end_time;
11300b57cec5SDimitry Andric} ompt_record_target_kernel_t;
11310b57cec5SDimitry Andric
11320b57cec5SDimitry Andrictypedef int (*ompt_callback_control_tool_t) (
11330b57cec5SDimitry Andric  uint64_t command,
11340b57cec5SDimitry Andric  uint64_t modifier,
11350b57cec5SDimitry Andric  void *arg,
11360b57cec5SDimitry Andric  const void *codeptr_ra
11370b57cec5SDimitry Andric);
11380b57cec5SDimitry Andric
11390b57cec5SDimitry Andrictypedef struct ompt_record_control_tool_t {
11400b57cec5SDimitry Andric  uint64_t command;
11410b57cec5SDimitry Andric  uint64_t modifier;
11420b57cec5SDimitry Andric  const void *codeptr_ra;
11430b57cec5SDimitry Andric} ompt_record_control_tool_t;
11440b57cec5SDimitry Andric
1145e8d8bef9SDimitry Andrictypedef void (*ompt_callback_error_t) (
1146e8d8bef9SDimitry Andric  ompt_severity_t severity,
1147e8d8bef9SDimitry Andric  const char *message, size_t length,
1148e8d8bef9SDimitry Andric  const void *codeptr_ra
1149e8d8bef9SDimitry Andric);
1150e8d8bef9SDimitry Andric
1151fe6060f1SDimitry Andrictypedef struct ompt_record_error_t {
1152fe6060f1SDimitry Andric  ompt_severity_t severity;
1153fe6060f1SDimitry Andric  const char *message;
1154fe6060f1SDimitry Andric  size_t length;
1155fe6060f1SDimitry Andric  const void *codeptr_ra;
1156fe6060f1SDimitry Andric} ompt_record_error_t;
1157fe6060f1SDimitry Andric
11580b57cec5SDimitry Andrictypedef struct ompd_address_t {
11590b57cec5SDimitry Andric  ompd_seg_t segment;
11600b57cec5SDimitry Andric  ompd_addr_t address;
11610b57cec5SDimitry Andric} ompd_address_t;
11620b57cec5SDimitry Andric
11630b57cec5SDimitry Andrictypedef struct ompd_frame_info_t {
11640b57cec5SDimitry Andric  ompd_address_t frame_address;
11650b57cec5SDimitry Andric  ompd_word_t frame_flag;
11660b57cec5SDimitry Andric} ompd_frame_info_t;
11670b57cec5SDimitry Andric
11680b57cec5SDimitry Andrictypedef struct _ompd_aspace_handle ompd_address_space_handle_t;
11690b57cec5SDimitry Andrictypedef struct _ompd_thread_handle ompd_thread_handle_t;
11700b57cec5SDimitry Andrictypedef struct _ompd_parallel_handle ompd_parallel_handle_t;
11710b57cec5SDimitry Andrictypedef struct _ompd_task_handle ompd_task_handle_t;
11720b57cec5SDimitry Andric
11730b57cec5SDimitry Andrictypedef struct _ompd_aspace_cont ompd_address_space_context_t;
11740b57cec5SDimitry Andrictypedef struct _ompd_thread_cont ompd_thread_context_t;
11750b57cec5SDimitry Andric
11760b57cec5SDimitry Andrictypedef struct ompd_device_type_sizes_t {
11770b57cec5SDimitry Andric  uint8_t sizeof_char;
11780b57cec5SDimitry Andric  uint8_t sizeof_short;
11790b57cec5SDimitry Andric  uint8_t sizeof_int;
11800b57cec5SDimitry Andric  uint8_t sizeof_long;
11810b57cec5SDimitry Andric  uint8_t sizeof_long_long;
11820b57cec5SDimitry Andric  uint8_t sizeof_pointer;
11830b57cec5SDimitry Andric} ompd_device_type_sizes_t;
11840b57cec5SDimitry Andric
1185fe6060f1SDimitry Andricvoid ompd_dll_locations_valid(void);
1186fe6060f1SDimitry Andric
1187fe6060f1SDimitry Andrictypedef ompd_rc_t (*ompd_callback_memory_alloc_fn_t)(ompd_size_t nbytes,
1188fe6060f1SDimitry Andric                                                     void **ptr);
1189fe6060f1SDimitry Andric
1190fe6060f1SDimitry Andrictypedef ompd_rc_t (*ompd_callback_memory_free_fn_t)(void *ptr);
1191fe6060f1SDimitry Andric
1192fe6060f1SDimitry Andrictypedef ompd_rc_t (*ompd_callback_get_thread_context_for_thread_id_fn_t)(
1193fe6060f1SDimitry Andric    ompd_address_space_context_t *address_space_context, ompd_thread_id_t kind,
1194fe6060f1SDimitry Andric    ompd_size_t sizeof_thread_id, const void *thread_id,
1195fe6060f1SDimitry Andric    ompd_thread_context_t **thread_context);
1196fe6060f1SDimitry Andric
1197fe6060f1SDimitry Andrictypedef ompd_rc_t (*ompd_callback_sizeof_fn_t)(
1198fe6060f1SDimitry Andric    ompd_address_space_context_t *address_space_context,
1199fe6060f1SDimitry Andric    ompd_device_type_sizes_t *sizes);
1200fe6060f1SDimitry Andric
1201fe6060f1SDimitry Andrictypedef ompd_rc_t (*ompd_callback_symbol_addr_fn_t)(
1202fe6060f1SDimitry Andric    ompd_address_space_context_t *address_space_context,
1203fe6060f1SDimitry Andric    ompd_thread_context_t *thread_context, const char *symbol_name,
1204fe6060f1SDimitry Andric    ompd_address_t *symbol_addr, const char *file_name);
1205fe6060f1SDimitry Andric
1206fe6060f1SDimitry Andrictypedef ompd_rc_t (*ompd_callback_memory_read_fn_t)(
1207fe6060f1SDimitry Andric    ompd_address_space_context_t *address_space_context,
1208fe6060f1SDimitry Andric    ompd_thread_context_t *thread_context, const ompd_address_t *addr,
1209fe6060f1SDimitry Andric    ompd_size_t nbytes, void *buffer);
1210fe6060f1SDimitry Andric
1211fe6060f1SDimitry Andrictypedef ompd_rc_t (*ompd_callback_memory_write_fn_t)(
1212fe6060f1SDimitry Andric    ompd_address_space_context_t *address_space_context,
1213fe6060f1SDimitry Andric    ompd_thread_context_t *thread_context, const ompd_address_t *addr,
1214fe6060f1SDimitry Andric    ompd_size_t nbytes, const void *buffer);
1215fe6060f1SDimitry Andric
1216fe6060f1SDimitry Andrictypedef ompd_rc_t (*ompd_callback_device_host_fn_t)(
1217fe6060f1SDimitry Andric    ompd_address_space_context_t *address_space_context, const void *input,
1218fe6060f1SDimitry Andric    ompd_size_t unit_size, ompd_size_t count, void *output);
1219fe6060f1SDimitry Andric
1220fe6060f1SDimitry Andrictypedef ompd_rc_t (*ompd_callback_print_string_fn_t)(const char *string,
1221fe6060f1SDimitry Andric                                                     int category);
1222fe6060f1SDimitry Andric
1223fe6060f1SDimitry Andrictypedef struct ompd_callbacks_t {
1224fe6060f1SDimitry Andric  ompd_callback_memory_alloc_fn_t alloc_memory;
1225fe6060f1SDimitry Andric  ompd_callback_memory_free_fn_t free_memory;
1226fe6060f1SDimitry Andric  ompd_callback_print_string_fn_t print_string;
1227fe6060f1SDimitry Andric  ompd_callback_sizeof_fn_t sizeof_type;
1228fe6060f1SDimitry Andric  ompd_callback_symbol_addr_fn_t symbol_addr_lookup;
1229fe6060f1SDimitry Andric  ompd_callback_memory_read_fn_t read_memory;
1230fe6060f1SDimitry Andric  ompd_callback_memory_write_fn_t write_memory;
1231fe6060f1SDimitry Andric  ompd_callback_memory_read_fn_t read_string;
1232fe6060f1SDimitry Andric  ompd_callback_device_host_fn_t device_to_host;
1233fe6060f1SDimitry Andric  ompd_callback_device_host_fn_t host_to_device;
1234fe6060f1SDimitry Andric  ompd_callback_get_thread_context_for_thread_id_fn_t
1235fe6060f1SDimitry Andric      get_thread_context_for_thread_id;
1236fe6060f1SDimitry Andric} ompd_callbacks_t;
1237fe6060f1SDimitry Andric
1238fe6060f1SDimitry Andricvoid ompd_bp_parallel_begin(void);
1239fe6060f1SDimitry Andric
1240fe6060f1SDimitry Andricvoid ompd_bp_parallel_end(void);
1241fe6060f1SDimitry Andric
1242fe6060f1SDimitry Andricvoid ompd_bp_task_begin(void);
1243fe6060f1SDimitry Andric
1244fe6060f1SDimitry Andricvoid ompd_bp_task_end(void);
1245fe6060f1SDimitry Andric
1246fe6060f1SDimitry Andricvoid ompd_bp_thread_begin(void);
1247fe6060f1SDimitry Andric
1248fe6060f1SDimitry Andricvoid ompd_bp_thread_end(void);
1249fe6060f1SDimitry Andric
1250fe6060f1SDimitry Andricvoid ompd_bp_device_begin(void);
1251fe6060f1SDimitry Andric
1252fe6060f1SDimitry Andricvoid ompd_bp_device_end(void);
1253fe6060f1SDimitry Andric
1254fe6060f1SDimitry Andricompd_rc_t ompd_initialize(ompd_word_t api_version,
1255fe6060f1SDimitry Andric                          const ompd_callbacks_t *callbacks);
1256fe6060f1SDimitry Andric
1257fe6060f1SDimitry Andricompd_rc_t ompd_get_api_version(ompd_word_t *version);
1258fe6060f1SDimitry Andric
1259fe6060f1SDimitry Andricompd_rc_t ompd_get_version_string(const char **string);
1260fe6060f1SDimitry Andric
1261fe6060f1SDimitry Andricompd_rc_t ompd_finalize(void);
1262fe6060f1SDimitry Andric
1263fe6060f1SDimitry Andricompd_rc_t ompd_process_initialize(ompd_address_space_context_t *context,
1264fe6060f1SDimitry Andric                                  ompd_address_space_handle_t **handle);
1265fe6060f1SDimitry Andric
1266fe6060f1SDimitry Andricompd_rc_t ompd_device_initialize(ompd_address_space_handle_t *process_handle,
1267fe6060f1SDimitry Andric                                 ompd_address_space_context_t *device_context,
1268fe6060f1SDimitry Andric                                 ompd_device_t kind, ompd_size_t sizeof_id,
1269fe6060f1SDimitry Andric                                 void *id,
1270fe6060f1SDimitry Andric                                 ompd_address_space_handle_t **device_handle);
1271fe6060f1SDimitry Andric
1272fe6060f1SDimitry Andricompd_rc_t ompd_rel_address_space_handle(ompd_address_space_handle_t *handle);
1273fe6060f1SDimitry Andric
1274fe6060f1SDimitry Andricompd_rc_t ompd_get_omp_version(ompd_address_space_handle_t *address_space,
1275fe6060f1SDimitry Andric                               ompd_word_t *omp_version);
1276fe6060f1SDimitry Andric
1277fe6060f1SDimitry Andricompd_rc_t
1278fe6060f1SDimitry Andricompd_get_omp_version_string(ompd_address_space_handle_t *address_space,
1279fe6060f1SDimitry Andric                            const char **string);
1280fe6060f1SDimitry Andric
1281fe6060f1SDimitry Andricompd_rc_t ompd_get_thread_in_parallel(ompd_parallel_handle_t *parallel_handle,
1282fe6060f1SDimitry Andric                                      int thread_num,
1283fe6060f1SDimitry Andric                                      ompd_thread_handle_t **thread_handle);
1284fe6060f1SDimitry Andric
1285fe6060f1SDimitry Andricompd_rc_t ompd_get_thread_handle(ompd_address_space_handle_t *handle,
1286fe6060f1SDimitry Andric                                 ompd_thread_id_t kind,
1287fe6060f1SDimitry Andric                                 ompd_size_t sizeof_thread_id,
1288fe6060f1SDimitry Andric                                 const void *thread_id,
1289fe6060f1SDimitry Andric                                 ompd_thread_handle_t **thread_handle);
1290fe6060f1SDimitry Andric
1291fe6060f1SDimitry Andricompd_rc_t ompd_rel_thread_handle(ompd_thread_handle_t *thread_handle);
1292fe6060f1SDimitry Andric
1293fe6060f1SDimitry Andricompd_rc_t ompd_thread_handle_compare(ompd_thread_handle_t *thread_handle_1,
1294fe6060f1SDimitry Andric                                     ompd_thread_handle_t *thread_handle_2,
1295fe6060f1SDimitry Andric                                     int *cmp_value);
1296fe6060f1SDimitry Andric
1297fe6060f1SDimitry Andricompd_rc_t ompd_get_thread_id(ompd_thread_handle_t *thread_handle,
1298fe6060f1SDimitry Andric                             ompd_thread_id_t kind,
1299fe6060f1SDimitry Andric                             ompd_size_t sizeof_thread_id, void *thread_id);
1300fe6060f1SDimitry Andric
1301fe6060f1SDimitry Andricompd_rc_t
1302fe6060f1SDimitry Andricompd_get_curr_parallel_handle(ompd_thread_handle_t *thread_handle,
1303fe6060f1SDimitry Andric                              ompd_parallel_handle_t **parallel_handle);
1304fe6060f1SDimitry Andric
1305fe6060f1SDimitry Andricompd_rc_t ompd_get_enclosing_parallel_handle(
1306fe6060f1SDimitry Andric    ompd_parallel_handle_t *parallel_handle,
1307fe6060f1SDimitry Andric    ompd_parallel_handle_t **enclosing_parallel_handle);
1308fe6060f1SDimitry Andric
1309fe6060f1SDimitry Andricompd_rc_t
1310fe6060f1SDimitry Andricompd_get_task_parallel_handle(ompd_task_handle_t *task_handle,
1311fe6060f1SDimitry Andric                              ompd_parallel_handle_t **task_parallel_handle);
1312fe6060f1SDimitry Andric
1313fe6060f1SDimitry Andricompd_rc_t ompd_rel_parallel_handle(ompd_parallel_handle_t *parallel_handle);
1314fe6060f1SDimitry Andric
1315fe6060f1SDimitry Andricompd_rc_t
1316fe6060f1SDimitry Andricompd_parallel_handle_compare(ompd_parallel_handle_t *parallel_handle_1,
1317fe6060f1SDimitry Andric                             ompd_parallel_handle_t *parallel_handle_2,
1318fe6060f1SDimitry Andric                             int *cmp_value);
1319fe6060f1SDimitry Andric
1320fe6060f1SDimitry Andricompd_rc_t ompd_get_curr_task_handle(ompd_thread_handle_t *thread_handle,
1321fe6060f1SDimitry Andric                                    ompd_task_handle_t **task_handle);
1322fe6060f1SDimitry Andric
1323fe6060f1SDimitry Andricompd_rc_t
1324fe6060f1SDimitry Andricompd_get_generating_task_handle(ompd_task_handle_t *task_handle,
1325fe6060f1SDimitry Andric                                ompd_task_handle_t **generating_task_handle);
1326fe6060f1SDimitry Andric
1327fe6060f1SDimitry Andricompd_rc_t
1328fe6060f1SDimitry Andricompd_get_scheduling_task_handle(ompd_task_handle_t *task_handle,
1329fe6060f1SDimitry Andric                                ompd_task_handle_t **scheduling_task_handle);
1330fe6060f1SDimitry Andric
1331fe6060f1SDimitry Andricompd_rc_t ompd_get_task_in_parallel(ompd_parallel_handle_t *parallel_handle,
1332fe6060f1SDimitry Andric                                    int thread_num,
1333fe6060f1SDimitry Andric                                    ompd_task_handle_t **task_handle);
1334fe6060f1SDimitry Andric
1335fe6060f1SDimitry Andricompd_rc_t ompd_rel_task_handle(ompd_task_handle_t *task_handle);
1336fe6060f1SDimitry Andric
1337fe6060f1SDimitry Andricompd_rc_t ompd_task_handle_compare(ompd_task_handle_t *task_handle_1,
1338fe6060f1SDimitry Andric                                   ompd_task_handle_t *task_handle_2,
1339fe6060f1SDimitry Andric                                   int *cmp_value);
1340fe6060f1SDimitry Andric
1341fe6060f1SDimitry Andricompd_rc_t ompd_get_task_function(ompd_task_handle_t *task_handle,
1342fe6060f1SDimitry Andric                                 ompd_address_t *entry_point);
1343fe6060f1SDimitry Andric
1344fe6060f1SDimitry Andricompd_rc_t ompd_get_task_frame(ompd_task_handle_t *task_handle,
1345fe6060f1SDimitry Andric                              ompd_frame_info_t *exit_frame,
1346fe6060f1SDimitry Andric                              ompd_frame_info_t *enter_frame);
1347fe6060f1SDimitry Andric
1348fe6060f1SDimitry Andricompd_rc_t
1349fe6060f1SDimitry Andricompd_enumerate_states(ompd_address_space_handle_t *address_space_handle,
1350fe6060f1SDimitry Andric                      ompd_word_t current_state, ompd_word_t *next_state,
1351fe6060f1SDimitry Andric                      const char **next_state_name, ompd_word_t *more_enums);
1352fe6060f1SDimitry Andric
1353fe6060f1SDimitry Andricompd_rc_t ompd_get_state(ompd_thread_handle_t *thread_handle,
1354fe6060f1SDimitry Andric                         ompd_word_t *state, ompd_wait_id_t *wait_id);
1355fe6060f1SDimitry Andric
1356fe6060f1SDimitry Andricompd_rc_t
1357fe6060f1SDimitry Andricompd_get_display_control_vars(ompd_address_space_handle_t *address_space_handle,
1358fe6060f1SDimitry Andric                              const char *const **control_vars);
1359fe6060f1SDimitry Andric
1360fe6060f1SDimitry Andricompd_rc_t ompd_rel_display_control_vars(const char *const **control_vars);
1361fe6060f1SDimitry Andric
1362fe6060f1SDimitry Andricompd_rc_t ompd_enumerate_icvs(ompd_address_space_handle_t *handle,
1363fe6060f1SDimitry Andric                              ompd_icv_id_t current, ompd_icv_id_t *next_id,
1364fe6060f1SDimitry Andric                              const char **next_icv_name,
1365fe6060f1SDimitry Andric                              ompd_scope_t *next_scope, int *more);
1366fe6060f1SDimitry Andric
1367fe6060f1SDimitry Andricompd_rc_t ompd_get_icv_from_scope(void *handle, ompd_scope_t scope,
1368fe6060f1SDimitry Andric                                  ompd_icv_id_t icv_id, ompd_word_t *icv_value);
1369fe6060f1SDimitry Andric
1370fe6060f1SDimitry Andricompd_rc_t ompd_get_icv_string_from_scope(void *handle, ompd_scope_t scope,
1371fe6060f1SDimitry Andric                                         ompd_icv_id_t icv_id,
1372fe6060f1SDimitry Andric                                         const char **icv_string);
1373fe6060f1SDimitry Andric
1374fe6060f1SDimitry Andricompd_rc_t ompd_get_tool_data(void *handle, ompd_scope_t scope,
1375fe6060f1SDimitry Andric                             ompd_word_t *value, ompd_address_t *ptr);
1376fe6060f1SDimitry Andric
13770b57cec5SDimitry Andrictypedef struct ompt_record_ompt_t {
13780b57cec5SDimitry Andric  ompt_callbacks_t type;
13790b57cec5SDimitry Andric  ompt_device_time_t time;
13800b57cec5SDimitry Andric  ompt_id_t thread_id;
13810b57cec5SDimitry Andric  ompt_id_t target_id;
13820b57cec5SDimitry Andric  union {
13830b57cec5SDimitry Andric    ompt_record_thread_begin_t thread_begin;
13840b57cec5SDimitry Andric    ompt_record_parallel_begin_t parallel_begin;
13850b57cec5SDimitry Andric    ompt_record_parallel_end_t parallel_end;
13860b57cec5SDimitry Andric    ompt_record_work_t work;
13870b57cec5SDimitry Andric    ompt_record_dispatch_t dispatch;
13880b57cec5SDimitry Andric    ompt_record_task_create_t task_create;
13890b57cec5SDimitry Andric    ompt_record_dependences_t dependences;
13900b57cec5SDimitry Andric    ompt_record_task_dependence_t task_dependence;
13910b57cec5SDimitry Andric    ompt_record_task_schedule_t task_schedule;
13920b57cec5SDimitry Andric    ompt_record_implicit_task_t implicit_task;
1393e8d8bef9SDimitry Andric    ompt_record_masked_t masked;
13940b57cec5SDimitry Andric    ompt_record_sync_region_t sync_region;
13950b57cec5SDimitry Andric    ompt_record_mutex_acquire_t mutex_acquire;
13960b57cec5SDimitry Andric    ompt_record_mutex_t mutex;
13970b57cec5SDimitry Andric    ompt_record_nest_lock_t nest_lock;
13980b57cec5SDimitry Andric    ompt_record_flush_t flush;
13990b57cec5SDimitry Andric    ompt_record_cancel_t cancel;
14000b57cec5SDimitry Andric    ompt_record_target_t target;
14010b57cec5SDimitry Andric    ompt_record_target_data_op_t target_data_op;
14020b57cec5SDimitry Andric    ompt_record_target_map_t target_map;
14030b57cec5SDimitry Andric    ompt_record_target_kernel_t target_kernel;
14040b57cec5SDimitry Andric    ompt_record_control_tool_t control_tool;
14050b57cec5SDimitry Andric  } record;
14060b57cec5SDimitry Andric} ompt_record_ompt_t;
14070b57cec5SDimitry Andric
14080b57cec5SDimitry Andrictypedef ompt_record_ompt_t *(*ompt_get_record_ompt_t) (
14090b57cec5SDimitry Andric  ompt_buffer_t *buffer,
14100b57cec5SDimitry Andric  ompt_buffer_cursor_t current
14110b57cec5SDimitry Andric);
14120b57cec5SDimitry Andric
1413*0fca6ea1SDimitry Andric#ifdef _WIN32
1414*0fca6ea1SDimitry Andric__declspec(dllexport)
1415*0fca6ea1SDimitry Andric#else
1416*0fca6ea1SDimitry Andric__attribute__((visibility("default")))
1417*0fca6ea1SDimitry Andric#endif
1418*0fca6ea1SDimitry Andricompt_start_tool_result_t *ompt_start_tool(unsigned int omp_version,
1419*0fca6ea1SDimitry Andric                                          const char *runtime_version);
1420*0fca6ea1SDimitry Andric
14210b57cec5SDimitry Andric#define ompt_id_none 0
14220b57cec5SDimitry Andric#define ompt_data_none {0}
14230b57cec5SDimitry Andric#define ompt_time_none 0
14240b57cec5SDimitry Andric#define ompt_hwid_none 0
14250b57cec5SDimitry Andric#define ompt_addr_none ~0
14260b57cec5SDimitry Andric#define ompt_mutex_impl_none 0
14270b57cec5SDimitry Andric#define ompt_wait_id_none 0
14280b57cec5SDimitry Andric
14290b57cec5SDimitry Andric#define ompd_segment_none 0
14300b57cec5SDimitry Andric
1431*0fca6ea1SDimitry Andric#if defined(__cplusplus)
1432*0fca6ea1SDimitry Andric} // extern "C"
1433*0fca6ea1SDimitry Andric#endif
1434*0fca6ea1SDimitry Andric
14350b57cec5SDimitry Andric#endif /* __OMPT__ */
1436