LLVM OpenMP 22.0.0git
|
This file represents the core implementation file for the ompTest library. More...
Go to the source code of this file.
Macros | |
#define | register_ompt_callback_t(name, type) |
#define | register_ompt_callback(name) |
#define | OMPT_BUFFER_REQUEST_SIZE 256 |
Typedefs | |
typedef std::unordered_set< ompt_device_t * > | OmptDeviceSetTy |
typedef std::unique_ptr< OmptDeviceSetTy > | OmptDeviceSetPtrTy |
Functions | |
static void | on_ompt_callback_buffer_request (int device_num, ompt_buffer_t **buffer, size_t *bytes) |
static void | on_ompt_callback_buffer_complete (int device_num, ompt_buffer_t *buffer, size_t bytes, ompt_buffer_cursor_t begin, int buffer_owned) |
static ompt_set_result_t | set_trace_ompt (ompt_device_t *Device) |
static void | on_ompt_callback_thread_begin (ompt_thread_t thread_type, ompt_data_t *thread_data) |
static void | on_ompt_callback_thread_end (ompt_data_t *thread_data) |
static void | on_ompt_callback_parallel_begin (ompt_data_t *encountering_task_data, const ompt_frame_t *encountering_task_frame, ompt_data_t *parallel_data, unsigned int requested_parallelism, int flags, const void *codeptr_ra) |
static void | on_ompt_callback_parallel_end (ompt_data_t *parallel_data, ompt_data_t *encountering_task_data, int flags, const void *codeptr_ra) |
static void | on_ompt_callback_task_create (ompt_data_t *encountering_task_data, const ompt_frame_t *encountering_task_frame, ompt_data_t *new_task_data, int flags, int has_dependences, const void *codeptr_ra) |
static void | on_ompt_callback_task_schedule (ompt_data_t *prior_task_data, ompt_task_status_t prior_task_status, ompt_data_t *next_task_data) |
static void | on_ompt_callback_implicit_task (ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, unsigned int actual_parallelism, unsigned int index, int flags) |
static void | on_ompt_callback_work (ompt_work_t work_type, ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, uint64_t count, const void *codeptr_ra) |
static void | on_ompt_callback_dispatch (ompt_data_t *parallel_data, ompt_data_t *task_data, ompt_dispatch_t kind, ompt_data_t instance) |
static void | on_ompt_callback_sync_region (ompt_sync_region_t kind, ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, const void *codeptr_ra) |
static void | on_ompt_callback_device_initialize (int device_num, const char *type, ompt_device_t *device, ompt_function_lookup_t lookup, const char *documentation) |
static void | on_ompt_callback_device_finalize (int device_num) |
static void | on_ompt_callback_device_load (int device_num, const char *filename, int64_t offset_in_file, void *vma_in_file, size_t bytes, void *host_addr, void *device_addr, uint64_t module_id) |
static void | on_ompt_callback_device_unload (int device_num, uint64_t module_id) |
static void | on_ompt_callback_target_data_op (ompt_id_t target_id, ompt_id_t host_op_id, ompt_target_data_op_t optype, void *src_addr, int src_device_num, void *dest_addr, int dest_device_num, size_t bytes, const void *codeptr_ra) |
static void | on_ompt_callback_target (ompt_target_t kind, ompt_scope_endpoint_t endpoint, int device_num, ompt_data_t *task_data, ompt_id_t target_id, const void *codeptr_ra) |
static void | on_ompt_callback_target_submit (ompt_id_t target_id, ompt_id_t host_op_id, unsigned int requested_num_teams) |
static void | on_ompt_callback_target_data_op_emi (ompt_scope_endpoint_t endpoint, ompt_data_t *target_task_data, ompt_data_t *target_data, ompt_id_t *host_op_id, ompt_target_data_op_t optype, void *src_addr, int src_device_num, void *dest_addr, int dest_device_num, size_t bytes, const void *codeptr_ra) |
static void | on_ompt_callback_target_emi (ompt_target_t kind, ompt_scope_endpoint_t endpoint, int device_num, ompt_data_t *task_data, ompt_data_t *target_task_data, ompt_data_t *target_data, const void *codeptr_ra) |
static void | on_ompt_callback_target_submit_emi (ompt_scope_endpoint_t endpoint, ompt_data_t *target_data, ompt_id_t *host_op_id, unsigned int requested_num_teams) |
static void | on_ompt_callback_target_map (ompt_id_t target_id, unsigned int nitems, void **host_addr, void **device_addr, size_t *bytes, unsigned int *mapping_flags, const void *codeptr_ra) |
static void | on_ompt_callback_target_map_emi (ompt_data_t *target_data, unsigned int nitems, void **host_addr, void **device_addr, size_t *bytes, unsigned int *mapping_flags, const void *codeptr_ra) |
bool | getBoolEnvironmentVariable (const char *VariableName) |
Load the value of a given boolean environmental variable. | |
int | ompt_initialize (ompt_function_lookup_t lookup, int initial_device_num, ompt_data_t *tool_data) |
Called by the OMP runtime to initialize the OMPT. | |
void | ompt_finalize (ompt_data_t *tool_data) |
ompt_start_tool_result_t * | ompt_start_tool (unsigned int omp_version, const char *runtime_version) |
Called from the OMP Runtime to start / initialize the tool. | |
int | start_trace (ompt_device_t *Device) |
int | flush_trace (ompt_device_t *Device) |
int | flush_traced_devices () |
int | stop_trace (ompt_device_t *Device) |
void | libomptest_global_eventreporter_set_active (bool State) |
Variables | |
OmptCallbackHandler * | Handler |
static OmptEventReporter * | EventReporter |
static std::atomic< ompt_id_t > | NextOpId {0x8000000000000001} |
static bool | UseEMICallbacks = false |
static bool | UseTracing = false |
static bool | RunAsTestSuite = false |
static bool | ColoredLog = false |
static ompt_set_trace_ompt_t | ompt_set_trace_ompt = 0 |
static ompt_start_trace_t | ompt_start_trace = 0 |
static ompt_flush_trace_t | ompt_flush_trace = 0 |
static ompt_stop_trace_t | ompt_stop_trace = 0 |
static ompt_get_record_ompt_t | ompt_get_record_ompt = 0 |
static ompt_advance_buffer_cursor_t | ompt_advance_buffer_cursor = 0 |
static ompt_get_record_type_t | ompt_get_record_type_fn = 0 |
static OmptDeviceSetPtrTy | TracedDevices |
This file represents the core implementation file for the ompTest library.
It provides the actual OMPT tool implementation: registers callbacks, etc. OMPT callbacks are passed to their corresponding handler, which in turn notifies all registered asserters.
Definition in file OmptTester.cpp.
#define OMPT_BUFFER_REQUEST_SIZE 256 |
Definition at line 42 of file OmptTester.cpp.
Referenced by on_ompt_callback_buffer_request().
#define register_ompt_callback | ( | name | ) |
Definition at line 33 of file OmptTester.cpp.
typedef std::unique_ptr<OmptDeviceSetTy> OmptDeviceSetPtrTy |
Definition at line 65 of file OmptTester.cpp.
typedef std::unordered_set<ompt_device_t *> OmptDeviceSetTy |
Definition at line 64 of file OmptTester.cpp.
int flush_trace | ( | ompt_device_t * | Device | ) |
Definition at line 464 of file OmptTester.cpp.
References ompt_flush_trace.
int flush_traced_devices | ( | ) |
Definition at line 470 of file OmptTester.cpp.
References ompt_flush_trace, and TracedDevices.
Referenced by TestCase::exec(), testing::OmptTestCase::TearDown(), and testing::OmptTestCaseXFail::TearDown().
Load the value of a given boolean environmental variable.
Definition at line 362 of file OmptTester.cpp.
Referenced by ompt_initialize().
Definition at line 498 of file OmptTester.cpp.
References EventReporter.
void ompt_finalize | ( | ompt_data_t * | tool_data | ) |
Definition at line 433 of file OmptTester.cpp.
References EventReporter, and Handler.
int ompt_initialize | ( | ompt_function_lookup_t | lookup, |
int | initial_device_num, | ||
ompt_data_t * | tool_data ) |
Called by the OMP runtime to initialize the OMPT.
Definition at line 376 of file OmptTester.cpp.
References ColoredLog, EventReporter, omptest::OmptCallbackHandler::get(), getBoolEnvironmentVariable(), ompt_set_callback, register_ompt_callback, RunAsTestSuite, omptest::OmptCallbackHandler::subscribe(), UseEMICallbacks, and UseTracing.
ompt_start_tool_result_t * ompt_start_tool | ( | unsigned int | omp_version, |
const char * | runtime_version ) |
Called from the OMP Runtime to start / initialize the tool.
Definition at line 444 of file OmptTester.cpp.
References ompt_finalize(), ompt_initialize(), and ompt_start_tool_result.
|
static |
Definition at line 82 of file OmptTester.cpp.
References begin, omptest::OmptCallbackHandler::get(), omptest::OmptCallbackHandler::handleBufferComplete(), omptest::OmptCallbackHandler::handleBufferRecord(), omptest::OmptCallbackHandler::handleBufferRecordDeallocation(), ompt_advance_buffer_cursor, ompt_get_record_ompt, and ompt_get_record_type_fn.
Referenced by start_trace().
|
static |
Definition at line 71 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), omptest::OmptCallbackHandler::handleBufferRequest(), and OMPT_BUFFER_REQUEST_SIZE.
Referenced by start_trace().
Definition at line 261 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleDeviceFinalize().
|
static |
Definition at line 215 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), omptest::OmptCallbackHandler::handleDeviceInitialize(), ompt_advance_buffer_cursor, ompt_flush_trace, ompt_get_record_ompt, ompt_get_record_type_fn, ompt_set_trace_ompt, ompt_start_trace, ompt_stop_trace, set_trace_ompt(), start_trace(), TracedDevices, type, and UseTracing.
|
static |
Definition at line 265 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleDeviceLoad().
Definition at line 275 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleDeviceUnload().
|
static |
Definition at line 195 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), omptest::OmptCallbackHandler::handleDispatch(), and instance.
|
static |
Definition at line 175 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleImplicitTask().
|
static |
Definition at line 142 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleParallelBegin().
|
static |
Definition at line 151 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleParallelEnd().
|
static |
Definition at line 203 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleSyncRegion().
|
static |
Definition at line 288 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleTarget().
|
static |
Definition at line 279 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleTargetDataOp().
|
static |
Definition at line 304 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), omptest::OmptCallbackHandler::handleTargetDataOpEmi(), and NextOpId.
|
static |
Definition at line 323 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), omptest::OmptCallbackHandler::handleTargetEmi(), and NextOpId.
|
static |
Definition at line 344 of file OmptTester.cpp.
|
static |
Definition at line 352 of file OmptTester.cpp.
|
static |
Definition at line 297 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleTargetSubmit().
|
static |
Definition at line 337 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleTargetSubmitEmi().
|
static |
Definition at line 159 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleTaskCreate().
|
static |
Definition at line 168 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleTaskSchedule().
|
static |
Definition at line 133 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleThreadBegin().
|
static |
Definition at line 138 of file OmptTester.cpp.
References omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleThreadEnd().
|
static |
Definition at line 186 of file OmptTester.cpp.
References count, omptest::OmptCallbackHandler::get(), and omptest::OmptCallbackHandler::handleWork().
|
static |
Definition at line 109 of file OmptTester.cpp.
References ompt_set_trace_ompt, and UseEMICallbacks.
Referenced by on_ompt_callback_device_initialize().
int start_trace | ( | ompt_device_t * | Device | ) |
Definition at line 451 of file OmptTester.cpp.
References ompt_start_trace, on_ompt_callback_buffer_complete(), on_ompt_callback_buffer_request(), and TracedDevices.
Referenced by on_ompt_callback_device_initialize().
int stop_trace | ( | ompt_device_t * | Device | ) |
Definition at line 485 of file OmptTester.cpp.
References ompt_stop_trace, and TracedDevices.
|
static |
Definition at line 52 of file OmptTester.cpp.
Referenced by ompt_initialize().
|
static |
Definition at line 30 of file OmptTester.cpp.
Referenced by libomptest_global_eventreporter_set_active(), ompt_finalize(), and ompt_initialize().
|
extern |
Definition at line 18 of file OmptCallbackHandler.cpp.
|
static |
Definition at line 48 of file OmptTester.cpp.
Referenced by on_ompt_callback_target_data_op_emi(), and on_ompt_callback_target_emi().
|
static |
Definition at line 60 of file OmptTester.cpp.
Referenced by on_ompt_callback_buffer_complete(), and on_ompt_callback_device_initialize().
|
static |
Definition at line 57 of file OmptTester.cpp.
Referenced by flush_trace(), flush_traced_devices(), and on_ompt_callback_device_initialize().
|
static |
Definition at line 59 of file OmptTester.cpp.
Referenced by on_ompt_callback_buffer_complete(), and on_ompt_callback_device_initialize().
|
static |
Definition at line 61 of file OmptTester.cpp.
Referenced by on_ompt_callback_buffer_complete(), and on_ompt_callback_device_initialize().
|
static |
Definition at line 55 of file OmptTester.cpp.
Referenced by on_ompt_callback_device_initialize(), and set_trace_ompt().
|
static |
Definition at line 56 of file OmptTester.cpp.
Referenced by on_ompt_callback_device_initialize(), and start_trace().
|
static |
Definition at line 58 of file OmptTester.cpp.
Referenced by on_ompt_callback_device_initialize(), and stop_trace().
|
static |
Definition at line 51 of file OmptTester.cpp.
Referenced by ompt_initialize().
|
static |
Definition at line 66 of file OmptTester.cpp.
Referenced by flush_traced_devices(), on_ompt_callback_device_initialize(), start_trace(), and stop_trace().
|
static |
Definition at line 49 of file OmptTester.cpp.
Referenced by ompt_initialize(), and set_trace_ompt().
|
static |
Definition at line 50 of file OmptTester.cpp.
Referenced by ompt_initialize(), and on_ompt_callback_device_initialize().