fix: move getProductConfigFromHwInfo to CompilerProductHelper

add tests for default PVC configs

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-04-18 08:54:04 +00:00
committed by Compute-Runtime-Automation
parent dd575008bc
commit c544004b8e
125 changed files with 456 additions and 479 deletions

View File

@@ -15,21 +15,19 @@ using namespace NEO;
HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWhenSetHwInfoGmdIdThenCorrectValueIsSet, IsAtLeastMtl) {
HardwareIpVersion aotConfig = {0};
aotConfig.value = productConfig;
MockExecutionEnvironment mockExecutionEnvironment{};
auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
compilerProductHelper.setProductConfigForHwInfo(hwInfo, aotConfig);
compilerProductHelper->setProductConfigForHwInfo(hwInfo, aotConfig);
EXPECT_EQ(hwInfo.ipVersion.architecture, aotConfig.architecture);
EXPECT_EQ(hwInfo.ipVersion.release, aotConfig.release);
EXPECT_EQ(hwInfo.ipVersion.revision, aotConfig.revision);
auto ret = productHelper->getHwIpVersion(hwInfo);
auto ret = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(ret, productConfig);
}
HWTEST2_P(ProductConfigHwInfoTests, givenUnknownAotConfigWhenGetProductConfigThenUnknownIsaIsReturned, IsAtLeastMtl) {
hwInfo.ipVersion = {};
auto ret = productHelper->getHwIpVersion(hwInfo);
auto ret = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(ret, AOT::UNKNOWN_ISA);
}
@@ -39,14 +37,14 @@ HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWhenGetProductConfigThenCorrec
hwInfo.ipVersion.architecture = aotConfig.architecture;
hwInfo.ipVersion.release = aotConfig.release;
hwInfo.ipVersion.revision = aotConfig.revision;
auto ret = productHelper->getHwIpVersion(hwInfo);
auto ret = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(ret, productConfig);
}
TEST(ProductConfigHwInfoTest, givenDefaultAotConfigWhenGetProductConfigThenSameValueIsReturned) {
MockExecutionEnvironment mockExecutionEnvironment{};
auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<ProductHelper>();
auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
auto hwInfo = *defaultHwInfo;
auto ret = productHelper.getHwIpVersion(hwInfo);
auto ret = compilerProductHelper.getHwIpVersion(hwInfo);
EXPECT_EQ(ret, hwInfo.ipVersion.value);
}