21 #include <condition_variable>
34 using EventImplPtr = std::shared_ptr<sycl::detail::event_impl>;
49 event_impl(std::optional<HostEventState> State = HES_Complete)
50 : MIsInitialized(false), MHostEvent(State), MIsFlushed(true),
51 MState(State.value_or(HES_Complete)) {}
76 void wait(std::shared_ptr<sycl::detail::event_impl> Self);
86 void wait_and_throw(std::shared_ptr<sycl::detail::event_impl> Self);
99 template <
typename Param>
typename Param::return_type get_profiling_info();
104 template <
typename Param>
typename Param::return_type get_info();
143 void setStateIncomplete();
173 return MPreparedDepsEvents;
180 return MPreparedHostDepsEvents;
186 std::vector<EventImplPtr> getWaitList();
194 void cleanupDependencyEvents();
197 void cleanDepEventsThroughOneLevel();
214 MWorkerQueue = WorkerQueue;
221 MSubmittedQueue = SubmittedQueue;
226 void setSubmissionTime();
229 uint64_t getSubmissionTime();
248 std::lock_guard<std::mutex> Lock(MMutex);
249 MPostCompleteEvents.push_back(Event);
255 ensureContextInitialized();
262 void *instrumentationProlog(std::string &Name, int32_t StreamID,
263 uint64_t &instance_id)
const;
265 void instrumentationEpilog(
void *TelementryEvent,
const std::string &Name,
266 int32_t StreamID, uint64_t IId)
const;
267 void checkProfilingPreconditions()
const;
270 void ensureContextInitialized();
271 bool MIsInitialized =
true;
272 bool MIsContextInitialized =
false;
275 uint64_t MSubmitTime = 0;
277 bool MHostEvent =
true;
279 void *MCommand =
nullptr;
281 const bool MIsProfilingEnabled =
false;
282 const bool MLimitedProfiling =
false;
295 std::atomic<bool> MIsFlushed =
false;
303 std::condition_variable
cv;
305 friend std::vector<RT::PiEvent>
307 std::shared_ptr<sycl::detail::context_impl> Context);