Skip to content

Commit 07993cb

Browse files
committed
fix batching
Signed-off-by: Sergey V Maslov <[email protected]>
1 parent ce4f781 commit 07993cb

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ pi_result _pi_queue::resetCommandList(pi_command_list_ptr_t CommandList,
706706
ZE_CALL(zeFenceReset, (CommandList->second.ZeFence));
707707
ZE_CALL(zeCommandListReset, (CommandList->first));
708708
CommandList->second.InUse = false;
709+
CommandList->second.EventList.clear();
709710

710711
if (MakeAvailable) {
711712
std::lock_guard<std::mutex> lock(this->Context->ZeCommandListCacheMutex);
@@ -947,15 +948,12 @@ pi_result _pi_queue::executeCommandList(pi_command_list_ptr_t CommandList,
947948
// as we want to strictly follow the batching the user specified.
948949
if (OKToBatchCommand && this->isBatchingAllowed() &&
949950
(!UseDynamicBatching || !CurrentlyEmpty)) {
950-
if (hasOpenCommandList()) {
951-
if (OpenCommandList != CommandList)
952-
die("executeCommandList: OpenCommandList should be equal to"
953-
"null or CommandList");
954951

955-
if (OpenCommandList->second.size() < QueueBatchSize) {
956-
return PI_SUCCESS;
957-
}
958-
} else {
952+
if (hasOpenCommandList() && OpenCommandList != CommandList)
953+
die("executeCommandList: OpenCommandList should be equal to"
954+
"null or CommandList");
955+
956+
if (CommandList->second.size() < QueueBatchSize) {
959957
OpenCommandList = CommandList;
960958
return PI_SUCCESS;
961959
}

sycl/plugins/level_zero/pi_level_zero.hpp

100755100644
File mode changed.

0 commit comments

Comments
 (0)