Skip to content

Commit f782c2a

Browse files
[SYCL] Temporarily restore event deps in in-order queues for Level Zero (#3188)
Some of the enqueued operations are implemented directly in the Level Zero plugin (e.g. map/unmap) and their implementation does not satisfy in-order queue requirements, leading to incorrect behaviour if the event dependencies that should be redundant are dropped. Restore these event dependencies until this is fixed in the Level Zero plugin.
1 parent 42491dd commit f782c2a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

sycl/source/detail/scheduler/commands.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,14 @@ void Command::processDepEvent(EventImplPtr DepEvent, const DepDesc &Dep) {
496496
}
497497

498498
// Do not add redundant event dependencies for in-order queues.
499-
if (Dep.MDepCommand && Dep.MDepCommand->getWorkerQueue() == WorkerQueue &&
500-
WorkerQueue->has_property<property::queue::in_order>())
501-
return;
499+
// TODO temporarily disabled with Level Zero since the enqueued operations
500+
// that are implemented directly in the plugin (e.g. map/unmap) do not satisfy
501+
// in-order queue requirements.
502+
if (WorkerQueue->is_host() ||
503+
WorkerQueue->getPlugin().getBackend() != backend::level_zero)
504+
if (Dep.MDepCommand && Dep.MDepCommand->getWorkerQueue() == WorkerQueue &&
505+
WorkerQueue->has_property<property::queue::in_order>())
506+
return;
502507

503508
ContextImplPtr DepEventContext = DepEvent->getContextImpl();
504509
// If contexts don't match we'll connect them using host task

sycl/unittests/scheduler/InOrderQueueDeps.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ TEST_F(SchedulerTest, InOrderQueueDeps) {
8383
std::cout << "Not run due to host-only environment\n";
8484
return;
8585
}
86+
if (detail::getSyclObjImpl(Plt)->getPlugin().getBackend() ==
87+
backend::level_zero) {
88+
std::cout << "Removal of redundant dependencies in in-order queues is "
89+
"disabled for Level Zero until it is supported by the plugin"
90+
<< std::endl;
91+
return;
92+
}
8693

8794
unittest::PiMock Mock{Plt};
8895
Mock.redefine<detail::PiApiKind::piMemBufferCreate>(redefinedMemBufferCreate);

0 commit comments

Comments
 (0)