Skip to content

Commit b83b7d3

Browse files
author
Ivan Karachun
committed
[SYCL] Eliminated events dependency on queue.
This patch removes events dependency on queue according to suggestions from #1226. Signed-off-by: Ivan Karachun <[email protected]>
1 parent 2c50c03 commit b83b7d3

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

sycl/source/detail/event_impl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ event_impl::event_impl(RT::PiEvent Event, const context &SyclContext)
119119
getPlugin().call<PiApiKind::piEventRetain>(MEvent);
120120
}
121121

122-
event_impl::event_impl(QueueImplPtr Queue) : MQueue(Queue) {
122+
event_impl::event_impl(QueueImplPtr Queue) {
123123
if (Queue->is_host()) {
124124
MState.store(HES_NotComplete);
125125

@@ -217,9 +217,9 @@ void event_impl::wait_and_throw(
217217
if (Cmd)
218218
Cmd->getQueue()->throw_asynchronous();
219219
}
220-
QueueImplPtr Queue = MQueue.lock();
221-
if (Queue)
222-
Queue->throw_asynchronous();
220+
Command *Cmd = (Command *)getCommand();
221+
if (Cmd)
222+
Cmd->getQueue()->throw_asynchronous();
223223
}
224224

225225
template <>

sycl/source/detail/event_impl.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class context_impl;
2626
using ContextImplPtr = std::shared_ptr<cl::sycl::detail::context_impl>;
2727
class queue_impl;
2828
using QueueImplPtr = std::shared_ptr<cl::sycl::detail::queue_impl>;
29-
using QueueImplWPtr = std::weak_ptr<cl::sycl::detail::queue_impl>;
3029

3130
class event_impl {
3231
public:
@@ -166,7 +165,6 @@ class event_impl {
166165

167166
RT::PiEvent MEvent = nullptr;
168167
ContextImplPtr MContext;
169-
QueueImplWPtr MQueue;
170168
bool MOpenCLInterop = false;
171169
bool MHostEvent = true;
172170
std::unique_ptr<HostProfilingInfo> MHostProfilingInfo;

0 commit comments

Comments
 (0)