File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6445,7 +6445,11 @@ pi_result piEnqueueEventsWaitWithBarrier(pi_queue Queue,
6445
6445
// We use the same approach if
6446
6446
// SYCL_PI_LEVEL_ZERO_USE_MULTIPLE_COMMANDLIST_BARRIERS is not set to a
6447
6447
// positive value.
6448
- if (NumEventsInWaitList || !UseMultipleCmdlistBarriers) {
6448
+ // We use the same approach if we have in-order queue because every command
6449
+ // depends on previous one, so we don't need to insert barrier to multiple
6450
+ // command lists.
6451
+ if (NumEventsInWaitList || !UseMultipleCmdlistBarriers ||
6452
+ Queue->isInOrderQueue ()) {
6449
6453
// Retain the events as they will be owned by the result event.
6450
6454
_pi_ze_event_list_t TmpWaitList;
6451
6455
if (auto Res = TmpWaitList.createAndRetainPiZeEventList (
@@ -6468,7 +6472,9 @@ pi_result piEnqueueEventsWaitWithBarrier(pi_queue Queue,
6468
6472
if (auto Res = Queue->executeCommandList (CmdList, false , OkToBatch))
6469
6473
return Res;
6470
6474
6471
- if (UseMultipleCmdlistBarriers) {
6475
+ // Because of the dependency between commands in the in-order queue we don't
6476
+ // need to keep track of any active barriers if we have in-order queue.
6477
+ if (UseMultipleCmdlistBarriers && !Queue->isInOrderQueue ()) {
6472
6478
// Retain and save the resulting event for future commands.
6473
6479
(*Event)->RefCount .increment ();
6474
6480
Queue->ActiveBarriers .push_back (*Event);
You can’t perform that action at this time.
0 commit comments