Skip to content

Commit 05b2c46

Browse files
committed
[L0] Fix regular in order command list reuse given inorder queue
- Fix command lists cache usage such that given an inorder queue and in order lists is requested, then only in order lists can be used from the cache. Signed-off-by: Neil R. Spruit <[email protected]>
1 parent 0c0f48d commit 05b2c46

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

source/adapters/level_zero/context.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,11 @@ ur_result_t ur_context_handle_t_::getAvailableCommandList(
712712

713713
for (auto ZeCommandListIt = ZeCommandListCache.begin();
714714
ZeCommandListIt != ZeCommandListCache.end(); ++ZeCommandListIt) {
715+
// If this is an InOrder Queue, then only allow lists which are in order.
716+
if (Queue->Device->useDriverInOrderLists() && Queue->isInOrderQueue() &&
717+
!(ZeCommandListIt->second.flags & ZE_COMMAND_QUEUE_FLAG_IN_ORDER)) {
718+
continue;
719+
}
715720
auto &ZeCommandList = ZeCommandListIt->first;
716721
auto it = Queue->CommandListMap.find(ZeCommandList);
717722
if (it != Queue->CommandListMap.end()) {
@@ -766,6 +771,12 @@ ur_result_t ur_context_handle_t_::getAvailableCommandList(
766771
if (UseCopyEngine != it->second.isCopy(Queue))
767772
continue;
768773

774+
// If this is an InOrder Queue, then only allow lists which are in order.
775+
if (Queue->Device->useDriverInOrderLists() && Queue->isInOrderQueue() &&
776+
!(it->second.ZeQueueDesc.flags & ZE_COMMAND_QUEUE_FLAG_IN_ORDER)) {
777+
continue;
778+
}
779+
769780
ze_result_t ZeResult =
770781
ZE_CALL_NOCHECK(zeFenceQueryStatus, (it->second.ZeFence));
771782
if (ZeResult == ZE_RESULT_SUCCESS) {

0 commit comments

Comments
 (0)