Skip to content

Commit 6c137f8

Browse files
[SYCL] Apply Level Zero batching workaround more selectively (#4304)
The original version of the workaround was applied too broadly, which was harmful to perfromance of some use-cases. Add a check that completely replicates the old behavior on Level Zero.
1 parent c99da40 commit 6c137f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sycl/source/detail/scheduler/commands.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,8 @@ bool UnMapMemObject::producesPiEvent() const {
11061106
// an event waitlist and Level Zero plugin attempts to batch these commands,
11071107
// so the execution of kernel B starts only on step 4. This workaround
11081108
// restores the old behavior in this case until this is resolved.
1109-
return MQueue->getPlugin().getBackend() != backend::level_zero;
1109+
return MQueue->getPlugin().getBackend() != backend::level_zero ||
1110+
MEvent->getHandleRef() != nullptr;
11101111
}
11111112

11121113
cl_int UnMapMemObject::enqueueImp() {
@@ -1202,7 +1203,8 @@ bool MemCpyCommand::producesPiEvent() const {
12021203
// so the execution of kernel B starts only on step 4. This workaround
12031204
// restores the old behavior in this case until this is resolved.
12041205
return MQueue->is_host() ||
1205-
MQueue->getPlugin().getBackend() != backend::level_zero;
1206+
MQueue->getPlugin().getBackend() != backend::level_zero ||
1207+
MEvent->getHandleRef() != nullptr;
12061208
}
12071209

12081210
cl_int MemCpyCommand::enqueueImp() {

0 commit comments

Comments
 (0)