Skip to content

Commit c67ce60

Browse files
fix 2nd hang
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
1 parent 6b61562 commit c67ce60

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

sycl/source/detail/event_impl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ const AdapterPtr &event_impl::getAdapter() {
138138
void event_impl::setStateIncomplete() { MState = HES_NotComplete; }
139139

140140
void event_impl::setContextImpl(const ContextImplPtr &Context) {
141+
MIsHostEvent = Context == nullptr;
141142
MContext = Context;
142143
}
143144

sycl/source/detail/scheduler/commands.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,9 @@ bool Command::enqueue(EnqueueResultT &EnqueueResult, BlockingT Blocking,
928928
EnqueueResultT(EnqueueResultT::SyclEnqueueFailed, this, Res);
929929
else {
930930
MEvent->setEnqueued();
931+
// Host task is protected by MShouldCompleteEventIfPossible = false
931932
if (MShouldCompleteEventIfPossible && !MEvent->isDiscarded() &&
932-
(MEvent->getHandle() == nullptr))
933+
(MEvent->isHost() || MEvent->getHandle() == nullptr))
933934
MEvent->setComplete();
934935

935936
// Consider the command is successfully enqueued if return code is

0 commit comments

Comments
 (0)