Create Level Zero command queue based on queue desc ordinal (2)
Improve ULTs Related-to: NEO-4590 Change-Id: I73a554d25f1cbce93d7ed6b356a495951204d09a Signed-off: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
parent
cb8e9656ee
commit
ac443acbc9
|
@ -54,6 +54,9 @@ TEST_F(CommandQueueCreate, givenOrdinalThenQueueIsCreatedOnlyIfOrdinalIsLessThan
|
|||
ze_result_t res = device->getProperties(&deviceProperties);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
|
||||
auto expectedNumOfComputeEngines = NEO::HwHelper::getEnginesCount(device->getNEODevice()->getHardwareInfo());
|
||||
EXPECT_EQ(expectedNumOfComputeEngines, deviceProperties.numAsyncComputeEngines);
|
||||
|
||||
ze_command_queue_desc_t desc = {};
|
||||
desc.version = ZE_COMMAND_QUEUE_DESC_VERSION_CURRENT;
|
||||
desc.ordinal = deviceProperties.numAsyncComputeEngines;
|
||||
|
@ -63,22 +66,27 @@ TEST_F(CommandQueueCreate, givenOrdinalThenQueueIsCreatedOnlyIfOrdinalIsLessThan
|
|||
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, res);
|
||||
EXPECT_EQ(nullptr, commandQueue);
|
||||
|
||||
desc.ordinal = 0;
|
||||
res = device->createCommandQueue(&desc, &commandQueue);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
EXPECT_NE(nullptr, commandQueue);
|
||||
|
||||
L0::CommandQueue::fromHandle(commandQueue)->destroy();
|
||||
|
||||
const auto &hardwareInfo = neoDevice->getHardwareInfo();
|
||||
auto &hwHelper = NEO::HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
||||
|
||||
for (uint32_t i = hwHelper.internalUsageEngineIndex; i < NEO::HwHelper::getEnginesCount(hardwareInfo); i++) {
|
||||
std::vector<ze_command_queue_handle_t> commandQueueVector;
|
||||
for (uint32_t i = 0; i < expectedNumOfComputeEngines; i++) {
|
||||
desc.ordinal = i;
|
||||
res = device->createCommandQueue(&desc, &commandQueue);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
EXPECT_NE(nullptr, commandQueue);
|
||||
|
||||
commandQueueVector.push_back(commandQueue);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < expectedNumOfComputeEngines; i++) {
|
||||
for (uint32_t j = 0; j < expectedNumOfComputeEngines; j++) {
|
||||
if (i == j) {
|
||||
continue;
|
||||
}
|
||||
EXPECT_NE(static_cast<CommandQueue *>(commandQueueVector[i])->getCsr(),
|
||||
static_cast<CommandQueue *>(commandQueueVector[j])->getCsr());
|
||||
}
|
||||
}
|
||||
|
||||
for (auto commandQueue : commandQueueVector) {
|
||||
L0::CommandQueue::fromHandle(commandQueue)->destroy();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,8 +101,8 @@ TEST_F(DeviceTest, givenDeviceWithComputeEngineThenNumAsyncComputeEnginesDeviceP
|
|||
deviceProperties.numAsyncComputeEngines = std::numeric_limits<int>::max();
|
||||
device->getProperties(&deviceProperties);
|
||||
|
||||
auto expecteNumOfComputeEngines = NEO::HwHelper::getEnginesCount(device->getNEODevice()->getHardwareInfo());
|
||||
EXPECT_EQ(expecteNumOfComputeEngines, deviceProperties.numAsyncComputeEngines);
|
||||
auto expectedNumOfComputeEngines = NEO::HwHelper::getEnginesCount(device->getNEODevice()->getHardwareInfo());
|
||||
EXPECT_EQ(expectedNumOfComputeEngines, deviceProperties.numAsyncComputeEngines);
|
||||
}
|
||||
|
||||
TEST_F(DeviceTest, givenDevicePropertiesStructureWhenDevicePropertiesCalledThenAllPropertiesAreAssigned) {
|
||||
|
|
Loading…
Reference in New Issue