Skip to content

Commit 9b984e3

Browse files
committed
[SYCL][Graph] Wait for deps when adding commands to a command graph
- Commands which enqueue to a command graph now correctly respect their dependencies by waiting on them. - Prevents issues where allocation commands with dependent copies could be delayed due to device being busy and execute in an incorrect order with regards to future command graph executions.
1 parent d25c153 commit 9b984e3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sycl/source/detail/scheduler/commands.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,6 +2627,11 @@ pi_int32 ExecCGCommand::enqueueImpCommandBuffer() {
26272627
auto RawEvents = getPiEvents(EventImpls);
26282628
flushCrossQueueDeps(EventImpls, getWorkerQueue());
26292629

2630+
// Any non-allocation dependencies need to be waited on here since subsequent
2631+
// submissions of the command buffer itself will not receive dependencies on
2632+
// them, e.g. initial copies from host to device
2633+
waitForEvents(MQueue, MPreparedDepsEvents, MEvent->getHandleRef());
2634+
26302635
sycl::detail::pi::PiEvent *Event =
26312636
(MQueue->has_discard_events_support() &&
26322637
MCommandGroup->getRequirements().size() == 0)

0 commit comments

Comments
 (0)