@@ -1325,29 +1325,28 @@ void _pi_queue::CaptureIndirectAccesses() {
1325
1325
pi_result _pi_queue::executeCommandList (pi_command_list_ptr_t CommandList,
1326
1326
bool IsBlocking,
1327
1327
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 ;
1328
1343
1329
1344
// The list can be empty if command-list only contains signals of proxy
1330
1345
// events.
1331
1346
if (!CommandList->second .EventList .empty ())
1332
1347
this ->LastCommandEvent = CommandList->second .EventList .back ();
1333
1348
1334
1349
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
-
1351
1350
// Batch if allowed to, but don't batch if we know there are no kernels
1352
1351
// from this queue that are currently executing. This is intended to get
1353
1352
// kernels started as soon as possible when there are no kernels from this
0 commit comments