Skip to content

Commit 4c93ce2

Browse files
committed
[L0] Add UR_L0_OOQ_INTEGRATED_SIGNAL_EVENT to toggle event usage
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent c149951 commit 4c93ce2

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

source/adapters/level_zero/common.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,17 @@ static const uint32_t UrL0QueueSyncNonBlocking = [] {
241241
return L0QueueSyncLockingModeValue;
242242
}();
243243

244+
static const uint32_t UrL0OutOfOrderIntegratedSignalEvent = [] {
245+
const char *UrL0OutOfOrderIntegratedSignalEventEnv =
246+
std::getenv("UR_L0_OOQ_INTEGRATED_SIGNAL_EVENT");
247+
uint32_t UrL0OutOfOrderIntegratedSignalEventValue = 0;
248+
if (UrL0OutOfOrderIntegratedSignalEventEnv) {
249+
UrL0OutOfOrderIntegratedSignalEventValue =
250+
std::atoi(UrL0OutOfOrderIntegratedSignalEventEnv);
251+
}
252+
return UrL0OutOfOrderIntegratedSignalEventValue;
253+
}();
254+
244255
// This class encapsulates actions taken along with a call to Level Zero API.
245256
class ZeCall {
246257
private:

source/adapters/level_zero/context.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,8 @@ ur_result_t ur_context_handle_t_::getAvailableCommandList(
658658
if (Queue->hasOpenCommandList(UseCopyEngine)) {
659659
if (AllowBatching) {
660660
bool batchingAllowed = true;
661-
if (Queue->Device->isIntegrated()) {
661+
if (Queue->Device->isIntegrated() &&
662+
!UrL0OutOfOrderIntegratedSignalEvent) {
662663
batchingAllowed = eventCanBeBatched(Queue, UseCopyEngine,
663664
NumEventsInWaitList, EventWaitList);
664665
}

source/adapters/level_zero/queue.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,8 @@ ur_result_t setSignalEvent(ur_queue_handle_t Queue, bool UseCopyEngine,
17661766
if (Queue->Device->isIntegrated() &&
17671767
eventCanBeBatched(Queue, UseCopyEngine, NumEventsInWaitList,
17681768
EventWaitList) &&
1769-
!Queue->isInOrderQueue() && !Queue->UsingImmCmdLists) {
1769+
!Queue->isInOrderQueue() && !Queue->UsingImmCmdLists &&
1770+
!UrL0OutOfOrderIntegratedSignalEvent) {
17701771
ZeEvent = nullptr;
17711772
(*Event)->IsInnerBatchedEvent = true;
17721773
} else {

0 commit comments

Comments
 (0)