LLVM OpenMP 22.0.0git
|
Handler class to do whatever is needed to be done when a callback is invoked by the OMP runtime Supports a RecordAndReplay mechanism in which all OMPT events are recorded and then replayed. More...
Public Member Functions | |
~OmptCallbackHandler ()=default | |
void | subscribe (OmptListener *Listener) |
Subscribe a listener to be notified for OMPT events. | |
void | clearSubscribers () |
Remove all subscribers. | |
void | replay () |
When the record and replay mechanism is enabled this replays all OMPT events. | |
void | handleAssertionSyncPoint (const std::string &SyncPointName) |
Special asserter callback which checks that upon encountering the synchronization point, all expected events have been processed. | |
void | handleThreadBegin (ompt_thread_t ThreadType, ompt_data_t *ThreadData) |
void | handleThreadEnd (ompt_data_t *ThreadData) |
void | handleTaskCreate (ompt_data_t *EncounteringTaskData, const ompt_frame_t *EncounteringTaskFrame, ompt_data_t *NewTaskData, int Flags, int HasDependences, const void *CodeptrRA) |
void | handleTaskSchedule (ompt_data_t *PriorTaskData, ompt_task_status_t PriorTaskStatus, ompt_data_t *NextTaskData) |
void | handleImplicitTask (ompt_scope_endpoint_t Endpoint, ompt_data_t *ParallelData, ompt_data_t *TaskData, unsigned int ActualParallelism, unsigned int Index, int Flags) |
void | handleParallelBegin (ompt_data_t *EncounteringTaskData, const ompt_frame_t *EncounteringTaskFrame, ompt_data_t *ParallelData, unsigned int RequestedParallelism, int Flags, const void *CodeptrRA) |
void | handleParallelEnd (ompt_data_t *ParallelData, ompt_data_t *EncounteringTaskData, int Flags, const void *CodeptrRA) |
void | handleDeviceInitialize (int DeviceNum, const char *Type, ompt_device_t *Device, ompt_function_lookup_t LookupFn, const char *DocumentationStr) |
void | handleDeviceFinalize (int DeviceNum) |
void | handleTarget (ompt_target_t Kind, ompt_scope_endpoint_t Endpoint, int DeviceNum, ompt_data_t *TaskData, ompt_id_t TargetId, const void *CodeptrRA) |
void | handleTargetEmi (ompt_target_t Kind, ompt_scope_endpoint_t Endpoint, int DeviceNum, ompt_data_t *TaskData, ompt_data_t *TargetTaskData, ompt_data_t *TargetData, const void *CodeptrRA) |
void | handleTargetSubmit (ompt_id_t TargetId, ompt_id_t HostOpId, unsigned int RequestedNumTeams) |
void | handleTargetSubmitEmi (ompt_scope_endpoint_t Endpoint, ompt_data_t *TargetData, ompt_id_t *HostOpId, unsigned int RequestedNumTeams) |
void | handleTargetDataOp (ompt_id_t TargetId, ompt_id_t HostOpId, ompt_target_data_op_t OpType, void *SrcAddr, int SrcDeviceNum, void *DstAddr, int DstDeviceNum, size_t Bytes, const void *CodeptrRA) |
void | handleTargetDataOpEmi (ompt_scope_endpoint_t Endpoint, ompt_data_t *TargetTaskData, ompt_data_t *TargetData, ompt_id_t *HostOpId, ompt_target_data_op_t OpType, void *SrcAddr, int SrcDeviceNum, void *DstAddr, int DstDeviceNum, size_t Bytes, const void *CodeptrRA) |
void | handleDeviceLoad (int DeviceNum, const char *Filename, int64_t OffsetInFile, void *VmaInFile, size_t Bytes, void *HostAddr, void *DeviceAddr, uint64_t ModuleId) |
void | handleDeviceUnload (int DeviceNum, uint64_t ModuleId) |
void | handleBufferRequest (int DeviceNum, ompt_buffer_t **Buffer, size_t *Bytes) |
void | handleBufferComplete (int DeviceNum, ompt_buffer_t *Buffer, size_t Bytes, ompt_buffer_cursor_t Begin, int BufferOwned) |
void | handleBufferRecord (ompt_record_ompt_t *Record) |
void | handleBufferRecordDeallocation (ompt_buffer_t *Buffer) |
void | handleWork (ompt_work_t WorkType, ompt_scope_endpoint_t Endpoint, ompt_data_t *ParallelData, ompt_data_t *TaskData, uint64_t Count, const void *CodeptrRA) |
Not needed for a conforming minimal OMPT implementation. | |
void | handleDispatch (ompt_data_t *ParallelData, ompt_data_t *TaskData, ompt_dispatch_t Kind, ompt_data_t Instance) |
void | handleSyncRegion (ompt_sync_region_t Kind, ompt_scope_endpoint_t Endpoint, ompt_data_t *ParallelData, ompt_data_t *TaskData, const void *CodeptrRA) |
Static Public Member Functions | |
static OmptCallbackHandler & | get () |
Singleton handler. |
Handler class to do whatever is needed to be done when a callback is invoked by the OMP runtime Supports a RecordAndReplay mechanism in which all OMPT events are recorded and then replayed.
This is so that a test can assert on, e.g., a device initialize event, even though this would occur before a unit test is actually executed.
Definition at line 32 of file OmptCallbackHandler.h.
|
default |
References Index().
void OmptCallbackHandler::clearSubscribers | ( | ) |
Remove all subscribers.
Definition at line 31 of file OmptCallbackHandler.cpp.
References replay().
Referenced by TestCase::exec(), testing::OmptTestCase::TearDown(), and testing::OmptTestCaseXFail::TearDown().
|
static |
Singleton handler.
Definition at line 20 of file OmptCallbackHandler.cpp.
References Handler.
Referenced by TestCase::exec(), ompt_initialize(), on_ompt_callback_buffer_complete(), on_ompt_callback_buffer_request(), on_ompt_callback_device_finalize(), on_ompt_callback_device_initialize(), on_ompt_callback_device_load(), on_ompt_callback_device_unload(), on_ompt_callback_dispatch(), on_ompt_callback_implicit_task(), on_ompt_callback_parallel_begin(), on_ompt_callback_parallel_end(), on_ompt_callback_sync_region(), on_ompt_callback_target(), on_ompt_callback_target_data_op(), on_ompt_callback_target_data_op_emi(), on_ompt_callback_target_emi(), on_ompt_callback_target_submit(), on_ompt_callback_target_submit_emi(), on_ompt_callback_task_create(), on_ompt_callback_task_schedule(), on_ompt_callback_thread_begin(), on_ompt_callback_thread_end(), on_ompt_callback_work(), testing::OmptTestCase::SetUp(), testing::OmptTestCase::TearDown(), and testing::OmptTestCaseXFail::TearDown().
void OmptCallbackHandler::handleAssertionSyncPoint | ( | const std::string & | SyncPointName | ) |
Special asserter callback which checks that upon encountering the synchronization point, all expected events have been processed.
That is: there are currently no remaining expected events for any asserter.
Definition at line 430 of file OmptCallbackHandler.cpp.
References omptest::OmptAssertEvent::AssertionSyncPoint(), omptest::Generated, and S.
void OmptCallbackHandler::handleBufferComplete | ( | int | DeviceNum, |
ompt_buffer_t * | Buffer, | ||
size_t | Bytes, | ||
ompt_buffer_cursor_t | Begin, | ||
int | BufferOwned ) |
Definition at line 334 of file OmptCallbackHandler.cpp.
References omptest::OmptAssertEvent::BufferComplete(), omptest::Generated, and S.
Referenced by on_ompt_callback_buffer_complete().
void OmptCallbackHandler::handleBufferRecord | ( | ompt_record_ompt_t * | Record | ) |
Definition at line 352 of file OmptCallbackHandler.cpp.
References omptest::OmptAssertEvent::BufferRecord(), omptest::Generated, and S.
Referenced by on_ompt_callback_buffer_complete().
void OmptCallbackHandler::handleBufferRecordDeallocation | ( | ompt_buffer_t * | Buffer | ) |
Definition at line 364 of file OmptCallbackHandler.cpp.
References omptest::OmptAssertEvent::BufferRecordDeallocation(), omptest::Generated, and S.
Referenced by on_ompt_callback_buffer_complete().
void OmptCallbackHandler::handleBufferRequest | ( | int | DeviceNum, |
ompt_buffer_t ** | Buffer, | ||
size_t * | Bytes ) |
Definition at line 318 of file OmptCallbackHandler.cpp.
References omptest::OmptAssertEvent::BufferRequest(), omptest::Generated, and S.
Referenced by on_ompt_callback_buffer_request().
Definition at line 168 of file OmptCallbackHandler.cpp.
References omptest::OmptAssertEvent::DeviceFinalize(), omptest::Generated, and S.
Referenced by on_ompt_callback_device_finalize().
void OmptCallbackHandler::handleDeviceInitialize | ( | int | DeviceNum, |
const char * | Type, | ||
ompt_device_t * | Device, | ||
ompt_function_lookup_t | LookupFn, | ||
const char * | DocumentationStr ) |
Definition at line 152 of file OmptCallbackHandler.cpp.
References omptest::OmptAssertEvent::DeviceInitialize(), omptest::Generated, and S.
Referenced by on_ompt_callback_device_initialize().
void OmptCallbackHandler::handleDeviceLoad | ( | int | DeviceNum, |
const char * | Filename, | ||
int64_t | OffsetInFile, | ||
void * | VmaInFile, | ||
size_t | Bytes, | ||
void * | HostAddr, | ||
void * | DeviceAddr, | ||
uint64_t | ModuleId ) |
Definition at line 288 of file OmptCallbackHandler.cpp.
References omptest::OmptAssertEvent::DeviceLoad(), omptest::Generated, and S.
Referenced by on_ompt_callback_device_load().
Definition at line 306 of file OmptCallbackHandler.cpp.
References omptest::OmptAssertEvent::DeviceUnload(), omptest::Generated, and S.
Referenced by on_ompt_callback_device_unload().
void OmptCallbackHandler::handleDispatch | ( | ompt_data_t * | ParallelData, |
ompt_data_t * | TaskData, | ||
ompt_dispatch_t | Kind, | ||
ompt_data_t | Instance ) |
Definition at line 413 of file OmptCallbackHandler.cpp.
References omptest::OmptAssertEvent::Dispatch(), omptest::Generated, and S.
Referenced by on_ompt_callback_dispatch().
void OmptCallbackHandler::handleImplicitTask | ( | ompt_scope_endpoint_t | Endpoint, |
ompt_data_t * | ParallelData, | ||
ompt_data_t * | TaskData, | ||
unsigned int | ActualParallelism, | ||
unsigned int | Index, | ||
int | Flags ) |
Definition at line 105 of file OmptCallbackHandler.cpp.
References omptest::Generated, omptest::OmptAssertEvent::ImplicitTask(), Index(), and S.
Referenced by on_ompt_callback_implicit_task().
void OmptCallbackHandler::handleParallelBegin | ( | ompt_data_t * | EncounteringTaskData, |
const ompt_frame_t * | EncounteringTaskFrame, | ||
ompt_data_t * | ParallelData, | ||
unsigned int | RequestedParallelism, | ||
int | Flags, | ||
const void * | CodeptrRA ) |
Definition at line 123 of file OmptCallbackHandler.cpp.
References omptest::Generated, omptest::OmptAssertEvent::ParallelBegin(), and S.
Referenced by on_ompt_callback_parallel_begin().
void OmptCallbackHandler::handleParallelEnd | ( | ompt_data_t * | ParallelData, |
ompt_data_t * | EncounteringTaskData, | ||
int | Flags, | ||
const void * | CodeptrRA ) |
Definition at line 138 of file OmptCallbackHandler.cpp.
References omptest::Generated, omptest::OmptAssertEvent::ParallelEnd(), and S.
Referenced by on_ompt_callback_parallel_end().
void OmptCallbackHandler::handleSyncRegion | ( | ompt_sync_region_t | Kind, |
ompt_scope_endpoint_t | Endpoint, | ||
ompt_data_t * | ParallelData, | ||
ompt_data_t * | TaskData, | ||
const void * | CodeptrRA ) |
Definition at line 395 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::SyncRegion().
Referenced by on_ompt_callback_sync_region().
void OmptCallbackHandler::handleTarget | ( | ompt_target_t | Kind, |
ompt_scope_endpoint_t | Endpoint, | ||
int | DeviceNum, | ||
ompt_data_t * | TaskData, | ||
ompt_id_t | TargetId, | ||
const void * | CodeptrRA ) |
Definition at line 180 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::Target().
Referenced by on_ompt_callback_target().
void OmptCallbackHandler::handleTargetDataOp | ( | ompt_id_t | TargetId, |
ompt_id_t | HostOpId, | ||
ompt_target_data_op_t | OpType, | ||
void * | SrcAddr, | ||
int | SrcDeviceNum, | ||
void * | DstAddr, | ||
int | DstDeviceNum, | ||
size_t | Bytes, | ||
const void * | CodeptrRA ) |
Definition at line 249 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::TargetDataOp().
Referenced by on_ompt_callback_target_data_op().
void OmptCallbackHandler::handleTargetDataOpEmi | ( | ompt_scope_endpoint_t | Endpoint, |
ompt_data_t * | TargetTaskData, | ||
ompt_data_t * | TargetData, | ||
ompt_id_t * | HostOpId, | ||
ompt_target_data_op_t | OpType, | ||
void * | SrcAddr, | ||
int | SrcDeviceNum, | ||
void * | DstAddr, | ||
int | DstDeviceNum, | ||
size_t | Bytes, | ||
const void * | CodeptrRA ) |
Definition at line 268 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::TargetDataOpEmi().
Referenced by on_ompt_callback_target_data_op_emi().
void OmptCallbackHandler::handleTargetEmi | ( | ompt_target_t | Kind, |
ompt_scope_endpoint_t | Endpoint, | ||
int | DeviceNum, | ||
ompt_data_t * | TaskData, | ||
ompt_data_t * | TargetTaskData, | ||
ompt_data_t * | TargetData, | ||
const void * | CodeptrRA ) |
Definition at line 198 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::TargetEmi().
Referenced by on_ompt_callback_target_emi().
void OmptCallbackHandler::handleTargetSubmit | ( | ompt_id_t | TargetId, |
ompt_id_t | HostOpId, | ||
unsigned int | RequestedNumTeams ) |
Definition at line 217 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::TargetSubmit().
Referenced by on_ompt_callback_target_submit().
void OmptCallbackHandler::handleTargetSubmitEmi | ( | ompt_scope_endpoint_t | Endpoint, |
ompt_data_t * | TargetData, | ||
ompt_id_t * | HostOpId, | ||
unsigned int | RequestedNumTeams ) |
Definition at line 233 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::TargetSubmitEmi().
Referenced by on_ompt_callback_target_submit_emi().
void OmptCallbackHandler::handleTaskCreate | ( | ompt_data_t * | EncounteringTaskData, |
const ompt_frame_t * | EncounteringTaskFrame, | ||
ompt_data_t * | NewTaskData, | ||
int | Flags, | ||
int | HasDependences, | ||
const void * | CodeptrRA ) |
Definition at line 74 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::TaskCreate().
Referenced by on_ompt_callback_task_create().
void OmptCallbackHandler::handleTaskSchedule | ( | ompt_data_t * | PriorTaskData, |
ompt_task_status_t | PriorTaskStatus, | ||
ompt_data_t * | NextTaskData ) |
Definition at line 91 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::TaskSchedule().
Referenced by on_ompt_callback_task_schedule().
void OmptCallbackHandler::handleThreadBegin | ( | ompt_thread_t | ThreadType, |
ompt_data_t * | ThreadData ) |
Definition at line 46 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::ThreadBegin().
Referenced by on_ompt_callback_thread_begin().
void OmptCallbackHandler::handleThreadEnd | ( | ompt_data_t * | ThreadData | ) |
Definition at line 62 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::ThreadEnd().
Referenced by on_ompt_callback_thread_end().
void OmptCallbackHandler::handleWork | ( | ompt_work_t | WorkType, |
ompt_scope_endpoint_t | Endpoint, | ||
ompt_data_t * | ParallelData, | ||
ompt_data_t * | TaskData, | ||
uint64_t | Count, | ||
const void * | CodeptrRA ) |
Not needed for a conforming minimal OMPT implementation.
Definition at line 377 of file OmptCallbackHandler.cpp.
References omptest::Generated, S, and omptest::OmptAssertEvent::Work().
Referenced by on_ompt_callback_work().
void OmptCallbackHandler::replay | ( | ) |
When the record and replay mechanism is enabled this replays all OMPT events.
Definition at line 37 of file OmptCallbackHandler.cpp.
References S.
Referenced by clearSubscribers().
void OmptCallbackHandler::subscribe | ( | OmptListener * | Listener | ) |
Subscribe a listener to be notified for OMPT events.
Definition at line 27 of file OmptCallbackHandler.cpp.
Referenced by TestCase::exec(), ompt_initialize(), and testing::OmptTestCase::SetUp().