Skip to content

Commit 2d8d5e8

Browse files
committedMar 26, 2025
:Fix host task whole graph update bug
1 parent 8032832 commit 2d8d5e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎sycl/source/detail/graph_impl.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,14 @@ void exec_graph_impl::update(
13981398
this, Nodes, AllocaQueue, UpdateRequirements, MExecutionEvents);
13991399

14001400
MExecutionEvents.push_back(UpdateEvent);
1401+
1402+
// If the graph has HostTasks, the update has to be blocking. This is
1403+
// needed because HostTasks are scheduled using a separate thread
1404+
// which can execute at an arbitrary point in the program (e.g. after
1405+
// resources have been freed).
1406+
if (MContainsHostTask) {
1407+
UpdateEvent->wait(UpdateEvent);
1408+
}
14011409
} else {
14021410
// For each partition in the executable graph, call UR update on the
14031411
// command-buffer with the nodes to update.

0 commit comments

Comments
 (0)