mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Refactor: Update Device::engineGroups to store only available engine groups
Simplify logic around engine groups. Remove no longer needed code. Related-To: NEO-6219 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
133e13b319
commit
4461b8ea3f
@@ -379,18 +379,13 @@ void ClDevice::initializeCaps() {
|
||||
}
|
||||
}
|
||||
|
||||
const auto &queueFamilies = this->getDevice().getEngineGroups();
|
||||
for (size_t queueFamilyIndex = 0u; queueFamilyIndex < CommonConstants::engineGroupCount; queueFamilyIndex++) {
|
||||
const std::vector<EngineControl> &enginesInFamily = queueFamilies[queueFamilyIndex];
|
||||
if (enginesInFamily.size() > 0) {
|
||||
const auto engineGroupType = static_cast<EngineGroupType>(queueFamilyIndex);
|
||||
cl_queue_family_properties_intel properties = {};
|
||||
properties.capabilities = getQueueFamilyCapabilities(engineGroupType);
|
||||
properties.count = static_cast<cl_uint>(enginesInFamily.size());
|
||||
properties.properties = deviceInfo.queueOnHostProperties;
|
||||
getQueueFamilyName(properties.name, engineGroupType);
|
||||
deviceInfo.queueFamilyProperties.push_back(properties);
|
||||
}
|
||||
for (auto &engineGroup : this->getDevice().getEngineGroups()) {
|
||||
cl_queue_family_properties_intel properties = {};
|
||||
properties.capabilities = getQueueFamilyCapabilities(engineGroup.engineGroupType);
|
||||
properties.count = static_cast<cl_uint>(engineGroup.engines.size());
|
||||
properties.properties = deviceInfo.queueOnHostProperties;
|
||||
getQueueFamilyName(properties.name, engineGroup.engineGroupType);
|
||||
deviceInfo.queueFamilyProperties.push_back(properties);
|
||||
}
|
||||
auto &clHwHelper = NEO::ClHwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
const std::vector<uint32_t> &supportedThreadArbitrationPolicies = clHwHelper.getSupportedThreadArbitrationPolicies();
|
||||
|
||||
@@ -668,7 +668,7 @@ cl_uint CommandQueue::getQueueFamilyIndex() const {
|
||||
const auto &hwInfo = device->getHardwareInfo();
|
||||
const auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
const auto engineGroupType = hwHelper.getEngineGroupType(gpgpuEngine->getEngineType(), gpgpuEngine->getEngineUsage(), hwInfo);
|
||||
const auto familyIndex = device->getDevice().getIndexOfNonEmptyEngineGroup(engineGroupType);
|
||||
const auto familyIndex = device->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroupType);
|
||||
return static_cast<cl_uint>(familyIndex);
|
||||
}
|
||||
}
|
||||
@@ -903,8 +903,7 @@ void CommandQueue::processProperties(const cl_queue_properties *properties) {
|
||||
if (specificEngineSelected) {
|
||||
this->queueFamilySelected = true;
|
||||
if (!getDevice().hasRootCsr()) {
|
||||
auto queueFamily = getDevice().getNonEmptyEngineGroup(selectedQueueFamilyIndex);
|
||||
const auto &engine = queueFamily->at(selectedQueueIndex);
|
||||
const auto &engine = getDevice().getEngineGroups()[selectedQueueFamilyIndex].engines[selectedQueueIndex];
|
||||
auto engineType = engine.getEngineType();
|
||||
auto engineUsage = engine.getEngineUsage();
|
||||
this->overrideEngine(engineType, engineUsage);
|
||||
|
||||
@@ -1348,7 +1348,7 @@ struct CsrSelectionCommandQueueTests : ::testing::Test {
|
||||
cl_command_queue_properties queueProperties[5] = {};
|
||||
if (selectBlitterWithQueueFamilies) {
|
||||
queueProperties[0] = CL_QUEUE_FAMILY_INTEL;
|
||||
queueProperties[1] = device->getIndexOfNonEmptyEngineGroup(EngineGroupType::Copy);
|
||||
queueProperties[1] = device->getEngineGroupIndexFromEngineGroupType(EngineGroupType::Copy);
|
||||
queueProperties[2] = CL_QUEUE_INDEX_INTEL;
|
||||
queueProperties[3] = 0;
|
||||
}
|
||||
@@ -2032,7 +2032,7 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenNotInitializedRcsOsContextWhenC
|
||||
OsContext &osContext = *context.getDevice(0)->getEngine(aub_stream::ENGINE_CCS, EngineUsage::Regular).osContext;
|
||||
EXPECT_FALSE(osContext.isInitialized());
|
||||
|
||||
const auto ccsFamilyIndex = static_cast<cl_uint>(context.getDevice(0)->getDevice().getIndexOfNonEmptyEngineGroup(EngineGroupType::Compute));
|
||||
const auto ccsFamilyIndex = static_cast<cl_uint>(context.getDevice(0)->getDevice().getEngineGroupIndexFromEngineGroupType(EngineGroupType::Compute));
|
||||
fillProperties(properties, ccsFamilyIndex, 0);
|
||||
MockCommandQueueHw<FamilyType> queue(&context, context.getDevice(0), properties);
|
||||
ASSERT_EQ(&osContext, queue.gpgpuEngine->osContext);
|
||||
@@ -2053,7 +2053,7 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenNotInitializedCcsOsContextWhenC
|
||||
OsContext &osContext = *context.getDevice(0)->getEngine(aub_stream::ENGINE_RCS, EngineUsage::Regular).osContext;
|
||||
EXPECT_FALSE(osContext.isInitialized());
|
||||
|
||||
const auto rcsFamilyIndex = static_cast<cl_uint>(context.getDevice(0)->getDevice().getIndexOfNonEmptyEngineGroup(EngineGroupType::RenderCompute));
|
||||
const auto rcsFamilyIndex = static_cast<cl_uint>(context.getDevice(0)->getDevice().getEngineGroupIndexFromEngineGroupType(EngineGroupType::RenderCompute));
|
||||
fillProperties(properties, rcsFamilyIndex, 0);
|
||||
MockCommandQueueHw<FamilyType> queue(&context, context.getDevice(0), properties);
|
||||
ASSERT_EQ(&osContext, queue.gpgpuEngine->osContext);
|
||||
@@ -2107,12 +2107,13 @@ struct CopyOnlyQueueTests : ::testing::Test {
|
||||
typeUsageRcs.first = EngineHelpers::remapEngineTypeToHwSpecific(typeUsageRcs.first, *defaultHwInfo);
|
||||
|
||||
auto device = MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get());
|
||||
if (device->engineGroups[static_cast<uint32_t>(EngineGroupType::Copy)].empty()) {
|
||||
auto copyEngineGroup = std::find_if(device->engineGroups.begin(), device->engineGroups.end(), [](const auto &engineGroup) {
|
||||
return engineGroup.engineGroupType == EngineGroupType::Copy;
|
||||
});
|
||||
if (copyEngineGroup == device->engineGroups.end()) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
for (auto &engineGroup : device->engineGroups) {
|
||||
engineGroup.clear();
|
||||
}
|
||||
device->engineGroups.clear();
|
||||
device->engines.clear();
|
||||
|
||||
device->createEngine(0, typeUsageRcs);
|
||||
@@ -2123,7 +2124,7 @@ struct CopyOnlyQueueTests : ::testing::Test {
|
||||
|
||||
context = std::make_unique<MockContext>(clDevice.get());
|
||||
|
||||
properties[1] = device->getIndexOfNonEmptyEngineGroup(EngineGroupType::Copy);
|
||||
properties[1] = device->getEngineGroupIndexFromEngineGroupType(EngineGroupType::Copy);
|
||||
}
|
||||
|
||||
EngineTypeUsage typeUsageBcs = EngineTypeUsage{aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular};
|
||||
@@ -2211,7 +2212,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, MultiEngineQueueHwTests, givenQueueFamilyPropertyWh
|
||||
};
|
||||
auto addTestValueIfAvailable = [&](std::vector<CommandQueueTestValues> &vec, EngineGroupType engineGroup, cl_queue_properties queueIndex, aub_stream::EngineType engineType, bool csEnabled) {
|
||||
if (csEnabled) {
|
||||
const auto familyIndex = device->getDevice().getIndexOfNonEmptyEngineGroup(engineGroup);
|
||||
const auto familyIndex = device->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroup);
|
||||
vec.push_back(CommandQueueTestValues(static_cast<cl_queue_properties>(familyIndex), queueIndex, engineType));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -137,7 +137,7 @@ TEST_F(GetCommandQueueFamilyInfoTests, givenQueueFamilyNotSelectedWhenGettingFam
|
||||
const auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
const auto engineGroupType = hwHelper.getEngineGroupType(context.getDevice(0)->getDefaultEngine().getEngineType(),
|
||||
context.getDevice(0)->getDefaultEngine().getEngineUsage(), hwInfo);
|
||||
const auto expectedFamilyIndex = context.getDevice(0)->getDevice().getIndexOfNonEmptyEngineGroup(engineGroupType);
|
||||
const auto expectedFamilyIndex = context.getDevice(0)->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroupType);
|
||||
|
||||
cl_uint familyIndex{};
|
||||
retVal = queue.getCommandQueueInfo(
|
||||
@@ -191,7 +191,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, GetCommandQueueFamilyInfoTests, givenFamilyIdWhenGe
|
||||
|
||||
const cl_device_id deviceId = &mockClDevice;
|
||||
auto context = clCreateContext(nullptr, 1, &deviceId, nullptr, nullptr, nullptr);
|
||||
auto ccsFamily = mockClDevice.getDevice().getIndexOfNonEmptyEngineGroup(EngineGroupType::Compute);
|
||||
auto ccsFamily = mockClDevice.getDevice().getEngineGroupIndexFromEngineGroupType(EngineGroupType::Compute);
|
||||
cl_command_queue_properties properties[] = {CL_QUEUE_FAMILY_INTEL, ccsFamily, CL_QUEUE_INDEX_INTEL, 0, 0};
|
||||
EXPECT_EQ(0u, mockClDevice.getNumGenericSubDevices());
|
||||
auto commandQueue = clCreateCommandQueueWithProperties(context, deviceId, properties, nullptr);
|
||||
@@ -252,7 +252,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, MultiEngineQueueHwTests, givenLimitedNumberOfCcsWhe
|
||||
|
||||
const uint32_t ccsCount = 4;
|
||||
|
||||
auto ccsEngine = device->getDevice().getIndexOfNonEmptyEngineGroup(EngineGroupType::Compute);
|
||||
auto ccsEngine = device->getDevice().getEngineGroupIndexFromEngineGroupType(EngineGroupType::Compute);
|
||||
cl_queue_properties properties[5] = {CL_QUEUE_FAMILY_INTEL, ccsEngine, CL_QUEUE_INDEX_INTEL, 0, 0};
|
||||
|
||||
auto mutableHwInfo = device->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
|
||||
@@ -525,12 +525,33 @@ TEST(DeviceCreation, givenDeviceWhenCheckingParentDeviceThenCorrectValueIsReturn
|
||||
}
|
||||
|
||||
TEST(DeviceCreation, givenRootDeviceWithSubDevicesWhenCheckingEngineGroupsThenItHasOneNonEmptyGroup) {
|
||||
static_assert(sizeof(Device::EngineGroupsT) == sizeof(std::vector<EngineControl>) * static_cast<size_t>(EngineGroupType::MaxEngineGroups),
|
||||
"Expect size of EngineGroupsT to match EngineGroupType::MaxEngineGroups");
|
||||
|
||||
UltDeviceFactory deviceFactory{1, 2};
|
||||
EXPECT_NE(nullptr, deviceFactory.rootDevices[0]->getNonEmptyEngineGroup(0));
|
||||
EXPECT_EQ(nullptr, deviceFactory.rootDevices[0]->getNonEmptyEngineGroup(1));
|
||||
EXPECT_EQ(1u, deviceFactory.rootDevices[0]->getEngineGroups().size());
|
||||
}
|
||||
|
||||
TEST(DeviceCreation, whenCheckingEngineGroupsThenGroupsAreUnique) {
|
||||
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
|
||||
defaultHwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4;
|
||||
|
||||
for (auto ftrGpGpuMidThreadLevelPreempt : ::testing::Bool()) {
|
||||
defaultHwInfo->featureTable.flags.ftrGpGpuMidThreadLevelPreempt = ftrGpGpuMidThreadLevelPreempt;
|
||||
for (auto blitterOperationsSupported : ::testing::Bool()) {
|
||||
defaultHwInfo->capabilityTable.blitterOperationsSupported = blitterOperationsSupported;
|
||||
for (auto ftrRcsNode : ::testing::Bool()) {
|
||||
defaultHwInfo->featureTable.flags.ftrRcsNode = ftrRcsNode;
|
||||
for (auto ftrCCSNode : ::testing::Bool()) {
|
||||
defaultHwInfo->featureTable.flags.ftrCCSNode = ftrCCSNode;
|
||||
|
||||
UltDeviceFactory deviceFactory{1, 0};
|
||||
std::set<EngineGroupType> uniqueEngineGroupTypes;
|
||||
for (auto &engineGroup : deviceFactory.rootDevices[0]->getEngineGroups()) {
|
||||
uniqueEngineGroupTypes.insert(engineGroup.engineGroupType);
|
||||
}
|
||||
EXPECT_EQ(uniqueEngineGroupTypes.size(), deviceFactory.rootDevices[0]->getEngineGroups().size());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
using DeviceHwTest = ::testing::Test;
|
||||
@@ -591,7 +612,7 @@ HWTEST_F(DeviceHwTest, givenDeviceCreationWhenCsrFailsToCreateGlobalSyncAllocati
|
||||
EXPECT_EQ(nullptr, mockDevice);
|
||||
}
|
||||
|
||||
HWTEST_F(DeviceHwTest, givenBothCcsAndRcsEnginesInDeviceWhenGettingFirstEngineGroupsThenReturnCcs) {
|
||||
HWTEST_F(DeviceHwTest, givenBothCcsAndRcsEnginesInDeviceWhenGettingEngineGroupsThenReturnInCorrectOrder) {
|
||||
struct MyHwHelper : HwHelperHw<FamilyType> {
|
||||
EngineGroupType getEngineGroupType(aub_stream::EngineType engineType, EngineUsage engineUsage, const HardwareInfo &hwInfo) const override {
|
||||
if (engineType == aub_stream::ENGINE_RCS) {
|
||||
@@ -612,13 +633,27 @@ HWTEST_F(DeviceHwTest, givenBothCcsAndRcsEnginesInDeviceWhenGettingFirstEngineGr
|
||||
EngineControl ccsEngine{nullptr, &ccsContext};
|
||||
|
||||
MockDevice device{};
|
||||
ASSERT_EQ(nullptr, device.getNonEmptyEngineGroup(0u));
|
||||
ASSERT_EQ(0u, device.getEngineGroups().size());
|
||||
device.addEngineToEngineGroup(ccsEngine);
|
||||
device.addEngineToEngineGroup(rcsEngine);
|
||||
auto &engineGroups = device.getEngineGroups();
|
||||
EXPECT_EQ(1u, engineGroups[0].engines.size());
|
||||
EXPECT_EQ(EngineGroupType::Compute, engineGroups[0].engineGroupType);
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_CCS, engineGroups[0].engines[0].getEngineType());
|
||||
EXPECT_EQ(1u, engineGroups[1].engines.size());
|
||||
EXPECT_EQ(EngineGroupType::RenderCompute, engineGroups[1].engineGroupType);
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_RCS, engineGroups[1].engines[0].getEngineType());
|
||||
|
||||
device.getEngineGroups().clear();
|
||||
device.addEngineToEngineGroup(rcsEngine);
|
||||
device.addEngineToEngineGroup(ccsEngine);
|
||||
|
||||
const auto firstGroup = device.getNonEmptyEngineGroup(0u);
|
||||
EXPECT_EQ(1u, firstGroup->size());
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_CCS, firstGroup->at(0).getEngineType());
|
||||
engineGroups = device.getEngineGroups();
|
||||
EXPECT_EQ(1u, engineGroups[0].engines.size());
|
||||
EXPECT_EQ(EngineGroupType::RenderCompute, engineGroups[0].engineGroupType);
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_RCS, engineGroups[0].engines[0].getEngineType());
|
||||
EXPECT_EQ(1u, engineGroups[1].engines.size());
|
||||
EXPECT_EQ(EngineGroupType::Compute, engineGroups[1].engineGroupType);
|
||||
EXPECT_EQ(aub_stream::EngineType::ENGINE_CCS, engineGroups[1].engines[0].getEngineType());
|
||||
}
|
||||
|
||||
TEST(DeviceGetEngineTest, givenHwCsrModeWhenGetEngineThenDedicatedForInternalUsageEngineIsReturned) {
|
||||
@@ -644,79 +679,21 @@ TEST(DeviceGetEngineTest, givenCreatedDeviceWhenRetrievingDefaultEngineThenOsCon
|
||||
EXPECT_TRUE(defaultEngine.osContext->isDefaultContext());
|
||||
}
|
||||
|
||||
TEST(DeviceGetEngineTest, givenNoEmptyGroupsWhenGettingNonEmptyGroupsThenReturnCorrectResults) {
|
||||
TEST(DeviceGetEngineTest, givenVariousIndicesWhenGettingEngineGroupIndexFromEngineGroupTypeThenReturnCorrectResults) {
|
||||
const auto nonEmptyEngineGroup = std::vector<EngineControl>{EngineControl{nullptr, nullptr}};
|
||||
|
||||
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
|
||||
auto &engineGroups = device->getEngineGroups();
|
||||
for (auto &engineGroup : engineGroups) {
|
||||
engineGroup.clear();
|
||||
}
|
||||
engineGroups[0] = nonEmptyEngineGroup;
|
||||
engineGroups[1] = nonEmptyEngineGroup;
|
||||
engineGroups[2] = nonEmptyEngineGroup;
|
||||
engineGroups.resize(3);
|
||||
engineGroups[0].engineGroupType = static_cast<EngineGroupType>(4);
|
||||
engineGroups[1].engineGroupType = static_cast<EngineGroupType>(3);
|
||||
engineGroups[2].engineGroupType = static_cast<EngineGroupType>(2);
|
||||
|
||||
EXPECT_EQ(&engineGroups[0], device->getNonEmptyEngineGroup(0));
|
||||
EXPECT_EQ(&engineGroups[1], device->getNonEmptyEngineGroup(1));
|
||||
EXPECT_EQ(&engineGroups[2], device->getNonEmptyEngineGroup(2));
|
||||
EXPECT_EQ(nullptr, device->getNonEmptyEngineGroup(3));
|
||||
}
|
||||
|
||||
TEST(DeviceGetEngineTest, givenEmptyGroupsWhenGettingNonEmptyGroupsThenReturnCorrectResults) {
|
||||
const auto emptyEngineGroup = std::vector<EngineControl>{};
|
||||
const auto nonEmptyEngineGroup = std::vector<EngineControl>{EngineControl{nullptr, nullptr}};
|
||||
|
||||
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
|
||||
auto &engineGroups = device->getEngineGroups();
|
||||
for (auto &engineGroup : engineGroups) {
|
||||
engineGroup.clear();
|
||||
}
|
||||
engineGroups[0] = nonEmptyEngineGroup;
|
||||
engineGroups[1] = emptyEngineGroup;
|
||||
engineGroups[2] = nonEmptyEngineGroup;
|
||||
|
||||
EXPECT_EQ(&engineGroups[0], device->getNonEmptyEngineGroup(0));
|
||||
EXPECT_EQ(&engineGroups[2], device->getNonEmptyEngineGroup(1));
|
||||
EXPECT_EQ(nullptr, device->getNonEmptyEngineGroup(2));
|
||||
}
|
||||
|
||||
TEST(DeviceGetEngineTest, givenNoEmptyGroupsWhenGettingNonEmptyGroupIndexThenReturnCorrectResults) {
|
||||
const auto nonEmptyEngineGroup = std::vector<EngineControl>{EngineControl{nullptr, nullptr}};
|
||||
|
||||
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
|
||||
auto &engineGroups = device->getEngineGroups();
|
||||
for (auto &engineGroup : engineGroups) {
|
||||
engineGroup.clear();
|
||||
}
|
||||
engineGroups[0] = nonEmptyEngineGroup;
|
||||
engineGroups[1] = nonEmptyEngineGroup;
|
||||
engineGroups[2] = nonEmptyEngineGroup;
|
||||
|
||||
EXPECT_EQ(0u, device->getIndexOfNonEmptyEngineGroup(static_cast<EngineGroupType>(0u)));
|
||||
EXPECT_EQ(1u, device->getIndexOfNonEmptyEngineGroup(static_cast<EngineGroupType>(1u)));
|
||||
EXPECT_EQ(2u, device->getIndexOfNonEmptyEngineGroup(static_cast<EngineGroupType>(2u)));
|
||||
EXPECT_ANY_THROW(device->getIndexOfNonEmptyEngineGroup(static_cast<EngineGroupType>(3u)));
|
||||
EXPECT_ANY_THROW(device->getIndexOfNonEmptyEngineGroup(static_cast<EngineGroupType>(4u)));
|
||||
}
|
||||
|
||||
TEST(DeviceGetEngineTest, givenEmptyGroupsWhenGettingNonEmptyGroupIndexThenReturnCorrectResults) {
|
||||
const auto emptyEngineGroup = std::vector<EngineControl>{};
|
||||
const auto nonEmptyEngineGroup = std::vector<EngineControl>{EngineControl{nullptr, nullptr}};
|
||||
|
||||
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
|
||||
auto &engineGroups = device->getEngineGroups();
|
||||
for (auto &engineGroup : engineGroups) {
|
||||
engineGroup.clear();
|
||||
}
|
||||
engineGroups[0] = nonEmptyEngineGroup;
|
||||
engineGroups[1] = emptyEngineGroup;
|
||||
engineGroups[2] = nonEmptyEngineGroup;
|
||||
|
||||
EXPECT_EQ(0u, device->getIndexOfNonEmptyEngineGroup(static_cast<EngineGroupType>(0u)));
|
||||
EXPECT_ANY_THROW(device->getIndexOfNonEmptyEngineGroup(static_cast<EngineGroupType>(1u)));
|
||||
EXPECT_EQ(1u, device->getIndexOfNonEmptyEngineGroup(static_cast<EngineGroupType>(2u)));
|
||||
EXPECT_ANY_THROW(device->getIndexOfNonEmptyEngineGroup(static_cast<EngineGroupType>(3u)));
|
||||
EXPECT_ANY_THROW(device->getIndexOfNonEmptyEngineGroup(static_cast<EngineGroupType>(4u)));
|
||||
EXPECT_EQ(0u, device->getEngineGroupIndexFromEngineGroupType(static_cast<EngineGroupType>(4u)));
|
||||
EXPECT_EQ(1u, device->getEngineGroupIndexFromEngineGroupType(static_cast<EngineGroupType>(3u)));
|
||||
EXPECT_EQ(2u, device->getEngineGroupIndexFromEngineGroupType(static_cast<EngineGroupType>(2u)));
|
||||
EXPECT_ANY_THROW(device->getEngineGroupIndexFromEngineGroupType(static_cast<EngineGroupType>(1u)));
|
||||
EXPECT_ANY_THROW(device->getEngineGroupIndexFromEngineGroupType(static_cast<EngineGroupType>(0u)));
|
||||
}
|
||||
|
||||
TEST(DeviceGetEngineTest, givenDeferredContextInitializationEnabledWhenCreatingEnginesThenInitializeOnlyOsContextsWhichRequireIt) {
|
||||
|
||||
@@ -981,8 +981,8 @@ HWTEST_F(EngineInstancedDeviceTests, whenCreateMultipleCommandQueuesThenEnginesA
|
||||
const auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
const auto engineGroupType = hwHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hwInfo);
|
||||
|
||||
auto defaultEngineGroupIndex = clRootDevice->getDevice().getIndexOfNonEmptyEngineGroup(engineGroupType);
|
||||
auto engines = clRootDevice->getDevice().getEngineGroups()[defaultEngineGroupIndex];
|
||||
auto defaultEngineGroupIndex = clRootDevice->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroupType);
|
||||
auto engines = clRootDevice->getDevice().getEngineGroups()[defaultEngineGroupIndex].engines;
|
||||
|
||||
for (size_t i = 0; i < cmdQs.size(); i++) {
|
||||
auto engineIndex = i % engines.size();
|
||||
|
||||
@@ -1348,7 +1348,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenBcsQueueWhenEnqueueingCopyBufferToBuffer
|
||||
|
||||
cl_command_queue_properties properties[] = {
|
||||
CL_QUEUE_FAMILY_INTEL,
|
||||
device->getDevice().getIndexOfNonEmptyEngineGroup(EngineGroupType::Copy),
|
||||
device->getDevice().getEngineGroupIndexFromEngineGroupType(EngineGroupType::Copy),
|
||||
CL_QUEUE_INDEX_INTEL,
|
||||
0,
|
||||
0,
|
||||
|
||||
Reference in New Issue
Block a user