mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
Unify definition of hardware ip version
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
103f522f18
commit
23fd280334
@@ -60,8 +60,8 @@ TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenChooseItA
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
NEO::HardwareIpVersion aotConfig = {0};
|
||||
aotConfig.value = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
NEO::Ar::ArEncoder encoder;
|
||||
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
|
||||
@@ -101,8 +101,8 @@ TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenPackedTar
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
NEO::HardwareIpVersion aotConfig = {0};
|
||||
aotConfig.value = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
NEO::Ar::ArEncoder encoder;
|
||||
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
|
||||
@@ -132,8 +132,8 @@ TEST(UnpackSingleDeviceBinaryAr, WhenMultipleBinariesMatchedThenChooseBestMatch)
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
NEO::HardwareIpVersion aotConfig = {0};
|
||||
aotConfig.value = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
NEO::Ar::ArEncoder encoder;
|
||||
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
|
||||
@@ -148,7 +148,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenMultipleBinariesMatchedThenChooseBestMatch)
|
||||
|
||||
NEO::TargetDevice target;
|
||||
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
|
||||
target.aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
target.aotConfig.value = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
target.stepping = programTokens.header->SteppingId;
|
||||
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
|
||||
|
||||
@@ -241,8 +241,8 @@ TEST(UnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithProductConfigThenTry
|
||||
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
NEO::HardwareIpVersion aotConfig = {0};
|
||||
aotConfig.value = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
|
||||
|
||||
@@ -259,7 +259,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithProductConfigThenTry
|
||||
|
||||
NEO::TargetDevice target;
|
||||
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
|
||||
target.aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
target.aotConfig.value = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
target.stepping = programTokens.header->SteppingId;
|
||||
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
|
||||
|
||||
@@ -349,8 +349,8 @@ TEST(UnpackSingleDeviceBinaryAr, WhenDeviceBinaryNotMatchedButIrWithProductConfi
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
NEO::HardwareIpVersion aotConfig = {0};
|
||||
aotConfig.value = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
|
||||
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
|
||||
@@ -369,7 +369,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenDeviceBinaryNotMatchedButIrWithProductConfi
|
||||
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
|
||||
target.stepping = programTokens.header->SteppingId;
|
||||
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
|
||||
target.aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
target.aotConfig.value = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
auto arData = encoder.encode();
|
||||
std::string unpackErrors;
|
||||
@@ -573,8 +573,8 @@ TEST(UnpackSingleDeviceBinaryAr, WhenCouldNotFindBinaryWithRightPointerSizeThenU
|
||||
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
NEO::HardwareIpVersion aotConfig = {0};
|
||||
aotConfig.value = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
|
||||
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
|
||||
|
||||
@@ -39,7 +39,7 @@ struct ProductConfigHwInfoTests : public ProductConfigTest<::testing::TestWithPa
|
||||
}
|
||||
}
|
||||
PRODUCT_FAMILY prod = IGFX_UNKNOWN;
|
||||
const AheadOfTimeConfig invalidConfig = {CommonConstants::invalidRevisionID};
|
||||
const HardwareIpVersion invalidConfig = {CommonConstants::invalidRevisionID};
|
||||
};
|
||||
|
||||
using ProductConfigTests = ProductConfigTest<::testing::Test>;
|
||||
|
||||
@@ -49,10 +49,10 @@ HWTEST2_F(CompilerProductHelperFixture, givenAotConfigWhenSetHwInfoRevisionIdThe
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
auto productConfig = productHelper.getProductConfigFromHwInfo(*defaultHwInfo);
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = productConfig;
|
||||
HardwareIpVersion aotConfig = {0};
|
||||
aotConfig.value = productConfig;
|
||||
CompilerProductHelper::get(hwInfo.platform.eProductFamily)->setProductConfigForHwInfo(hwInfo, aotConfig);
|
||||
EXPECT_EQ(hwInfo.platform.usRevId, aotConfig.ProductConfigID.Revision);
|
||||
EXPECT_EQ(hwInfo.platform.usRevId, aotConfig.revision);
|
||||
}
|
||||
|
||||
HWTEST2_F(CompilerProductHelperFixture, givenAtMostXeHPWhenGetCachingPolicyOptionsThenReturnNullptr, IsAtMostXeHpCore) {
|
||||
|
||||
@@ -241,7 +241,7 @@ TEST_F(AotDeviceInfoTests, givenProductOrAotConfigWhenParseMajorMinorRevisionVal
|
||||
}
|
||||
|
||||
for (const auto &device : enabledDeviceConfigs) {
|
||||
auto productConfig = static_cast<AOT::PRODUCT_CONFIG>(device.aotConfig.ProductConfig);
|
||||
auto productConfig = static_cast<AOT::PRODUCT_CONFIG>(device.aotConfig.value);
|
||||
auto configStr0 = ProductConfigHelper::parseMajorMinorRevisionValue(productConfig);
|
||||
auto configStr1 = ProductConfigHelper::parseMajorMinorRevisionValue(device.aotConfig);
|
||||
EXPECT_STREQ(configStr0.c_str(), configStr1.c_str());
|
||||
@@ -268,7 +268,7 @@ TEST_F(AotDeviceInfoTests, givenProductConfigAcronymWhenCheckAllEnabledThenCorre
|
||||
EXPECT_TRUE(acronymFound);
|
||||
|
||||
device.acronyms.clear();
|
||||
device.aotConfig.ProductConfig = AOT::UNKNOWN_ISA;
|
||||
device.aotConfig.value = AOT::UNKNOWN_ISA;
|
||||
|
||||
enabledAcronyms = productConfigHelper->getAllProductAcronyms();
|
||||
acronymFound = std::any_of(enabledAcronyms.begin(), enabledAcronyms.end(), findAcronym(acronym));
|
||||
@@ -425,7 +425,7 @@ TEST_F(AotDeviceInfoTests, givenNotFullConfigWhenGetProductConfigThenUnknownIsaI
|
||||
}
|
||||
auto aotConfig = allEnabledDeviceConfigs[0].aotConfig;
|
||||
std::stringstream majorString;
|
||||
majorString << aotConfig.ProductConfigID.Major;
|
||||
majorString << aotConfig.architecture;
|
||||
auto major = majorString.str();
|
||||
|
||||
auto aotValue0 = ProductConfigHelper::getProductConfigForVersionValue(major);
|
||||
@@ -481,7 +481,7 @@ TEST_F(AotDeviceInfoTests, givenProductConfigWhenGetDeviceAotInfoThenCorrectValu
|
||||
DeviceAotInfo aotInfo{};
|
||||
|
||||
for (auto &product : enabledProducts) {
|
||||
auto productConfig = static_cast<AOT::PRODUCT_CONFIG>(product.aotConfig.ProductConfig);
|
||||
auto productConfig = static_cast<AOT::PRODUCT_CONFIG>(product.aotConfig.value);
|
||||
EXPECT_TRUE(productConfigHelper->getDeviceAotInfoForProductConfig(productConfig, aotInfo));
|
||||
EXPECT_TRUE(aotInfo == product);
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ PVCTEST_F(PvcUnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithPvcProductCo
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
PatchTokensTestData::ValidEmptyProgram programTokensWrongTokenVersion;
|
||||
|
||||
AheadOfTimeConfig aotConfig0{}, aotConfig1{};
|
||||
aotConfig0.ProductConfig = AOT::PVC_XL_A0;
|
||||
aotConfig1.ProductConfig = AOT::PVC_XL_A0P;
|
||||
NEO::HardwareIpVersion aotConfig0{}, aotConfig1{};
|
||||
aotConfig0.value = AOT::PVC_XL_A0;
|
||||
aotConfig1.value = AOT::PVC_XL_A0P;
|
||||
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig0);
|
||||
std::string anotherProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig1);
|
||||
|
||||
@@ -74,10 +74,10 @@ PVCTEST_F(PvcProductHelperLinux, givenProductHelperWhenAskedIfPatIndexProgrammin
|
||||
|
||||
PVCTEST_F(PvcProductHelperLinux, givenAotConfigWhenSetHwInfoRevisionIdForPvcThenCorrectValueIsSet) {
|
||||
for (const auto &config : AOT_PVC::productConfigs) {
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = config;
|
||||
HardwareIpVersion aotConfig = {0};
|
||||
aotConfig.value = config;
|
||||
CompilerProductHelper::get(pInHwInfo.platform.eProductFamily)->setProductConfigForHwInfo(pInHwInfo, aotConfig);
|
||||
EXPECT_EQ(pInHwInfo.platform.usRevId, aotConfig.ProductConfigID.Revision);
|
||||
EXPECT_EQ(pInHwInfo.platform.usRevId, aotConfig.revision);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@ DG2TEST_F(Dg2UnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithDg2ProductCo
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
PatchTokensTestData::ValidEmptyProgram programTokensWrongTokenVersion;
|
||||
|
||||
AheadOfTimeConfig aotConfig0{}, aotConfig1{};
|
||||
aotConfig0.ProductConfig = AOT::DG2_G10_A0;
|
||||
aotConfig1.ProductConfig = AOT::DG2_G10_B0;
|
||||
NEO::HardwareIpVersion aotConfig0{}, aotConfig1{};
|
||||
aotConfig0.value = AOT::DG2_G10_A0;
|
||||
aotConfig1.value = AOT::DG2_G10_B0;
|
||||
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig0);
|
||||
std::string anotherProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig1);
|
||||
|
||||
Reference in New Issue
Block a user