feature: add L0 API querying priority levels - zeDeviceGetPriorityLevels()

Related-To: NEO-14572

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2025-05-21 12:22:11 +00:00
committed by Compute-Runtime-Automation
parent a423493a4a
commit 0d57dcfdf0
31 changed files with 260 additions and 108 deletions

View File

@@ -188,7 +188,7 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device
engineGroupType = deviceImp->getInternalEngineGroupType();
}
} else {
returnValue = device->getCsrForOrdinalAndIndex(&csr, cmdQdesc.ordinal, cmdQdesc.index, cmdQdesc.priority, queueProperties.interruptHint);
returnValue = device->getCsrForOrdinalAndIndex(&csr, cmdQdesc.ordinal, cmdQdesc.index, cmdQdesc.priority, queueProperties.priorityLevel, queueProperties.interruptHint);
if (returnValue != ZE_RESULT_SUCCESS) {
return commandList;
}
@@ -299,7 +299,7 @@ void CommandListImp::enableCopyOperationOffload() {
NEO::CommandStreamReceiver *copyCsr = nullptr;
uint32_t ordinal = static_cast<DeviceImp *>(device)->getCopyEngineOrdinal();
device->getCsrForOrdinalAndIndex(&copyCsr, ordinal, 0, immediateQueuePriority, false);
device->getCsrForOrdinalAndIndex(&copyCsr, ordinal, 0, immediateQueuePriority, 0, false);
UNRECOVERABLE_IF(!copyCsr);
ze_command_queue_desc_t copyQueueDesc = {ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};

View File

@@ -377,6 +377,8 @@ QueueProperties CommandQueue::extractQueueProperties(const ze_command_queue_desc
}
} else if (static_cast<uint32_t>(baseProperties->stype) == ZEX_INTEL_STRUCTURE_TYPE_QUEUE_COPY_OPERATIONS_OFFLOAD_HINT_EXP_PROPERTIES) {
queueProperties.copyOffloadHint = static_cast<const zex_intel_queue_copy_operations_offload_hint_exp_desc_t *>(desc.pNext)->copyOffloadEnabled;
} else if (static_cast<uint32_t>(baseProperties->stype) == ZE_STRUCTURE_TYPE_QUEUE_PRIORITY_DESC) {
queueProperties.priorityLevel = static_cast<const ze_queue_priority_desc_t *>(desc.pNext)->priority;
}
baseProperties = static_cast<const ze_base_desc_t *>(baseProperties->pNext);

View File

@@ -38,6 +38,7 @@ struct QueueProperties {
NEO::SynchronizedDispatchMode synchronizedDispatchMode = NEO::SynchronizedDispatchMode::disabled;
bool interruptHint = false;
bool copyOffloadHint = false;
int priorityLevel = 0;
};
struct CommandQueue : _ze_command_queue_handle_t {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2024 Intel Corporation
* Copyright (C) 2023-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -99,4 +99,12 @@ void Device::ensureSyncDispatchTokenAllocation() {
}
}
ze_result_t Device::getPriorityLevels(int *lowestPriority, int *highestPriority) {
*highestPriority = queuePriorityHigh;
*lowestPriority = queuePriorityLow;
return ZE_RESULT_SUCCESS;
}
} // namespace L0

View File

@@ -143,7 +143,7 @@ struct Device : _ze_device_handle_t {
virtual NEO::GraphicsAllocation *allocateMemoryFromHostPtr(const void *buffer, size_t size, bool hostCopyAllowed) = 0;
virtual void setSysmanHandle(SysmanDevice *pSysmanDevice) = 0;
virtual SysmanDevice *getSysmanHandle() = 0;
virtual ze_result_t getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index, ze_command_queue_priority_t priority, bool allocateInterrupt) = 0;
virtual ze_result_t getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index, ze_command_queue_priority_t priority, int priorityLevel, bool allocateInterrupt) = 0;
virtual ze_result_t getCsrForLowPriority(NEO::CommandStreamReceiver **csr, bool copyOnly) = 0;
virtual NEO::GraphicsAllocation *obtainReusableAllocation(size_t requiredSize, NEO::AllocationType type) = 0;
virtual void storeReusableAllocation(NEO::GraphicsAllocation &alloc) = 0;
@@ -158,6 +158,8 @@ struct Device : _ze_device_handle_t {
void ensureSyncDispatchTokenAllocation();
void setIdentifier(uint32_t id) { identifier = id; }
uint32_t getIdentifier() const { return identifier; }
ze_result_t getPriorityLevels(int *lowestPriority,
int *highestPriority);
protected:
NEO::Device *neoDevice = nullptr;
@@ -170,6 +172,8 @@ struct Device : _ze_device_handle_t {
std::atomic<uint32_t> syncDispatchQueueIdAllocator = 0;
uint32_t identifier = 0;
bool implicitScalingCapable = false;
int queuePriorityHigh = 0;
int queuePriorityLow = 1;
};
} // namespace L0

View File

@@ -365,7 +365,7 @@ ze_result_t DeviceImp::createCommandQueue(const ze_command_queue_desc_t *desc,
auto queueProperties = CommandQueue::extractQueueProperties(*desc);
auto ret = getCsrForOrdinalAndIndex(&csr, commandQueueDesc.ordinal, commandQueueDesc.index, commandQueueDesc.priority, queueProperties.interruptHint);
auto ret = getCsrForOrdinalAndIndex(&csr, commandQueueDesc.ordinal, commandQueueDesc.index, commandQueueDesc.priority, queueProperties.priorityLevel, queueProperties.interruptHint);
if (ret != ZE_RESULT_SUCCESS) {
return ret;
}
@@ -1630,6 +1630,11 @@ Device *Device::create(DriverHandle *driverHandle, NEO::Device *neoDevice, bool
auto &productHelper = device->getProductHelper();
device->calculationForDisablingEuFusionWithDpasNeeded = productHelper.isCalculationForDisablingEuFusionWithDpasNeeded(hwInfo);
auto numPriorities = static_cast<int>(device->getNEODevice()->getGfxCoreHelper().getQueuePriorityLevels());
device->queuePriorityHigh = -(numPriorities + 1) / 2 + 1;
device->queuePriorityLow = (numPriorities) / 2;
return device;
}
@@ -1819,7 +1824,7 @@ bool DeviceImp::isQueueGroupOrdinalValid(uint32_t ordinal) {
return true;
}
ze_result_t DeviceImp::getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index, ze_command_queue_priority_t priority, bool allocateInterrupt) {
ze_result_t DeviceImp::getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index, ze_command_queue_priority_t priority, int priorityLevel, bool allocateInterrupt) {
auto &engineGroups = getActiveDevice()->getRegularEngineGroups();
uint32_t numEngineGroups = static_cast<uint32_t>(engineGroups.size());
@@ -1869,6 +1874,15 @@ ze_result_t DeviceImp::getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr
auto engineGroupType = getEngineGroupTypeForOrdinal(ordinal);
bool copyOnly = NEO::EngineHelper::isCopyOnlyEngineType(engineGroupType);
if (priorityLevel < 0) {
priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH;
} else if (priorityLevel == this->queuePriorityLow) {
DEBUG_BREAK_IF(this->queuePriorityLow == 0);
priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW;
} else if (priorityLevel > 0) {
priority = ZE_COMMAND_QUEUE_PRIORITY_NORMAL;
}
if (priority == ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH) {
contextPriority = NEO::EngineUsage::highPriority;
} else if (isSuitableForLowPriority(priority, copyOnly)) {
@@ -1913,18 +1927,18 @@ ze_result_t DeviceImp::getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr
auto &osContext = (*csr)->getOsContext();
if (secondaryContextsEnabled) {
selectedDevice->tryAssignSecondaryContext(osContext.getEngineType(), contextPriority, csr, allocateInterrupt);
selectedDevice->tryAssignSecondaryContext(osContext.getEngineType(), contextPriority, priorityLevel, csr, allocateInterrupt);
}
return ZE_RESULT_SUCCESS;
}
bool DeviceImp::tryAssignSecondaryContext(aub_stream::EngineType engineType, NEO::EngineUsage engineUsage, NEO::CommandStreamReceiver **csr, bool allocateInterrupt) {
bool DeviceImp::tryAssignSecondaryContext(aub_stream::EngineType engineType, NEO::EngineUsage engineUsage, int priorityLevel, NEO::CommandStreamReceiver **csr, bool allocateInterrupt) {
if (neoDevice->isSecondaryContextEngineType(engineType)) {
NEO::EngineTypeUsage engineTypeUsage;
engineTypeUsage.first = engineType;
engineTypeUsage.second = engineUsage;
auto engine = neoDevice->getSecondaryEngineCsr(engineTypeUsage, allocateInterrupt);
auto engine = neoDevice->getSecondaryEngineCsr(engineTypeUsage, priorityLevel, allocateInterrupt);
if (engine) {
*csr = engine->commandStreamReceiver;
return true;

View File

@@ -116,7 +116,7 @@ struct DeviceImp : public Device, NEO::NonCopyableAndNonMovableClass {
NEO::GraphicsAllocation *allocateMemoryFromHostPtr(const void *buffer, size_t size, bool hostCopyAllowed) override;
void setSysmanHandle(SysmanDevice *pSysman) override;
SysmanDevice *getSysmanHandle() override;
ze_result_t getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index, ze_command_queue_priority_t priority, bool allocateInterrupt) override;
ze_result_t getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index, ze_command_queue_priority_t priority, int priorityLevel, bool allocateInterrupt) override;
ze_result_t getCsrForLowPriority(NEO::CommandStreamReceiver **csr, bool copyOnly) override;
ze_result_t getCsrForHighPriority(NEO::CommandStreamReceiver **csr, bool copyOnly);
bool isSuitableForLowPriority(ze_command_queue_priority_t priority, bool copyOnly);
@@ -191,7 +191,7 @@ struct DeviceImp : public Device, NEO::NonCopyableAndNonMovableClass {
NEO::EngineGroupType getEngineGroupTypeForOrdinal(uint32_t ordinal) const;
void getP2PPropertiesDirectFabricConnection(DeviceImp *peerDeviceImp,
ze_device_p2p_bandwidth_exp_properties_t *bandwidthPropertiesDesc);
bool tryAssignSecondaryContext(aub_stream::EngineType engineType, NEO::EngineUsage engineUsage, NEO::CommandStreamReceiver **csr, bool allocateInterrupt);
bool tryAssignSecondaryContext(aub_stream::EngineType engineType, NEO::EngineUsage engineUsage, int priorityLevel, NEO::CommandStreamReceiver **csr, bool allocateInterrupt);
NEO::EngineGroupsT subDeviceCopyEngineGroups{};
SysmanDevice *pSysmanDevice = nullptr;

View File

@@ -35,6 +35,7 @@ void *ExtensionFunctionAddressHelper::getExtensionFunctionAddress(const std::str
RETURN_FUNC_PTR_IF_EXIST(zerDeviceTranslateToIdentifier);
RETURN_FUNC_PTR_IF_EXIST(zerIdentifierTranslateToDeviceHandle);
RETURN_FUNC_PTR_IF_EXIST(zeDeviceSynchronize);
RETURN_FUNC_PTR_IF_EXIST(zeDeviceGetPriorityLevels);
RETURN_FUNC_PTR_IF_EXIST(zeCommandListAppendLaunchKernelWithArguments);

View File

@@ -75,7 +75,7 @@ struct MockDevice : public Device {
ADDMETHOD_NOBASE(allocateMemoryFromHostPtr, NEO::GraphicsAllocation *, nullptr, (const void *buffer, size_t size, bool hostCopyAllowed));
ADDMETHOD_NOBASE_VOIDRETURN(setSysmanHandle, (SysmanDevice *));
ADDMETHOD_NOBASE(getSysmanHandle, SysmanDevice *, nullptr, ());
ADDMETHOD_NOBASE(getCsrForOrdinalAndIndex, ze_result_t, ZE_RESULT_SUCCESS, (NEO::CommandStreamReceiver * *csr, uint32_t ordinal, uint32_t index, ze_command_queue_priority_t priority, bool allocateInterrupt));
ADDMETHOD_NOBASE(getCsrForOrdinalAndIndex, ze_result_t, ZE_RESULT_SUCCESS, (NEO::CommandStreamReceiver * *csr, uint32_t ordinal, uint32_t index, ze_command_queue_priority_t priority, int priorityLevel, bool allocateInterrupt));
ADDMETHOD_NOBASE(getCsrForLowPriority, ze_result_t, ZE_RESULT_SUCCESS, (NEO::CommandStreamReceiver * *csr, bool copyOnly));
ADDMETHOD_NOBASE(getDebugProperties, ze_result_t, ZE_RESULT_SUCCESS, (zet_device_debug_properties_t * properties));
ADDMETHOD_NOBASE(getDebugSession, DebugSession *, nullptr, (const zet_debug_config_t &config));
@@ -109,6 +109,8 @@ struct MockDeviceImp : public L0::DeviceImp {
using Base::implicitScalingCapable;
using Base::inOrderTimestampAllocator;
using Base::neoDevice;
using Base::queuePriorityHigh;
using Base::queuePriorityLow;
using Base::subDeviceCopyEngineGroups;
using Base::syncDispatchTokenAllocation;

View File

@@ -2707,7 +2707,7 @@ TEST_F(ContextCommandListCreate, givenDeferredEngineCreationWhenImmediateCommand
const auto &group = groups[groupIndex];
for (uint32_t queueIndex = 0; queueIndex < group.numQueues; queueIndex++) {
CommandStreamReceiver *expectedCsr{};
EXPECT_EQ(ZE_RESULT_SUCCESS, device->getCsrForOrdinalAndIndex(&expectedCsr, groupIndex, queueIndex, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false));
EXPECT_EQ(ZE_RESULT_SUCCESS, device->getCsrForOrdinalAndIndex(&expectedCsr, groupIndex, queueIndex, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false));
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS;

View File

@@ -890,7 +890,7 @@ HWTEST_F(CommandListCreate, givenImmediateCopyOnlySingleTileDirectSubmissionComm
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue;
CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
ASSERT_NE(nullptr, commandList);
@@ -911,7 +911,7 @@ HWTEST_F(CommandListCreate, givenMetricsImmediateCopyOnlySingleTileDirectSubmiss
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue;
CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
ASSERT_NE(nullptr, commandList);
@@ -931,7 +931,7 @@ HWTEST_F(CommandListCreate, givenSecondaryCommandStreamForImmediateCmdListWhenCh
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue;
CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
ASSERT_NE(nullptr, commandList);
@@ -1092,7 +1092,7 @@ HWTEST_F(CommandListCreate, givenDirectSubmissionFlatRingBufferFlagDisabledImmed
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue;
CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
ASSERT_NE(nullptr, commandList);
@@ -1120,7 +1120,7 @@ HWTEST_F(CommandListCreateImplicitScaling, givenImmediateCopyOnlyDirectSubmissio
desc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS;
ze_result_t returnValue;
CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, desc.ordinal, desc.index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::copy, returnValue));
ASSERT_NE(nullptr, commandList);
@@ -1133,7 +1133,7 @@ HWTEST_F(CommandListCreate, givenCopyOnlySingleTileDirectSubmissionCommandListWh
debugManager.flags.DirectSubmissionFlatRingBuffer.set(-1);
ze_result_t returnValue;
CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::copy, 0u, returnValue, false));
ASSERT_NE(nullptr, commandList);

View File

@@ -3066,11 +3066,11 @@ HWTEST2_F(ContextGroupStateBaseAddressGlobalStatelessTest,
NEO::EngineTypeUsage engineTypeUsage;
engineTypeUsage.first = hwInfo.capabilityTable.defaultEngineType;
engineTypeUsage.second = NEO::EngineUsage::regular;
auto primaryCsr = neoDevice->getSecondaryEngineCsr(engineTypeUsage, false)->commandStreamReceiver;
auto primaryCsr = neoDevice->getSecondaryEngineCsr(engineTypeUsage, 0, false)->commandStreamReceiver;
EXPECT_EQ(nullptr, primaryCsr->getOsContext().getPrimaryContext());
EXPECT_TRUE(primaryCsr->getOsContext().isPartOfContextGroup());
auto secondaryCsr = neoDevice->getSecondaryEngineCsr(engineTypeUsage, false)->commandStreamReceiver;
auto secondaryCsr = neoDevice->getSecondaryEngineCsr(engineTypeUsage, 0, false)->commandStreamReceiver;
ze_command_queue_desc_t desc = {};
auto otherCommandQueue = new MockCommandQueueHw<FamilyType::gfxCoreFamily>(device, secondaryCsr, &desc);
@@ -3117,11 +3117,11 @@ HWTEST2_F(ContextGroupStateBaseAddressGlobalStatelessTest,
NEO::EngineTypeUsage engineTypeUsage;
engineTypeUsage.first = hwInfo.capabilityTable.defaultEngineType;
engineTypeUsage.second = NEO::EngineUsage::regular;
auto primaryCsr = neoDevice->getSecondaryEngineCsr(engineTypeUsage, false)->commandStreamReceiver;
auto primaryCsr = neoDevice->getSecondaryEngineCsr(engineTypeUsage, 0, false)->commandStreamReceiver;
EXPECT_EQ(nullptr, primaryCsr->getOsContext().getPrimaryContext());
EXPECT_TRUE(primaryCsr->getOsContext().isPartOfContextGroup());
[[maybe_unused]] auto secondaryCsr = neoDevice->getSecondaryEngineCsr(engineTypeUsage, false)->commandStreamReceiver;
[[maybe_unused]] auto secondaryCsr = neoDevice->getSecondaryEngineCsr(engineTypeUsage, 0, false)->commandStreamReceiver;
ze_command_queue_desc_t queueDesc{ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC};
queueDesc.ordinal = 0u;

View File

@@ -888,7 +888,7 @@ TEST_F(DeviceCreateCommandQueueTest, givenNormalPriorityDescWhenCreateCommandQue
EXPECT_NE(commandQueue, nullptr);
EXPECT_FALSE(commandQueue->getCsr()->getOsContext().isLowPriority());
NEO::CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
EXPECT_EQ(commandQueue->getCsr(), csr);
commandQueue->destroy();
}
@@ -909,7 +909,7 @@ TEST_F(DeviceCreateCommandQueueTest,
EXPECT_NE(commandQueue, nullptr);
EXPECT_FALSE(commandQueue->getCsr()->getOsContext().isLowPriority());
NEO::CommandStreamReceiver *csr = nullptr;
res = device->getCsrForOrdinalAndIndex(&csr, std::numeric_limits<uint32_t>::max(), 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
res = device->getCsrForOrdinalAndIndex(&csr, std::numeric_limits<uint32_t>::max(), 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
EXPECT_EQ(res, ZE_RESULT_ERROR_INVALID_ARGUMENT);
commandQueue->destroy();
}
@@ -929,7 +929,7 @@ TEST_F(DeviceCreateCommandQueueTest,
EXPECT_NE(commandQueue, nullptr);
EXPECT_FALSE(commandQueue->getCsr()->getOsContext().isLowPriority());
NEO::CommandStreamReceiver *csr = nullptr;
res = device->getCsrForOrdinalAndIndex(&csr, 0u, std::numeric_limits<uint32_t>::max(), ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
res = device->getCsrForOrdinalAndIndex(&csr, 0u, std::numeric_limits<uint32_t>::max(), ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
EXPECT_EQ(res, ZE_RESULT_ERROR_INVALID_ARGUMENT);
commandQueue->destroy();
}
@@ -1021,7 +1021,7 @@ using ExecuteCommandListTests = Test<DeviceFixture>;
HWTEST_F(ExecuteCommandListTests, givenExecuteCommandListWhenItReturnsThenContainersAreEmpty) {
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = new MockCommandQueue<FamilyType::gfxCoreFamily>(device, csr, &desc);
commandQueue->initialize(false, false, false);
auto commandList = new CommandListCoreFamily<FamilyType::gfxCoreFamily>();
@@ -1050,7 +1050,7 @@ HWTEST_F(ExecuteCommandListTests, givenExecuteCommandListWhenItReturnsThenContai
HWTEST_F(ExecuteCommandListTests, givenRegularCmdListWhenExecutionThenIncSubmissionCounter) {
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = makeZeUniquePtr<MockCommandQueue<FamilyType::gfxCoreFamily>>(device, csr, &desc);
commandQueue->initialize(false, false, false);
@@ -1099,7 +1099,7 @@ class MockCommandQueueSubmitBatchBuffer : public MockCommandQueue<gfxCoreFamily>
HWTEST_F(ExecuteCommandListTests, givenOutOfMemorySubmitBatchBufferThenExecuteCommandListReturnsOutOfMemoryError) {
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = new MockCommandQueueSubmitBatchBuffer<FamilyType::gfxCoreFamily>(device, csr, &desc);
commandQueue->submitBatchBufferResult = NEO::SubmissionStatus::outOfMemory;
@@ -1123,7 +1123,7 @@ HWTEST_F(CommandQueueDestroy, givenCommandQueueAndCommandListWithSshAndScratchWh
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = new MockCommandQueue<FamilyType::gfxCoreFamily>(device, csr, &desc);
commandQueue->initialize(false, false, false);
auto commandList = new CommandListCoreFamily<FamilyType::gfxCoreFamily>();
@@ -1158,7 +1158,7 @@ HWTEST2_F(CommandQueueDestroy, givenCommandQueueAndCommandListWithSshAndPrivateS
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = new MockCommandQueue<FamilyType::gfxCoreFamily>(device, csr, &desc);
commandQueue->initialize(false, false, false);
auto commandList = new CommandListCoreFamily<FamilyType::gfxCoreFamily>();
@@ -1196,7 +1196,7 @@ HWTEST_F(ExecuteCommandListTests, givenBindlessHelperWhenCommandListIsExecutedOn
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->bindlessHeapsHelper.reset(bindlessHeapsHelper.release());
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = new MockCommandQueue<FamilyType::gfxCoreFamily>(device, csr, &desc);
commandQueue->initialize(false, false, false);
auto commandList = new CommandListCoreFamily<FamilyType::gfxCoreFamily>();
@@ -1217,7 +1217,7 @@ HWTEST_F(ExecuteCommandListTests, givenBindlessHelperWhenCommandListIsExecutedOn
HWTEST_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenExecuteCommandListReturnsErrorUnknown) {
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = new MockCommandQueueSubmitBatchBuffer<FamilyType::gfxCoreFamily>(device, csr, &desc);
commandQueue->submitBatchBufferResult = NEO::SubmissionStatus::failed;
@@ -1238,7 +1238,7 @@ HWTEST_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenResetGraphics
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = new MockCommandQueueSubmitBatchBuffer<FamilyType::gfxCoreFamily>(device, csr, &desc);
commandQueue->submitBatchBufferResult = NEO::SubmissionStatus::failed;
@@ -1270,7 +1270,7 @@ HWTEST_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenResetGraphics
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = new MockCommandQueueSubmitBatchBuffer<FamilyType::gfxCoreFamily>(device, csr, &desc);
commandQueue->submitBatchBufferResult = NEO::SubmissionStatus::failed;
@@ -1306,7 +1306,7 @@ HWTEST_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenWaitForComple
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = new MockCommandQueueSubmitBatchBuffer<FamilyType::gfxCoreFamily>(device, csr, &desc);
commandQueue->submitBatchBufferResult = NEO::SubmissionStatus::failed;
@@ -1331,7 +1331,7 @@ HWTEST_F(ExecuteCommandListTests, givenFailingSubmitBatchBufferThenWaitForComple
HWTEST_F(ExecuteCommandListTests, givenSuccessfulSubmitBatchBufferThenExecuteCommandListReturnsSuccess) {
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = new MockCommandQueueSubmitBatchBuffer<FamilyType::gfxCoreFamily>(device, csr, &desc);
commandQueue->submitBatchBufferResult = NEO::SubmissionStatus::success;
@@ -1363,7 +1363,7 @@ HWTEST_F(ExecuteCommandListTests, givenCommandQueueHavingTwoB2BCommandListsThenM
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ze_result_t returnValue;
auto commandQueue = CommandQueue::create(productFamily,
device,
@@ -1404,7 +1404,7 @@ HWTEST2_F(ExecuteCommandListTests, givenCommandQueueHavingTwoB2BCommandListsThen
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ze_result_t returnValue;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,
device,
@@ -1448,7 +1448,7 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ze_result_t returnValue;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,
device,
@@ -1526,7 +1526,7 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ze_result_t returnValue;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,
device,
@@ -1604,7 +1604,7 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ze_result_t returnValue;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,
device,
@@ -1682,7 +1682,7 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ze_result_t returnValue;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,
device,
@@ -1765,7 +1765,7 @@ HWTEST2_F(ExecuteCommandListTests, givenTwoCommandQueuesHavingTwoB2BCommandLists
using CFE_STATE = typename FamilyType::CFE_STATE;
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ze_result_t returnValue;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,
device,
@@ -1845,7 +1845,7 @@ HWTEST_F(ExecuteCommandListTests, givenDirectSubmissionEnabledWhenExecutingCmdLi
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
static_cast<NEO::UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
ze_result_t returnValue;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,
@@ -1891,7 +1891,7 @@ HWTEST_F(ExecuteCommandListTests, givenDirectSubmissionEnabledAndDebugFlagSetWhe
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
static_cast<NEO::UltCommandStreamReceiver<FamilyType> *>(csr)->directSubmissionAvailable = true;
ze_result_t returnValue;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,

View File

@@ -955,7 +955,7 @@ HWTEST2_F(CommandQueueScratchTests, givenCommandQueueWhenHandleScratchSpaceAndHe
HWTEST2_F(CommandQueueScratchTests, whenPatchCommandsIsCalledThenCommandsAreCorrectlyPatched, IsAtLeastXeHpCore) {
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = std::make_unique<MockCommandQueueHw<FamilyType::gfxCoreFamily>>(device, csr, &desc);
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<FamilyType::gfxCoreFamily>>>();
@@ -1015,7 +1015,7 @@ HWTEST2_F(CommandQueueScratchTests, whenPatchCommandsIsCalledThenCommandsAreCorr
HWTEST2_F(CommandQueueScratchTests, givenCommandsToPatchToNotSupportedPlatformWhenPatchCommandsIsCalledThenAbortIsThrown, IsGen12LP) {
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = std::make_unique<MockCommandQueueHw<FamilyType::gfxCoreFamily>>(device, csr, &desc);
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<FamilyType::gfxCoreFamily>>>();
@@ -1042,7 +1042,7 @@ using CommandQueueCreate = Test<DeviceFixture>;
HWTEST_F(CommandQueueCreate, givenCommandsToPatchWithNoopSpacePatchWhenPatchCommandsIsCalledThenSpaceIsNooped) {
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
auto commandQueue = std::make_unique<MockCommandQueueHw<FamilyType::gfxCoreFamily>>(device, csr, &desc);
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<FamilyType::gfxCoreFamily>>>();

View File

@@ -960,7 +960,7 @@ HWTEST2_F(CommandQueueTest, whenExecuteCommandListsIsCalledThenCorrectSizeOfFron
debugManager.flags.AllowPatchingVfeStateInCommandLists.set(1);
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ASSERT_NE(nullptr, csr);
auto commandQueue = new MockCommandQueueHw<FamilyType::gfxCoreFamily>{device, csr, &desc};
@@ -1116,7 +1116,7 @@ HWTEST2_F(CommandQueueTest, whenExecuteCommandListsIsCalledThenCorrectSizeOfFron
HWTEST2_F(CommandQueueTest, givenRegularKernelScheduledAsCooperativeWhenExecuteCommandListsIsCalledThenComputeDispatchAllWalkerEnableIsSet, IsAtLeastXeHpCore) {
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ASSERT_NE(nullptr, csr);
auto commandQueue = new MockCommandQueueHw<FamilyType::gfxCoreFamily>{device, csr, &desc};
@@ -1151,7 +1151,7 @@ HWTEST2_F(CommandQueueTest, givenRegularKernelScheduledAsCooperativeWhenExecuteC
HWTEST2_F(CommandQueueTest, givenTwoCommandQueuesUsingOneCsrWhenExecuteCommandListsIsCalledThenCorrectSizeOfFrontEndCmdsIsCalculated, IsAtLeastXeHpCore) {
ze_command_queue_desc_t desc = {};
NEO::CommandStreamReceiver *csr = nullptr;
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
device->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ASSERT_NE(nullptr, csr);
auto commandQueue1 = new MockCommandQueueHw<FamilyType::gfxCoreFamily>{device, csr, &desc};

View File

@@ -4951,7 +4951,7 @@ HWTEST_F(DeviceTest, givenContextGroupSupportedWhenGettingHighPriorityCsrThenCor
ASSERT_TRUE(engineGroups[ordinalCopy].engineGroupType == NEO::EngineGroupType::copy);
uint32_t index = 1;
auto result = deviceImp.getCsrForOrdinalAndIndex(&highPriorityCsr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, false);
auto result = deviceImp.getCsrForOrdinalAndIndex(&highPriorityCsr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, deviceImp.queuePriorityHigh, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
ASSERT_NE(nullptr, highPriorityCsr);
@@ -4968,7 +4968,7 @@ HWTEST_F(DeviceTest, givenContextGroupSupportedWhenGettingHighPriorityCsrThenCor
EXPECT_TRUE(highPriorityCsr->getOsContext().isPartOfContextGroup());
EXPECT_NE(nullptr, highPriorityCsr->getOsContext().getPrimaryContext());
result = deviceImp.getCsrForOrdinalAndIndex(&highPriorityCsr2, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, false);
result = deviceImp.getCsrForOrdinalAndIndex(&highPriorityCsr2, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, deviceImp.queuePriorityHigh, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
ASSERT_NE(nullptr, highPriorityCsr2);
EXPECT_NE(highPriorityCsr, highPriorityCsr2);
@@ -4977,24 +4977,24 @@ HWTEST_F(DeviceTest, givenContextGroupSupportedWhenGettingHighPriorityCsrThenCor
EXPECT_TRUE(highPriorityCsr2->getOsContext().isPartOfContextGroup());
index = 100;
result = deviceImp.getCsrForOrdinalAndIndex(&highPriorityCsr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, false);
result = deviceImp.getCsrForOrdinalAndIndex(&highPriorityCsr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, deviceImp.queuePriorityHigh, false);
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
index = 0;
ordinal = 100;
result = deviceImp.getCsrForOrdinalAndIndex(&highPriorityCsr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, false);
result = deviceImp.getCsrForOrdinalAndIndex(&highPriorityCsr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, deviceImp.queuePriorityHigh, false);
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
// When no HP copy engine, then hp csr from group is returned
NEO::CommandStreamReceiver *bcsEngine = nullptr, *bcsEngine2 = nullptr;
EXPECT_EQ(nullptr, neoMockDevice->getHpCopyEngine());
result = deviceImp.getCsrForOrdinalAndIndex(&bcsEngine, ordinalCopy, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, false);
result = deviceImp.getCsrForOrdinalAndIndex(&bcsEngine, ordinalCopy, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, deviceImp.queuePriorityHigh, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
ASSERT_NE(nullptr, bcsEngine);
EXPECT_TRUE(bcsEngine->getOsContext().isHighPriority());
result = deviceImp.getCsrForOrdinalAndIndex(&bcsEngine2, ordinalCopy, index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
result = deviceImp.getCsrForOrdinalAndIndex(&bcsEngine2, ordinalCopy, index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
ASSERT_EQ(bcsEngine2, bcsEngine->getPrimaryCsr());
EXPECT_TRUE(bcsEngine2->getOsContext().isRegular());
@@ -5097,7 +5097,7 @@ HWTEST2_F(DeviceTest, givenHpCopyEngineWhenGettingHighPriorityCsrThenCorrectCsrA
ordinal = i;
uint32_t index = 0;
auto result = deviceImp.getCsrForOrdinalAndIndex(&highPriorityCsr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, false);
auto result = deviceImp.getCsrForOrdinalAndIndex(&highPriorityCsr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, 0, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
ASSERT_NE(nullptr, highPriorityCsr);
@@ -5316,7 +5316,7 @@ TEST_F(MultiSubDeviceEnabledImplicitScalingTest, GivenEnabledImplicitScalingWhen
NEO::CommandStreamReceiver *csr = nullptr;
EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, deviceImp->getCsrForLowPriority(&csr, false));
auto ret = deviceImp->getCsrForOrdinalAndIndex(&csr, 0, 0, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW, false);
auto ret = deviceImp->getCsrForOrdinalAndIndex(&csr, 0, 0, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW, 0, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
EXPECT_EQ(defaultEngine.commandStreamReceiver, csr);
@@ -5328,7 +5328,7 @@ HWTEST2_F(MultiSubDeviceWithContextGroupAndImplicitScalingTest, GivenRootDeviceW
NEO::CommandStreamReceiver *csr = nullptr;
EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, deviceImp->getCsrForLowPriority(&csr, false));
auto ret = deviceImp->getCsrForOrdinalAndIndex(&csr, 0, 0, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW, false);
auto ret = deviceImp->getCsrForOrdinalAndIndex(&csr, 0, 0, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW, 0, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
EXPECT_EQ(defaultEngine.commandStreamReceiver, csr);
@@ -5339,7 +5339,7 @@ HWTEST2_F(MultiSubDeviceWithContextGroupAndImplicitScalingTest, GivenRootDeviceW
EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, deviceImp->getCsrForLowPriority(&csr, true));
auto ordinal = deviceImp->getCopyEngineOrdinal();
auto ret = deviceImp->getCsrForOrdinalAndIndex(&csr, ordinal, 0, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW, false);
auto ret = deviceImp->getCsrForOrdinalAndIndex(&csr, ordinal, 0, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW, 0, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
EXPECT_NE(nullptr, csr);
@@ -5352,7 +5352,7 @@ HWTEST2_F(MultiSubDeviceWithContextGroupAndImplicitScalingTest, GivenRootDeviceW
NEO::CommandStreamReceiver *csr = nullptr;
auto ordinal = deviceImp->getCopyEngineOrdinal();
auto ret = deviceImp->getCsrForOrdinalAndIndex(&csr, ordinal, 0, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, false);
auto ret = deviceImp->getCsrForOrdinalAndIndex(&csr, ordinal, 0, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, 0, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
EXPECT_NE(nullptr, csr);
@@ -6445,7 +6445,7 @@ HWTEST_F(SingleDeviceModeTests, givenContextGroupSupportedWhenGettingCsrsThenSec
uint32_t index = 0;
CommandStreamReceiver *csr = nullptr;
auto result = device->getCsrForOrdinalAndIndex(&csr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
auto result = device->getCsrForOrdinalAndIndex(&csr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
ASSERT_NE(nullptr, csr);
@@ -6462,24 +6462,24 @@ HWTEST_F(SingleDeviceModeTests, givenContextGroupSupportedWhenGettingCsrsThenSec
EXPECT_NE(nullptr, secondaryEngines.engines[highPriorityIndex].osContext->getPrimaryContext());
index = 100;
result = device->getCsrForOrdinalAndIndex(&csr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, false);
result = device->getCsrForOrdinalAndIndex(&csr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, 0, false);
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
index = 0;
ordinal = 100;
result = device->getCsrForOrdinalAndIndex(&csr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, false);
result = device->getCsrForOrdinalAndIndex(&csr, ordinal, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, 0, false);
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
NEO::CommandStreamReceiver *bcsEngine = nullptr, *bcsEngine2 = nullptr;
EXPECT_EQ(nullptr, neoMockDevice->getHpCopyEngine());
result = device->getCsrForOrdinalAndIndex(&bcsEngine, ordinalCopy, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, false);
result = device->getCsrForOrdinalAndIndex(&bcsEngine, ordinalCopy, index, ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH, 0, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
ASSERT_NE(nullptr, bcsEngine);
EXPECT_TRUE(bcsEngine->getOsContext().isHighPriority());
EXPECT_EQ(1u, bcsEngine->getOsContext().getDeviceBitfield().count());
result = device->getCsrForOrdinalAndIndex(&bcsEngine2, ordinalCopy, index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
result = device->getCsrForOrdinalAndIndex(&bcsEngine2, ordinalCopy, index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
ASSERT_EQ(bcsEngine2, bcsEngine->getPrimaryCsr());
EXPECT_TRUE(bcsEngine2->getOsContext().getIsPrimaryEngine());
@@ -6487,7 +6487,7 @@ HWTEST_F(SingleDeviceModeTests, givenContextGroupSupportedWhenGettingCsrsThenSec
EXPECT_TRUE(bcsEngine2->getOsContext().getDeviceBitfield().test(0));
bcsEngine2 = nullptr;
result = device->getCsrForOrdinalAndIndex(&bcsEngine2, ordinalCopy + 1, index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
result = device->getCsrForOrdinalAndIndex(&bcsEngine2, ordinalCopy + 1, index, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
ASSERT_NE(bcsEngine2, bcsEngine->getPrimaryCsr());
EXPECT_TRUE(bcsEngine2->getOsContext().getIsPrimaryEngine());
@@ -6885,5 +6885,58 @@ HWTEST_F(DeviceSimpleTests, givenGpuHangOnSecondaryCsrWhenSynchronizingDeviceThe
EXPECT_EQ(ZE_RESULT_ERROR_DEVICE_LOST, result);
}
HWTEST2_F(DeviceSimpleTests, givenDeviceWhenQueryingPriorityLevelsThenHighAndLowLevelsAreReturned, IsAtMostXe3Core) {
struct MockGfxCoreHelper : NEO::GfxCoreHelperHw<FamilyType> {
uint32_t getQueuePriorityLevels() const override {
return numPriorityLevels;
}
uint32_t numPriorityLevels = 1;
};
auto rootDeviceIndex = device->getNEODevice()->getRootDeviceIndex();
RAIIGfxCoreHelperFactory<MockGfxCoreHelper> raii(*device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex]);
for (int numLevels = 1; numLevels < 10; numLevels++) {
raii.mockGfxCoreHelper->numPriorityLevels = numLevels;
int highestPriorityLevel = 0;
int lowestPriorityLevel = 0;
ze_result_t returnValue = ZE_RESULT_SUCCESS;
auto l0Device = std::unique_ptr<L0::Device>(Device::create(driverHandle.get(), neoDevice, false, &returnValue));
ASSERT_NE(nullptr, l0Device);
EXPECT_EQ(ZE_RESULT_SUCCESS, l0Device->getPriorityLevels(&lowestPriorityLevel, &highestPriorityLevel));
EXPECT_EQ(numLevels, lowestPriorityLevel - highestPriorityLevel + 1);
if (numLevels == 1) {
EXPECT_EQ(0, highestPriorityLevel);
EXPECT_EQ(0, lowestPriorityLevel);
} else if (numLevels == 2) {
EXPECT_EQ(0, highestPriorityLevel);
EXPECT_EQ(1, lowestPriorityLevel);
} else if (numLevels == 3) {
EXPECT_EQ(-1, highestPriorityLevel);
EXPECT_EQ(1, lowestPriorityLevel);
} else if (numLevels == 4) {
EXPECT_EQ(-1, highestPriorityLevel);
EXPECT_EQ(2, lowestPriorityLevel);
}
}
}
HWTEST2_F(DeviceSimpleTests, givenDeviceWhenQueryingPriorityLevelsThen2LevelsAreReturned, IsAtMostXe3Core) {
int highestPriorityLevel = 0;
int lowestPriorityLevel = 0;
auto result = zeDeviceGetPriorityLevels(device, &lowestPriorityLevel, &highestPriorityLevel);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(0, highestPriorityLevel);
EXPECT_EQ(1, lowestPriorityLevel);
}
} // namespace ult
} // namespace L0

View File

@@ -3856,7 +3856,7 @@ HWTEST_F(MultipleDevicePeerAllocationTest, givenCallToMPrepareIndirectAllocation
auto svmManager = driverHandle->getSvmAllocsManager();
NEO::CommandStreamReceiver *csr0 = nullptr;
L0::DeviceImp *deviceImp0 = static_cast<L0::DeviceImp *>(device0);
auto ret = deviceImp0->getCsrForOrdinalAndIndex(&csr0, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
auto ret = deviceImp0->getCsrForOrdinalAndIndex(&csr0, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ASSERT_EQ(ret, ZE_RESULT_SUCCESS);
size_t size = 1024;
@@ -3896,7 +3896,7 @@ HWTEST_F(MultipleDevicePeerAllocationTest, whenisRemoteResourceNeededIsCalledWit
auto svmManager = driverHandle->getSvmAllocsManager();
NEO::CommandStreamReceiver *csr0 = nullptr;
L0::DeviceImp *deviceImp0 = static_cast<L0::DeviceImp *>(device0);
auto ret = deviceImp0->getCsrForOrdinalAndIndex(&csr0, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
auto ret = deviceImp0->getCsrForOrdinalAndIndex(&csr0, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ASSERT_EQ(ret, ZE_RESULT_SUCCESS);
size_t size = 1024;
@@ -3944,7 +3944,7 @@ HWTEST_F(MultipleDevicePeerAllocationTest, givenCallToMakeIndirectAllocationsRes
auto svmManager = driverHandle->getSvmAllocsManager();
NEO::CommandStreamReceiver *csr = nullptr;
L0::DeviceImp *deviceImp1 = static_cast<L0::DeviceImp *>(device1);
auto ret = deviceImp1->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
auto ret = deviceImp1->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ASSERT_EQ(ret, ZE_RESULT_SUCCESS);
// disable device usm pooling - allocation will not be pooled but pool will be initialized
@@ -3989,7 +3989,7 @@ HWTEST_F(MultipleDevicePeerAllocationTest, givenCallToMakeInternalAllocationsRes
auto svmManager = driverHandle->getSvmAllocsManager();
NEO::CommandStreamReceiver *csr = nullptr;
L0::DeviceImp *deviceImp1 = static_cast<L0::DeviceImp *>(device1);
auto ret = deviceImp1->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, false);
auto ret = deviceImp1->getCsrForOrdinalAndIndex(&csr, 0u, 0u, ZE_COMMAND_QUEUE_PRIORITY_NORMAL, 0, false);
ASSERT_EQ(ret, ZE_RESULT_SUCCESS);
// disable device usm pooling - allocation will not be pooled but pool will be initialized