Skip to content

Commit bab6766

Browse files
slawekptakldorau
authored andcommitted
[SYCL] Select the proper dependency tracking for graphs
This change makes the handler-less path select the proper dependency tracking struct instance, depending on whether the queue is associated with a graph.
1 parent df2739c commit bab6766

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sycl/source/detail/queue_impl.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,10 @@ queue_impl::submit_direct(bool CallerNeedsEvent,
638638
CGData.MEvents.push_back(getSyclObjImpl(*ExternalEvent));
639639
}
640640

641+
auto &Deps = hasCommandGraph() ? MExtGraphDeps : MDefaultGraphDeps;
642+
641643
// Sync with the last event for in order queue
642-
EventImplPtr &LastEvent = MDefaultGraphDeps.LastEventPtr;
644+
EventImplPtr &LastEvent = Deps.LastEventPtr;
643645
if (isInOrder() && LastEvent) {
644646
CGData.MEvents.push_back(LastEvent);
645647
}
@@ -653,9 +655,8 @@ queue_impl::submit_direct(bool CallerNeedsEvent,
653655
MissedCleanupRequests.clear();
654656
});
655657

656-
if (MDefaultGraphDeps.LastBarrier &&
657-
!MDefaultGraphDeps.LastBarrier->isEnqueued()) {
658-
CGData.MEvents.push_back(MDefaultGraphDeps.LastBarrier);
658+
if (Deps.LastBarrier && !Deps.LastBarrier->isEnqueued()) {
659+
CGData.MEvents.push_back(Deps.LastBarrier);
659660
}
660661
}
661662

@@ -683,7 +684,7 @@ queue_impl::submit_direct(bool CallerNeedsEvent,
683684

684685
// Barrier and un-enqueued commands synchronization for out or order queue
685686
if (!isInOrder() && !EventImpl->isEnqueued()) {
686-
MDefaultGraphDeps.UnenqueuedCmdEvents.push_back(EventImpl);
687+
Deps.UnenqueuedCmdEvents.push_back(EventImpl);
687688
}
688689

689690
return CallerNeedsEvent ? EventImpl : nullptr;

0 commit comments

Comments
 (0)