Skip to content
Merged
Changes from 1 commit
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
12 changes: 8 additions & 4 deletions sycl/source/detail/queue_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,6 @@ queue_impl::submit_direct(bool CallerNeedsEvent,
detail::CG::StorageInitHelper CGData;
std::unique_lock<std::mutex> Lock(MMutex);

// Set the No Last Event Mode to false, since the no-handler path
// does not support it yet.
MNoLastEventMode.store(false, std::memory_order_relaxed);

// Used by queue_empty() and getLastEvent()
MEmpty.store(false, std::memory_order_release);

Expand Down Expand Up @@ -662,6 +658,14 @@ queue_impl::submit_direct(bool CallerNeedsEvent,
: true) &&
!hasCommandGraph();

// Synchronize with the "no last event mode", used by the handler-based
// kernel submit path
if (SchedulerBypass) {
MNoLastEventMode.store(true, std::memory_order_relaxed);
} else {
MNoLastEventMode.store(false, std::memory_order_relaxed);
}

EventImplPtr EventImpl = SubmitCommandFunc(CGData, SchedulerBypass);

// Sync with the last event for in order queue. For scheduler-bypass flow,
Expand Down