File tree Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ event_impl::~event_impl() {
5454
5555void event_impl::waitInternal (bool *Success) {
5656 auto Handle = this ->getHandle ();
57- if (Handle) {
57+ if (!MIsHostEvent && Handle) {
5858 // Wait for the native event
5959 ur_result_t Err =
6060 getAdapter ()->call_nocheck <UrApiKind::urEventWait>(1 , &Handle);
@@ -92,7 +92,7 @@ void event_impl::waitInternal(bool *Success) {
9292}
9393
9494void event_impl::setComplete () {
95- if (!this ->getHandle ()) {
95+ if (MIsHostEvent || !this ->getHandle ()) {
9696 {
9797 std::unique_lock<std::mutex> lock (MMutex);
9898#ifndef NDEBUG
Original file line number Diff line number Diff line change @@ -469,17 +469,15 @@ void Scheduler::NotifyHostTaskCompletion(Command *Cmd) {
469469 ToCleanUp.push_back (Cmd);
470470 Cmd->MMarkedForCleanup = true ;
471471 }
472-
472+ {
473+ std::lock_guard<std::mutex> Guard (Cmd->MBlockedUsersMutex );
474+ // update self-event status
475+ CmdEvent->setComplete ();
476+ }
473477 if (auto NativeEvent = CmdEvent->getHandle ()) {
474478 QueueImpl->getAdapter ()->call <UrApiKind::urEventHostSignal>(NativeEvent);
475- } else {
476- {
477- std::lock_guard<std::mutex> Guard (Cmd->MBlockedUsersMutex );
478- // update self-event status
479- CmdEvent->setComplete ();
480- }
479+ } else
481480 Scheduler::enqueueUnblockedCommands (Cmd->MBlockedUsers , Lock, ToCleanUp);
482- }
483481 }
484482 QueueImpl->revisitUnenqueuedCommandsState (CmdEvent);
485483
Original file line number Diff line number Diff line change @@ -83,8 +83,7 @@ template <sycl::backend Backend> void InOrderQueueHostTaskDepsTestBody() {
8383 InOrderQueue.submit ([&](sycl::handler &CGH) { CGH.host_task ([=] {}); })
8484 .wait ();
8585 EXPECT_EQ (EventCreated, Backend == sycl::backend::ext_oneapi_level_zero);
86- EXPECT_EQ (GEventsWaitCounter,
87- 1u + size_t (Backend == sycl::backend::ext_oneapi_level_zero));
86+ EXPECT_EQ (GEventsWaitCounter, 1u );
8887 EXPECT_EQ (EventSignaled, Backend == sycl::backend::ext_oneapi_level_zero);
8988}
9089
You can’t perform that action at this time.
0 commit comments