Skip to content

Commit 5a82065

Browse files
Fix event status handling 2
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
1 parent b04d724 commit 5a82065

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

sycl/source/detail/event_impl.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,18 @@ event_impl::get_info<info::event::command_execution_status>() const {
322322
if (MState == HES_Discarded)
323323
return info::event_command_status::ext_oneapi_unknown;
324324

325-
if (!MHostEvent && MEvent) {
326-
return get_event_info<info::event::command_execution_status>::get(
327-
this->getHandleRef(), this->getPlugin());
325+
if (!MHostEvent) {
326+
// Command is enqueued and PiEvent is ready
327+
if (MEvent)
328+
return get_event_info<info::event::command_execution_status>::get(
329+
this->getHandleRef(), this->getPlugin());
330+
// Command is blocked and not enqueued, PiEvent is not assigned yet
331+
else if (MCommand)
332+
return sycl::info::event_command_status::submitted;
328333
}
329-
if (MHostEvent && MState.load() == HES_Complete)
330-
return info::event_command_status::complete;
331-
332-
return sycl::info::event_command_status::submitted;
334+
return MHostEvent && MState.load() != HES_Complete
335+
? sycl::info::event_command_status::submitted
336+
: info::event_command_status::complete;
333337
}
334338

335339
static uint64_t getTimestamp() {

sycl/unittests/scheduler/EnqueueWithDependsOnDeps.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ TEST_F(SchedulerTest, EnqueueNoMemObjTwoHostTasks) {
104104
std::cout << "Not run due to host-only environment\n";
105105
return;
106106
}
107-
unittest::PiMock Mock{Plt};
108-
setupDefaultMockAPIs(Mock);
109107

110108
queue QueueDev(context(Plt), Selector);
111109
MockScheduler MS;

0 commit comments

Comments
 (0)