Skip to content

Commit c0d9bf5

Browse files
auto -> std::shared_ptr<queue_impl>
1 parent 76dd39e commit c0d9bf5

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

sycl/source/detail/event_impl.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ void event_impl::setQueue(queue_impl &Queue) {
215215
void event_impl::setSubmittedQueue(std::weak_ptr<queue_impl> SubmittedQueue) {
216216
MSubmittedQueue = std::move(SubmittedQueue);
217217
if (MHostProfilingInfo) {
218-
if (auto QueuePtr = MSubmittedQueue.lock()) {
218+
if (std::shared_ptr<queue_impl> QueuePtr = MSubmittedQueue.lock()) {
219219
device_impl &Device = QueuePtr->getDeviceImpl();
220220
MHostProfilingInfo->setDevice(&Device);
221221
}
@@ -248,7 +248,7 @@ void *event_impl::instrumentationProlog(std::string &Name, int32_t StreamID,
248248
// queue is available with the wait events. We check to see if the
249249
// TraceEvent is available in the Queue object.
250250
void *TraceEvent = nullptr;
251-
if (auto Queue = MQueue.lock()) {
251+
if (std::shared_ptr<queue_impl> Queue = MQueue.lock()) {
252252
TraceEvent = Queue->getTraceEvent();
253253
WaitEvent =
254254
(TraceEvent ? static_cast<xpti_td *>(TraceEvent) : GSYCLGraphEvent);
@@ -317,7 +317,7 @@ void event_impl::wait_and_throw(
317317
std::shared_ptr<sycl::detail::event_impl> Self) {
318318
wait(Self);
319319

320-
if (auto SubmittedQueue = MSubmittedQueue.lock())
320+
if (std::shared_ptr<queue_impl> SubmittedQueue = MSubmittedQueue.lock())
321321
SubmittedQueue->throw_asynchronous();
322322
}
323323

@@ -462,7 +462,7 @@ event_impl::get_backend_info<info::platform::version>() const {
462462
"the info::platform::version info descriptor can "
463463
"only be queried with an OpenCL backend");
464464
}
465-
if (auto Queue = MQueue.lock()) {
465+
if (std::shared_ptr<queue_impl> Queue = MQueue.lock()) {
466466
return Queue->getDeviceImpl()
467467
.get_platform()
468468
.get_info<info::platform::version>();
@@ -485,7 +485,7 @@ event_impl::get_backend_info<info::device::version>() const {
485485
"the info::device::version info descriptor can only "
486486
"be queried with an OpenCL backend");
487487
}
488-
if (auto Queue = MQueue.lock()) {
488+
if (std::shared_ptr<queue_impl> Queue = MQueue.lock()) {
489489
return Queue->getDeviceImpl().get_info<info::device::version>();
490490
}
491491
return ""; // If the queue has been released, no device will be associated so
@@ -604,7 +604,8 @@ void event_impl::setSubmissionTime() {
604604
if (!MIsProfilingEnabled && !MProfilingTagEvent)
605605
return;
606606

607-
if (auto Queue = isHost() ? MSubmittedQueue.lock() : MQueue.lock()) {
607+
if (std::shared_ptr<queue_impl> Queue =
608+
isHost() ? MSubmittedQueue.lock() : MQueue.lock()) {
608609
device_impl &Device = Queue->getDeviceImpl();
609610
MSubmitTime = getTimestamp(&Device);
610611
}

sycl/source/detail/graph_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ void graph_impl::removeQueue(sycl::detail::queue_impl &RecordingQueue) {
674674
bool graph_impl::clearQueues() {
675675
bool AnyQueuesCleared = false;
676676
for (auto &Queue : MRecordingQueues) {
677-
if (auto ValidQueue = Queue.lock(); ValidQueue) {
677+
if (std::shared_ptr<queue_impl> ValidQueue = Queue.lock(); ValidQueue) {
678678
ValidQueue->setCommandGraph(nullptr);
679679
AnyQueuesCleared = true;
680680
}

0 commit comments

Comments
 (0)