Skip to content

Commit 0349712

Browse files
committed
[SYCL] "No last event mode" support for handler-less kernel submission
The handler-based kernel submission uses a "no last event mode" atomic variable to mark, if the last event is recorded for the in order queue. The handler-less submission needs to update that variable, in order to support mixed APIs usage (handler-based and handler-less APIs, which might require synchronization).
1 parent 3ffcfda commit 0349712

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sycl/source/detail/queue_impl.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,6 @@ queue_impl::submit_direct(bool CallerNeedsEvent,
621621
detail::CG::StorageInitHelper CGData;
622622
std::unique_lock<std::mutex> Lock(MMutex);
623623

624-
// Set the No Last Event Mode to false, since the no-handler path
625-
// does not support it yet.
626-
MNoLastEventMode.store(false, std::memory_order_relaxed);
627-
628624
// Used by queue_empty() and getLastEvent()
629625
MEmpty.store(false, std::memory_order_release);
630626

@@ -662,6 +658,14 @@ queue_impl::submit_direct(bool CallerNeedsEvent,
662658
: true) &&
663659
!hasCommandGraph();
664660

661+
// Synchronize with the "no last event mode", used by the handler-based
662+
// kernel submit path
663+
if (SchedulerBypass) {
664+
MNoLastEventMode.store(true, std::memory_order_relaxed);
665+
} else {
666+
MNoLastEventMode.store(false, std::memory_order_relaxed);
667+
}
668+
665669
EventImplPtr EventImpl = SubmitCommandFunc(CGData, SchedulerBypass);
666670

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

0 commit comments

Comments
 (0)