@@ -218,7 +218,7 @@ void event_impl::setQueue(queue_impl &Queue) {
218218void event_impl::setSubmittedQueue (std::weak_ptr<queue_impl> SubmittedQueue) {
219219 MSubmittedQueue = std::move (SubmittedQueue);
220220 if (MHostProfilingInfo) {
221- if (auto QueuePtr = MSubmittedQueue.lock ()) {
221+ if (std::shared_ptr<queue_impl> QueuePtr = MSubmittedQueue.lock ()) {
222222 device_impl &Device = QueuePtr->getDeviceImpl ();
223223 MHostProfilingInfo->setDevice (&Device);
224224 }
@@ -251,7 +251,7 @@ void *event_impl::instrumentationProlog(std::string &Name, int32_t StreamID,
251251 // queue is available with the wait events. We check to see if the
252252 // TraceEvent is available in the Queue object.
253253 void *TraceEvent = nullptr ;
254- if (QueueImplPtr Queue = MQueue.lock ()) {
254+ if (std::shared_ptr<queue_impl> Queue = MQueue.lock ()) {
255255 TraceEvent = Queue->getTraceEvent ();
256256 WaitEvent =
257257 (TraceEvent ? static_cast <xpti_td *>(TraceEvent) : GSYCLGraphEvent);
@@ -320,7 +320,7 @@ void event_impl::wait_and_throw(
320320 std::shared_ptr<sycl::detail::event_impl> Self) {
321321 wait (Self);
322322
323- if (QueueImplPtr SubmittedQueue = MSubmittedQueue.lock ())
323+ if (std::shared_ptr<queue_impl> SubmittedQueue = MSubmittedQueue.lock ())
324324 SubmittedQueue->throw_asynchronous ();
325325}
326326
@@ -465,7 +465,7 @@ event_impl::get_backend_info<info::platform::version>() const {
465465 " the info::platform::version info descriptor can "
466466 " only be queried with an OpenCL backend" );
467467 }
468- if (QueueImplPtr Queue = MQueue.lock ()) {
468+ if (std::shared_ptr<queue_impl> Queue = MQueue.lock ()) {
469469 return Queue->getDeviceImpl ()
470470 .get_platform ()
471471 .get_info <info::platform::version>();
@@ -488,7 +488,7 @@ event_impl::get_backend_info<info::device::version>() const {
488488 " the info::device::version info descriptor can only "
489489 " be queried with an OpenCL backend" );
490490 }
491- if (QueueImplPtr Queue = MQueue.lock ()) {
491+ if (std::shared_ptr<queue_impl> Queue = MQueue.lock ()) {
492492 return Queue->getDeviceImpl ().get_info <info::device::version>();
493493 }
494494 return " " ; // If the queue has been released, no device will be associated so
@@ -555,21 +555,21 @@ std::vector<EventImplPtr> event_impl::getWaitList() {
555555 return Result;
556556}
557557
558- void event_impl::flushIfNeeded (const QueueImplPtr & UserQueue) {
558+ void event_impl::flushIfNeeded (queue_impl * UserQueue) {
559559 // Some events might not have a native handle underneath even at this point,
560560 // e.g. those produced by memset with 0 size (no UR call is made).
561561 auto Handle = this ->getHandle ();
562562 if (MIsFlushed || !Handle)
563563 return ;
564564
565- QueueImplPtr Queue = MQueue.lock ();
565+ std::shared_ptr<queue_impl> Queue = MQueue.lock ();
566566 // If the queue has been released, all of the commands have already been
567567 // implicitly flushed by urQueueRelease.
568568 if (!Queue) {
569569 MIsFlushed = true ;
570570 return ;
571571 }
572- if (Queue == UserQueue)
572+ if (Queue. get () == UserQueue)
573573 return ;
574574
575575 // Check if the task for this event has already been submitted.
@@ -607,9 +607,9 @@ void event_impl::setSubmissionTime() {
607607 if (!MIsProfilingEnabled && !MProfilingTagEvent)
608608 return ;
609609
610- std::weak_ptr <queue_impl> Queue = isHost () ? MSubmittedQueue : MQueue;
611- if (QueueImplPtr QueuePtr = Queue .lock ()) {
612- device_impl &Device = QueuePtr ->getDeviceImpl ();
610+ if ( std::shared_ptr <queue_impl> Queue =
611+ isHost () ? MSubmittedQueue. lock () : MQueue .lock ()) {
612+ device_impl &Device = Queue ->getDeviceImpl ();
613613 MSubmitTime = getTimestamp (&Device);
614614 }
615615}
0 commit comments