Skip to content

Commit 1003594

Browse files
Revert "fix: choose proper csr for low priority immediate command lists"
Signed-off-by: Michal Mrozek <[email protected]>
1 parent 2b4f6f0 commit 1003594

File tree

3 files changed

+1
-31
lines changed

3 files changed

+1
-31
lines changed

level_zero/core/source/device/device_imp.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ ze_result_t DeviceImp::createCommandQueue(const ze_command_queue_desc_t *desc,
303303
bool isCopyOnly = NEO::EngineHelper::isCopyOnlyEngineType(
304304
getEngineGroupTypeForOrdinal(commandQueueDesc.ordinal));
305305

306-
if (isSuitableForLowPriority(commandQueueDesc.priority, isCopyOnly)) {
306+
if (commandQueueDesc.priority == ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW && !isCopyOnly) {
307307
getCsrForLowPriority(&csr);
308308
} else {
309309
auto ret = getCsrForOrdinalAndIndexWithPriority(&csr, commandQueueDesc.ordinal, commandQueueDesc.index, commandQueueDesc.priority);
@@ -1676,9 +1676,6 @@ ze_result_t DeviceImp::getCsrForOrdinalAndIndexWithPriority(NEO::CommandStreamRe
16761676
}
16771677
}
16781678
}
1679-
} else if (isSuitableForLowPriority(priority, NEO::EngineHelper::isCopyOnlyEngineType(
1680-
getEngineGroupTypeForOrdinal(ordinal)))) {
1681-
return getCsrForLowPriority(csr);
16821679
}
16831680

16841681
return getCsrForOrdinalAndIndex(csr, ordinal, index);
@@ -1703,10 +1700,6 @@ ze_result_t DeviceImp::getCsrForLowPriority(NEO::CommandStreamReceiver **csr) {
17031700
return ZE_RESULT_ERROR_UNKNOWN;
17041701
}
17051702

1706-
bool DeviceImp::isSuitableForLowPriority(ze_command_queue_priority_t priority, bool copyOnly) {
1707-
return (priority == ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW && !copyOnly);
1708-
}
1709-
17101703
DebugSession *DeviceImp::getDebugSession(const zet_debug_config_t &config) {
17111704
return debugSession.get();
17121705
}

level_zero/core/source/device/device_imp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ struct DeviceImp : public Device, NEO::NonCopyableOrMovableClass {
114114
ze_result_t getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index) override;
115115
ze_result_t getCsrForOrdinalAndIndexWithPriority(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index, ze_command_queue_priority_t priority) override;
116116
ze_result_t getCsrForLowPriority(NEO::CommandStreamReceiver **csr) override;
117-
bool isSuitableForLowPriority(ze_command_queue_priority_t priority, bool copyOnly);
118117
NEO::GraphicsAllocation *obtainReusableAllocation(size_t requiredSize, NEO::AllocationType type) override;
119118
void storeReusableAllocation(NEO::GraphicsAllocation &alloc) override;
120119
NEO::Device *getActiveDevice() const;

level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_1.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -879,28 +879,6 @@ TEST_F(DeferredContextCreationDeviceCreateCommandQueueTest, givenLowPriorityEngi
879879
commandQueue->destroy();
880880
}
881881

882-
using DeviceCreateCommandQueueTest = Test<DeviceFixture>;
883-
TEST_F(DeviceCreateCommandQueueTest, givenLowPriorityDescWhenCreateImmediateCommandListThenLowPriorityCsrIsAssigned) {
884-
ze_command_queue_desc_t desc{};
885-
desc.ordinal = 0u;
886-
desc.index = 0u;
887-
desc.priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW;
888-
889-
ze_command_list_handle_t commandListHandle = {};
890-
891-
ze_result_t res = device->createCommandListImmediate(&desc, &commandListHandle);
892-
893-
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
894-
auto commandList = static_cast<CommandListImp *>(L0::CommandList::fromHandle(commandListHandle));
895-
896-
EXPECT_NE(commandList, nullptr);
897-
EXPECT_TRUE(commandList->getCsr()->getOsContext().isLowPriority());
898-
NEO::CommandStreamReceiver *csr = nullptr;
899-
device->getCsrForLowPriority(&csr);
900-
EXPECT_EQ(commandList->getCsr(), csr);
901-
commandList->destroy();
902-
}
903-
904882
TEST_F(DeviceCreateCommandQueueTest, givenNormalPriorityDescWhenCreateCommandQueueIsCalledWithValidArgumentThenCsrIsAssignedWithOrdinalAndIndex) {
905883
ze_command_queue_desc_t desc{};
906884
desc.ordinal = 0u;

0 commit comments

Comments
 (0)