Skip to content

Commit 28b40dd

Browse files
committed
Fixed bug in setting last command event.
1 parent fd2935b commit 28b40dd

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,29 +1325,28 @@ void _pi_queue::CaptureIndirectAccesses() {
13251325
pi_result _pi_queue::executeCommandList(pi_command_list_ptr_t CommandList,
13261326
bool IsBlocking,
13271327
bool OKToBatchCommand) {
1328+
bool UseCopyEngine = CommandList->second.isCopy(this);
1329+
1330+
// If the current LastCommandEvent is the nullptr, then it means
1331+
// either that no command has ever been issued to the queue
1332+
// or it means that the LastCommandEvent has been signalled and
1333+
// therefore that this Queue is idle.
1334+
//
1335+
// NOTE: this behavior adds some flakyness to the batching
1336+
// since last command's event may or may not be completed by the
1337+
// time we get here depending on timings and system/gpu load.
1338+
// So, disable it for modes where we print PI traces. Printing
1339+
// traces incurs much different timings than real execution
1340+
// ansyway, and many regression tests use it.
1341+
//
1342+
bool CurrentlyEmpty = !PrintPiTrace && this->LastCommandEvent == nullptr;
13281343

13291344
// The list can be empty if command-list only contains signals of proxy
13301345
// events.
13311346
if (!CommandList->second.EventList.empty())
13321347
this->LastCommandEvent = CommandList->second.EventList.back();
13331348

13341349
if (!UseImmediateCommandLists) {
1335-
bool UseCopyEngine = CommandList->second.isCopy(this);
1336-
1337-
// If the current LastCommandEvent is the nullptr, then it means
1338-
// either that no command has ever been issued to the queue
1339-
// or it means that the LastCommandEvent has been signalled and
1340-
// therefore that this Queue is idle.
1341-
//
1342-
// NOTE: this behavior adds some flakyness to the batching
1343-
// since last command's event may or may not be completed by the
1344-
// time we get here depending on timings and system/gpu load.
1345-
// So, disable it for modes where we print PI traces. Printing
1346-
// traces incurs much different timings than real execution
1347-
// anyway, and many regression tests use it.
1348-
//
1349-
bool CurrentlyEmpty = !PrintPiTrace && this->LastCommandEvent == nullptr;
1350-
13511350
// Batch if allowed to, but don't batch if we know there are no kernels
13521351
// from this queue that are currently executing. This is intended to get
13531352
// kernels started as soon as possible when there are no kernels from this

0 commit comments

Comments
 (0)