diff --git a/sycl/source/detail/event_impl.cpp b/sycl/source/detail/event_impl.cpp index 313ef01472d98..0f67b3238f35c 100644 --- a/sycl/source/detail/event_impl.cpp +++ b/sycl/source/detail/event_impl.cpp @@ -119,7 +119,7 @@ event_impl::event_impl(RT::PiEvent Event, const context &SyclContext) getPlugin().call(MEvent); } -event_impl::event_impl(QueueImplPtr Queue) : MQueue(Queue) { +event_impl::event_impl(QueueImplPtr Queue) { if (Queue->is_host()) { MState.store(HES_NotComplete); @@ -217,9 +217,9 @@ void event_impl::wait_and_throw( if (Cmd) Cmd->getQueue()->throw_asynchronous(); } - QueueImplPtr Queue = MQueue.lock(); - if (Queue) - Queue->throw_asynchronous(); + Command *Cmd = (Command *)getCommand(); + if (Cmd) + Cmd->getQueue()->throw_asynchronous(); } template <> diff --git a/sycl/source/detail/event_impl.hpp b/sycl/source/detail/event_impl.hpp index 88e9233b58e6c..4b291159c8e4f 100644 --- a/sycl/source/detail/event_impl.hpp +++ b/sycl/source/detail/event_impl.hpp @@ -26,7 +26,6 @@ class context_impl; using ContextImplPtr = std::shared_ptr; class queue_impl; using QueueImplPtr = std::shared_ptr; -using QueueImplWPtr = std::weak_ptr; class event_impl { public: @@ -166,7 +165,6 @@ class event_impl { RT::PiEvent MEvent = nullptr; ContextImplPtr MContext; - QueueImplWPtr MQueue; bool MOpenCLInterop = false; bool MHostEvent = true; std::unique_ptr MHostProfilingInfo;