14#ifndef OPENMP_TOOLS_OMPTEST_INCLUDE_OMPTCALLBACKHANDLER_H
15#define OPENMP_TOOLS_OMPTEST_INCLUDE_OMPTCALLBACKHANDLER_H
59 const ompt_frame_t *EncounteringTaskFrame,
60 ompt_data_t *NewTaskData,
int Flags,
int HasDependences,
61 const void *CodeptrRA);
64 ompt_task_status_t PriorTaskStatus,
65 ompt_data_t *NextTaskData);
68 ompt_data_t *ParallelData, ompt_data_t *TaskData,
69 unsigned int ActualParallelism,
unsigned int Index,
73 const ompt_frame_t *EncounteringTaskFrame,
74 ompt_data_t *ParallelData,
75 unsigned int RequestedParallelism,
int Flags,
76 const void *CodeptrRA);
79 ompt_data_t *EncounteringTaskData,
int Flags,
80 const void *CodeptrRA);
83 ompt_device_t *Device,
84 ompt_function_lookup_t LookupFn,
85 const char *DocumentationStr);
89 void handleTarget(ompt_target_t Kind, ompt_scope_endpoint_t Endpoint,
90 int DeviceNum, ompt_data_t *TaskData, ompt_id_t TargetId,
91 const void *CodeptrRA);
93 void handleTargetEmi(ompt_target_t Kind, ompt_scope_endpoint_t Endpoint,
94 int DeviceNum, ompt_data_t *TaskData,
95 ompt_data_t *TargetTaskData, ompt_data_t *TargetData,
96 const void *CodeptrRA);
99 unsigned int RequestedNumTeams);
102 ompt_data_t *TargetData, ompt_id_t *HostOpId,
103 unsigned int RequestedNumTeams);
106 ompt_target_data_op_t OpType,
void *SrcAddr,
107 int SrcDeviceNum,
void *DstAddr,
int DstDeviceNum,
108 size_t Bytes,
const void *CodeptrRA);
111 ompt_data_t *TargetTaskData,
112 ompt_data_t *TargetData, ompt_id_t *HostOpId,
113 ompt_target_data_op_t OpType,
void *SrcAddr,
114 int SrcDeviceNum,
void *DstAddr,
int DstDeviceNum,
115 size_t Bytes,
const void *CodeptrRA);
118 int64_t OffsetInFile,
void *VmaInFile,
size_t Bytes,
119 void *HostAddr,
void *DeviceAddr, uint64_t ModuleId);
127 ompt_buffer_cursor_t Begin,
int BufferOwned);
134 void handleWork(ompt_work_t WorkType, ompt_scope_endpoint_t Endpoint,
135 ompt_data_t *ParallelData, ompt_data_t *TaskData,
136 uint64_t Count,
const void *CodeptrRA);
138 void handleDispatch(ompt_data_t *ParallelData, ompt_data_t *TaskData,
139 ompt_dispatch_t Kind, ompt_data_t Instance);
141 void handleSyncRegion(ompt_sync_region_t Kind, ompt_scope_endpoint_t Endpoint,
142 ompt_data_t *ParallelData, ompt_data_t *TaskData,
143 const void *CodeptrRA);
151 std::vector<OmptListener *> Subscribers;
154 bool RecordAndReplay{
false};
157 std::vector<OmptAssertEvent> RecordedEvents;
Contains assertion event constructors, for generally all observable events.
Contains all asserter-related class declarations and important enums.
omptest::OmptCallbackHandler * Handler
Handler class to do whatever is needed to be done when a callback is invoked by the OMP runtime Suppo...
void handleAssertionSyncPoint(const std::string &SyncPointName)
Special asserter callback which checks that upon encountering the synchronization point,...
void handleImplicitTask(ompt_scope_endpoint_t Endpoint, ompt_data_t *ParallelData, ompt_data_t *TaskData, unsigned int ActualParallelism, unsigned int Index, int Flags)
void handleDeviceFinalize(int DeviceNum)
void replay()
When the record and replay mechanism is enabled this replays all OMPT events.
void handleTaskCreate(ompt_data_t *EncounteringTaskData, const ompt_frame_t *EncounteringTaskFrame, ompt_data_t *NewTaskData, int Flags, int HasDependences, const void *CodeptrRA)
void handleTargetSubmitEmi(ompt_scope_endpoint_t Endpoint, ompt_data_t *TargetData, ompt_id_t *HostOpId, unsigned int RequestedNumTeams)
void handleThreadEnd(ompt_data_t *ThreadData)
void subscribe(OmptListener *Listener)
Subscribe a listener to be notified for OMPT events.
void handleBufferComplete(int DeviceNum, ompt_buffer_t *Buffer, size_t Bytes, ompt_buffer_cursor_t Begin, int BufferOwned)
void handleDeviceUnload(int DeviceNum, uint64_t ModuleId)
void handleTargetSubmit(ompt_id_t TargetId, ompt_id_t HostOpId, unsigned int RequestedNumTeams)
void handleSyncRegion(ompt_sync_region_t Kind, ompt_scope_endpoint_t Endpoint, ompt_data_t *ParallelData, ompt_data_t *TaskData, const void *CodeptrRA)
void clearSubscribers()
Remove all subscribers.
void handleThreadBegin(ompt_thread_t ThreadType, ompt_data_t *ThreadData)
void handleDispatch(ompt_data_t *ParallelData, ompt_data_t *TaskData, ompt_dispatch_t Kind, ompt_data_t Instance)
~OmptCallbackHandler()=default
void handleBufferRecord(ompt_record_ompt_t *Record)
void handleTaskSchedule(ompt_data_t *PriorTaskData, ompt_task_status_t PriorTaskStatus, ompt_data_t *NextTaskData)
void handleBufferRequest(int DeviceNum, ompt_buffer_t **Buffer, size_t *Bytes)
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 handleBufferRecordDeallocation(ompt_buffer_t *Buffer)
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 handleParallelEnd(ompt_data_t *ParallelData, ompt_data_t *EncounteringTaskData, int Flags, 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 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 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 handleDeviceInitialize(int DeviceNum, const char *Type, ompt_device_t *Device, ompt_function_lookup_t LookupFn, const char *DocumentationStr)
void handleParallelBegin(ompt_data_t *EncounteringTaskData, const ompt_frame_t *EncounteringTaskFrame, ompt_data_t *ParallelData, unsigned int RequestedParallelism, int Flags, const void *CodeptrRA)
static OmptCallbackHandler & get()
Singleton handler.
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.
General base class for the subscriber/notification pattern in OmptCallbackHandler.
unsigned * Index(unsigned *p, unsigned i, unsigned j, unsigned bound2)
Assertion event struct, provides statically callable CTORs.