Skip to content

Commit 74bf195

Browse files
[SYCL] Fix host vs kernel commands enqueue in case of in order queue (#8438)
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
1 parent a0ce2c6 commit 74bf195

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sycl/source/detail/scheduler/graph_processor.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ bool Scheduler::GraphProcessor::handleBlockingCmd(Command *Cmd,
5353
BlockingT Blocking) {
5454
if (Cmd == RootCommand || Blocking)
5555
return true;
56+
// Async kernel enqueue depending on host task is not compatible with in order
57+
// queue. If we have host_task_1, kernel_2 depending on host_task_1 and
58+
// kernel_3 without explicit dependencies submitted to in order queue: host
59+
// task blocks kernel_2 from being enqueued while kernel_3 has no such
60+
// dependencies so in current impl it could be enqueued earlier that kernel_2.
61+
// That makes it impossible to use this path with blocking users for in order
62+
// queue.
63+
if (QueueImplPtr Queue = RootCommand->getEvent()->getSubmittedQueue();
64+
Queue && Queue->isInOrder())
65+
return true;
5666
{
5767
std::lock_guard<std::mutex> Guard(Cmd->MBlockedUsersMutex);
5868
if (Cmd->isBlocking()) {

0 commit comments

Comments
 (0)