Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sycl/source/detail/event_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ event_impl::event_impl(const QueueImplPtr &Queue)
}

void event_impl::setQueue(queue_impl &Queue) {
MQueue = Queue.shared_from_this();
MQueue = Queue.weak_from_this();
MIsProfilingEnabled = Queue.MIsProfilingEnabled;

// TODO After setting the queue, the event is no longer default
Expand All @@ -202,9 +202,9 @@ void event_impl::setQueue(queue_impl &Queue) {
}

void event_impl::setSubmittedQueue(std::weak_ptr<queue_impl> SubmittedQueue) {
MSubmittedQueue = SubmittedQueue;
MSubmittedQueue = std::move(SubmittedQueue);
if (MHostProfilingInfo) {
if (auto QueuePtr = SubmittedQueue.lock()) {
if (auto QueuePtr = MSubmittedQueue.lock()) {
device_impl &Device = QueuePtr->getDeviceImpl();
MHostProfilingInfo->setDevice(&Device);
}
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/event_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class event_impl {
///
/// @return
void setWorkerQueue(std::weak_ptr<queue_impl> WorkerQueue) {
MWorkerQueue = WorkerQueue;
MWorkerQueue = std::move(WorkerQueue);
};

/// Sets original queue used for submission.
Expand Down