mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
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:
committed by
Compute-Runtime-Automation
parent
dd575008bc
commit
c544004b8e
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user