llvm/projects/openmp/runtime/src/omp-tools.h

/*
 * include/omp-tools.h.var
 */

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef __OMPT__
#define __OMPT__

/*****************************************************************************
 * system include files
 *****************************************************************************/

#include <stdint.h>
#include <stddef.h>

#ifdef DEPRECATION_WARNINGS 
# ifdef __cplusplus
#define DEPRECATED_51
# else
#define DEPRECATED_51
#endif
#else
#define DEPRECATED_51
#endif

/*****************************************************************************
 * iteration macros
 *****************************************************************************/

#define FOREACH_OMPT_INQUIRY_FN(macro)

#define FOREACH_OMPT_STATE(macro)


#define FOREACH_KMP_MUTEX_IMPL(macro)

#define FOREACH_OMPT_HOST_EVENT(macro)

#define FOREACH_OMPT_DEVICE_EVENT(macro)

#define FOREACH_OMPT_NOEMI_EVENT(macro)

#define FOREACH_OMPT_EMI_EVENT(macro)

#define FOREACH_OMPT_50_TARGET_EVENT(macro) 

#define FOREACH_OMPT_51_TARGET_EVENT(macro) 

#define FOREACH_OMPT_EVENT(macro)

#define FOREACH_OMPT_51_EVENT(macro)

/*****************************************************************************
 * implementation specific types
 *****************************************************************************/

kmp_mutex_impl_t;

/*****************************************************************************
 * definitions generated from spec
 *****************************************************************************/

#if defined(__cplusplus)
extern "C" {
#endif

ompt_callbacks_t;

ompt_record_t;

ompt_record_native_t;

ompt_set_result_t;

ompt_id_t;

ompt_device_time_t;

ompt_buffer_cursor_t;

ompt_thread_t;

ompt_scope_endpoint_t;

ompt_dispatch_t;

ompt_sync_region_t;

ompt_target_data_op_t;

ompt_work_t;

ompt_mutex_t;

ompt_native_mon_flag_t;

ompt_task_flag_t;

ompt_task_status_t;

ompt_target_t;

ompt_parallel_flag_t;

ompt_target_map_flag_t;

ompt_dependence_type_t;

ompt_severity_t;

ompt_cancel_flag_t;

ompt_hwid_t;

ompt_wait_id_t;

ompt_frame_flag_t;

ompt_state_t;

ompt_get_unique_id_t;

ompd_size_t;

ompd_wait_id_t;

ompd_addr_t;
ompd_word_t;
ompd_seg_t;

ompd_device_t;

ompd_thread_id_t;

ompd_scope_t;

ompd_icv_id_t;

ompd_rc_t;

ompt_interface_fn_t;

ompt_function_lookup_t;

ompt_data_t;

ompt_frame_t;

ompt_callback_t;

ompt_device_t;

ompt_buffer_t;

ompt_callback_buffer_request_t;

ompt_callback_buffer_complete_t;

ompt_finalize_t;

ompt_initialize_t;

ompt_start_tool_result_t;

ompt_record_abstract_t;

ompt_dependence_t;

ompt_dispatch_chunk_t;

ompt_enumerate_states_t;

ompt_enumerate_mutex_impls_t;

ompt_set_callback_t;

ompt_get_callback_t;

ompt_get_thread_data_t;

ompt_get_num_procs_t;

ompt_get_num_places_t;

ompt_get_place_proc_ids_t;

ompt_get_place_num_t;

ompt_get_partition_place_nums_t;

ompt_get_proc_id_t;

ompt_get_state_t;

ompt_get_parallel_info_t;

ompt_get_task_info_t;

ompt_get_task_memory_t;

ompt_get_target_info_t;

ompt_get_num_devices_t;

ompt_finalize_tool_t;

ompt_get_device_num_procs_t;

ompt_get_device_time_t;

ompt_translate_time_t;

ompt_set_trace_ompt_t;

ompt_set_trace_native_t;

ompt_start_trace_t;

ompt_pause_trace_t;

ompt_flush_trace_t;

ompt_stop_trace_t;

ompt_advance_buffer_cursor_t;

ompt_get_record_type_t;

ompt_get_record_native_t;

ompt_get_record_abstract_t;

ompt_callback_thread_begin_t;

ompt_record_thread_begin_t;

ompt_callback_thread_end_t;

ompt_callback_parallel_begin_t;

ompt_record_parallel_begin_t;

ompt_callback_parallel_end_t;

ompt_record_parallel_end_t;

ompt_callback_work_t;

ompt_record_work_t;

ompt_callback_dispatch_t;

ompt_record_dispatch_t;

ompt_callback_task_create_t;

ompt_record_task_create_t;

ompt_callback_dependences_t;

ompt_record_dependences_t;

ompt_callback_task_dependence_t;

ompt_record_task_dependence_t;

ompt_callback_task_schedule_t;

ompt_record_task_schedule_t;

ompt_callback_implicit_task_t;

ompt_record_implicit_task_t;

ompt_callback_masked_t;

ompt_callback_master_t DEPRECATED_51;

ompt_record_masked_t;

ompt_callback_sync_region_t;

ompt_record_sync_region_t;

ompt_callback_mutex_acquire_t;

ompt_record_mutex_acquire_t;

ompt_callback_mutex_t;

ompt_record_mutex_t;

ompt_callback_nest_lock_t;

ompt_record_nest_lock_t;

ompt_callback_flush_t;

ompt_record_flush_t;

ompt_callback_cancel_t;

ompt_record_cancel_t;

ompt_callback_device_initialize_t;

ompt_callback_device_finalize_t;

ompt_callback_device_load_t;

ompt_callback_device_unload_t;

ompt_callback_target_data_op_emi_t;

ompt_callback_target_data_op_t;

ompt_record_target_data_op_t;

ompt_callback_target_emi_t;

ompt_callback_target_t;

ompt_record_target_t;

ompt_callback_target_map_emi_t;

ompt_callback_target_map_t;

ompt_record_target_map_t;

ompt_callback_target_submit_emi_t;

ompt_callback_target_submit_t;

ompt_record_target_kernel_t;

ompt_callback_control_tool_t;

ompt_record_control_tool_t;

ompt_callback_error_t;

ompt_record_error_t;

ompd_address_t;

ompd_frame_info_t;

ompd_address_space_handle_t;
ompd_thread_handle_t;
ompd_parallel_handle_t;
ompd_task_handle_t;

ompd_address_space_context_t;
ompd_thread_context_t;

ompd_device_type_sizes_t;

void ompd_dll_locations_valid(void);

ompd_callback_memory_alloc_fn_t;

ompd_callback_memory_free_fn_t;

ompd_callback_get_thread_context_for_thread_id_fn_t;

ompd_callback_sizeof_fn_t;

ompd_callback_symbol_addr_fn_t;

ompd_callback_memory_read_fn_t;

ompd_callback_memory_write_fn_t;

ompd_callback_device_host_fn_t;

ompd_callback_print_string_fn_t;

ompd_callbacks_t;

void ompd_bp_parallel_begin(void);

void ompd_bp_parallel_end(void);

void ompd_bp_task_begin(void);

void ompd_bp_task_end(void);

void ompd_bp_thread_begin(void);

void ompd_bp_thread_end(void);

void ompd_bp_device_begin(void);

void ompd_bp_device_end(void);

ompd_rc_t ompd_initialize(ompd_word_t api_version,
                          const ompd_callbacks_t *callbacks);

ompd_rc_t ompd_get_api_version(ompd_word_t *version);

ompd_rc_t ompd_get_version_string(const char **string);

ompd_rc_t ompd_finalize(void);

ompd_rc_t ompd_process_initialize(ompd_address_space_context_t *context,
                                  ompd_address_space_handle_t **handle);

ompd_rc_t ompd_device_initialize(ompd_address_space_handle_t *process_handle,
                                 ompd_address_space_context_t *device_context,
                                 ompd_device_t kind, ompd_size_t sizeof_id,
                                 void *id,
                                 ompd_address_space_handle_t **device_handle);

ompd_rc_t ompd_rel_address_space_handle(ompd_address_space_handle_t *handle);

ompd_rc_t ompd_get_omp_version(ompd_address_space_handle_t *address_space,
                               ompd_word_t *omp_version);

ompd_rc_t
ompd_get_omp_version_string(ompd_address_space_handle_t *address_space,
                            const char **string);

ompd_rc_t ompd_get_thread_in_parallel(ompd_parallel_handle_t *parallel_handle,
                                      int thread_num,
                                      ompd_thread_handle_t **thread_handle);

ompd_rc_t ompd_get_thread_handle(ompd_address_space_handle_t *handle,
                                 ompd_thread_id_t kind,
                                 ompd_size_t sizeof_thread_id,
                                 const void *thread_id,
                                 ompd_thread_handle_t **thread_handle);

ompd_rc_t ompd_rel_thread_handle(ompd_thread_handle_t *thread_handle);

ompd_rc_t ompd_thread_handle_compare(ompd_thread_handle_t *thread_handle_1,
                                     ompd_thread_handle_t *thread_handle_2,
                                     int *cmp_value);

ompd_rc_t ompd_get_thread_id(ompd_thread_handle_t *thread_handle,
                             ompd_thread_id_t kind,
                             ompd_size_t sizeof_thread_id, void *thread_id);

ompd_rc_t
ompd_get_curr_parallel_handle(ompd_thread_handle_t *thread_handle,
                              ompd_parallel_handle_t **parallel_handle);

ompd_rc_t ompd_get_enclosing_parallel_handle(
    ompd_parallel_handle_t *parallel_handle,
    ompd_parallel_handle_t **enclosing_parallel_handle);

ompd_rc_t
ompd_get_task_parallel_handle(ompd_task_handle_t *task_handle,
                              ompd_parallel_handle_t **task_parallel_handle);

ompd_rc_t ompd_rel_parallel_handle(ompd_parallel_handle_t *parallel_handle);

ompd_rc_t
ompd_parallel_handle_compare(ompd_parallel_handle_t *parallel_handle_1,
                             ompd_parallel_handle_t *parallel_handle_2,
                             int *cmp_value);

ompd_rc_t ompd_get_curr_task_handle(ompd_thread_handle_t *thread_handle,
                                    ompd_task_handle_t **task_handle);

ompd_rc_t
ompd_get_generating_task_handle(ompd_task_handle_t *task_handle,
                                ompd_task_handle_t **generating_task_handle);

ompd_rc_t
ompd_get_scheduling_task_handle(ompd_task_handle_t *task_handle,
                                ompd_task_handle_t **scheduling_task_handle);

ompd_rc_t ompd_get_task_in_parallel(ompd_parallel_handle_t *parallel_handle,
                                    int thread_num,
                                    ompd_task_handle_t **task_handle);

ompd_rc_t ompd_rel_task_handle(ompd_task_handle_t *task_handle);

ompd_rc_t ompd_task_handle_compare(ompd_task_handle_t *task_handle_1,
                                   ompd_task_handle_t *task_handle_2,
                                   int *cmp_value);

ompd_rc_t ompd_get_task_function(ompd_task_handle_t *task_handle,
                                 ompd_address_t *entry_point);

ompd_rc_t ompd_get_task_frame(ompd_task_handle_t *task_handle,
                              ompd_frame_info_t *exit_frame,
                              ompd_frame_info_t *enter_frame);

ompd_rc_t
ompd_enumerate_states(ompd_address_space_handle_t *address_space_handle,
                      ompd_word_t current_state, ompd_word_t *next_state,
                      const char **next_state_name, ompd_word_t *more_enums);

ompd_rc_t ompd_get_state(ompd_thread_handle_t *thread_handle,
                         ompd_word_t *state, ompd_wait_id_t *wait_id);

ompd_rc_t
ompd_get_display_control_vars(ompd_address_space_handle_t *address_space_handle,
                              const char *const **control_vars);

ompd_rc_t ompd_rel_display_control_vars(const char *const **control_vars);

ompd_rc_t ompd_enumerate_icvs(ompd_address_space_handle_t *handle,
                              ompd_icv_id_t current, ompd_icv_id_t *next_id,
                              const char **next_icv_name,
                              ompd_scope_t *next_scope, int *more);

ompd_rc_t ompd_get_icv_from_scope(void *handle, ompd_scope_t scope,
                                  ompd_icv_id_t icv_id, ompd_word_t *icv_value);

ompd_rc_t ompd_get_icv_string_from_scope(void *handle, ompd_scope_t scope,
                                         ompd_icv_id_t icv_id,
                                         const char **icv_string);

ompd_rc_t ompd_get_tool_data(void *handle, ompd_scope_t scope,
                             ompd_word_t *value, ompd_address_t *ptr);

ompt_record_ompt_t;

ompt_get_record_ompt_t;

#ifdef _WIN32
__declspec(dllexport)
#else
__attribute__((visibility("default")))
#endif
ompt_start_tool_result_t *ompt_start_tool(unsigned int omp_version,
                                          const char *runtime_version);

#define ompt_id_none
#define ompt_data_none
#define ompt_time_none
#define ompt_hwid_none
#define ompt_addr_none
#define ompt_mutex_impl_none
#define ompt_wait_id_none

#define ompd_segment_none

#if defined(__cplusplus)
} // extern "C"
#endif

#endif /* __OMPT__ */