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

@@ -14,8 +14,6 @@
#include "shared/source/os_interface/product_helper.h"
#include "shared/source/os_interface/product_helper_hw.h"
#include "platforms.h"
namespace NEO {
template <>
@@ -119,11 +117,6 @@ uint32_t ProductHelperHw<IGFX_UNKNOWN>::getHwRevIdFromStepping(uint32_t stepping
return CommonConstants::invalidStepping;
}
template <>
uint32_t ProductHelperHw<IGFX_UNKNOWN>::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const {
return AOT::UNKNOWN_ISA;
}
template <>
uint32_t ProductHelperHw<IGFX_UNKNOWN>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
return CommonConstants::invalidStepping;

View File

@@ -40,7 +40,6 @@ void adjustHwInfoForTests(HardwareInfo &hwInfoForTests, uint32_t euPerSubSlice,
gtSystemInfo.MaxSlicesSupported = std::max(gtSystemInfo.MaxSlicesSupported, gtSystemInfo.SliceCount);
gtSystemInfo.MaxSubSlicesSupported = std::max(gtSystemInfo.MaxSubSlicesSupported, gtSystemInfo.SubSliceCount);
auto productHelper = ProductHelper::create(hwInfoForTests.platform.eProductFamily);
hwInfoForTests.ipVersion.value = productHelper->getHwIpVersion(hwInfoForTests);
hwInfoForTests.ipVersion.value = compilerProductHelper->getHwIpVersion(hwInfoForTests);
}
} // namespace NEO

View File

@@ -60,10 +60,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenFailedToFindMatchingBinariesThenUnpackingFa
TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenChooseItAsABestMatch) {
PatchTokensTestData::ValidEmptyProgram programTokens;
NEO::MockExecutionEnvironment mockExecutionEnvironment{};
const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::CompilerProductHelper>();
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
NEO::HardwareIpVersion aotConfig = {0};
aotConfig.value = productHelper.getHwIpVersion(hwInfo);
aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo);
NEO::Ar::ArEncoder encoder;
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
@@ -102,10 +102,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenChooseItA
TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenPackedTargetDeviceBinaryIsSet) {
PatchTokensTestData::ValidEmptyProgram programTokens;
NEO::MockExecutionEnvironment mockExecutionEnvironment{};
const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::CompilerProductHelper>();
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
NEO::HardwareIpVersion aotConfig = {0};
aotConfig.value = productHelper.getHwIpVersion(hwInfo);
aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo);
NEO::Ar::ArEncoder encoder;
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
@@ -134,10 +134,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenPackedTar
TEST(UnpackSingleDeviceBinaryAr, WhenMultipleBinariesMatchedThenChooseBestMatch) {
PatchTokensTestData::ValidEmptyProgram programTokens;
NEO::MockExecutionEnvironment mockExecutionEnvironment{};
const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::CompilerProductHelper>();
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
NEO::HardwareIpVersion aotConfig = {0};
aotConfig.value = productHelper.getHwIpVersion(hwInfo);
aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo);
NEO::Ar::ArEncoder encoder;
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
@@ -152,7 +152,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenMultipleBinariesMatchedThenChooseBestMatch)
NEO::TargetDevice target;
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
target.aotConfig.value = productHelper.getHwIpVersion(hwInfo);
target.aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo);
target.stepping = programTokens.header->SteppingId;
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
@@ -244,10 +244,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithProductConfigThenTry
PatchTokensTestData::ValidEmptyProgram programTokensWrongTokenVersion;
NEO::MockExecutionEnvironment mockExecutionEnvironment{};
const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::CompilerProductHelper>();
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
NEO::HardwareIpVersion aotConfig = {0};
aotConfig.value = productHelper.getHwIpVersion(hwInfo);
aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo);
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
@@ -264,7 +264,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithProductConfigThenTry
NEO::TargetDevice target;
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
target.aotConfig.value = productHelper.getHwIpVersion(hwInfo);
target.aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo);
target.stepping = programTokens.header->SteppingId;
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
@@ -353,10 +353,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenDeviceBinaryNotMatchedButIrWithProductFamil
TEST(UnpackSingleDeviceBinaryAr, WhenDeviceBinaryNotMatchedButIrWithProductConfigAvailableThenUseIr) {
PatchTokensTestData::ValidEmptyProgram programTokens;
NEO::MockExecutionEnvironment mockExecutionEnvironment{};
const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::CompilerProductHelper>();
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
NEO::HardwareIpVersion aotConfig = {0};
aotConfig.value = productHelper.getHwIpVersion(hwInfo);
aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo);
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
@@ -375,7 +375,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.value = productHelper.getHwIpVersion(hwInfo);
target.aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo);
auto arData = encoder.encode();
std::string unpackErrors;
@@ -578,10 +578,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenCouldNotFindBinaryWithRightPointerSizeThenU
NEO::Ar::ArEncoder encoder;
NEO::MockExecutionEnvironment mockExecutionEnvironment{};
const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::CompilerProductHelper>();
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
NEO::HardwareIpVersion aotConfig = {0};
aotConfig.value = productHelper.getHwIpVersion(hwInfo);
aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo);
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
std::string requiredProduct = NEO::hardwarePrefix[productFamily];

View File

@@ -7,10 +7,10 @@
#pragma once
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/constants.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/helpers/product_config_helper.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/test_base.h"
@@ -24,10 +24,10 @@ struct ProductConfigTest : public T {
void SetUp() override {
T::SetUp();
hwInfo = *NEO::defaultHwInfo;
productHelper = NEO::ProductHelper::create(productFamily);
compilerProductHelper = NEO::CompilerProductHelper::create(productFamily);
}
std::unique_ptr<NEO::ProductHelper> productHelper = nullptr;
std::unique_ptr<NEO::CompilerProductHelper> compilerProductHelper = nullptr;
NEO::HardwareInfo hwInfo = {};
uint32_t productConfig = AOT::UNKNOWN_ISA;
};

View File

@@ -8,6 +8,7 @@
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/gen11/hw_cmds_ehl.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
@@ -65,9 +66,8 @@ EHLTEST_F(EhlProductHelper, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTabl
}
}
EHLTEST_F(EhlProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::EHL);
EHLTEST_F(EhlProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::EHL);
}
EHLTEST_F(EhlProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -8,6 +8,7 @@
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/gen11/hw_cmds_icllp.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
@@ -97,8 +98,8 @@ ICLLPTEST_F(IcllpProductHelper, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatu
}
}
ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(*defaultHwInfo), AOT::ICL);
ICLLPTEST_F(IcllpProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(compilerProductHelper->getHwIpVersion(*defaultHwInfo), AOT::ICL);
}
ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -8,6 +8,7 @@
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/gen11/hw_cmds_lkf.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
@@ -83,9 +84,8 @@ LKFTEST_F(LkfProductHelper, givenBoolWhenCallLkfHardwareInfoSetupThenFeatureTabl
}
}
LKFTEST_F(LkfProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::LKF);
LKFTEST_F(LkfProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::LKF);
}
LKFTEST_F(LkfProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -76,8 +76,8 @@ ADLNTEST_F(AdlnProductHelper, whenGettingAubstreamProductFamilyThenProperEnumVal
EXPECT_EQ(aub_stream::ProductFamily::Adln, productHelper->getAubStreamProductFamily());
}
ADLNTEST_F(AdlnProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::ADL_N);
ADLNTEST_F(AdlnProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::ADL_N);
}
ADLNTEST_F(AdlnProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -75,9 +75,9 @@ ADLPTEST_F(AdlpProductHelper, whenGettingAubstreamProductFamilyThenProperEnumVal
EXPECT_EQ(aub_stream::ProductFamily::Adlp, productHelper->getAubStreamProductFamily());
}
ADLPTEST_F(AdlpProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
ADLPTEST_F(AdlpProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::ADL_P);
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::ADL_P);
}
ADLPTEST_F(AdlpProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -75,9 +75,9 @@ ADLSTEST_F(AdlsProductHelper, whenGettingAubstreamProductFamilyThenProperEnumVal
EXPECT_EQ(aub_stream::ProductFamily::Adls, productHelper->getAubStreamProductFamily());
}
ADLSTEST_F(AdlsProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
ADLSTEST_F(AdlsProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::ADL_S);
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::ADL_S);
}
ADLSTEST_F(AdlsProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -133,8 +133,8 @@ DG1TEST_F(Dg1ProductHelper, whenOverrideGfxPartitionLayoutForWslThenReturnTrue)
EXPECT_TRUE(productHelper->overrideGfxPartitionLayoutForWsl());
}
DG1TEST_F(Dg1ProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(*defaultHwInfo), AOT::DG1);
DG1TEST_F(Dg1ProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(compilerProductHelper->getHwIpVersion(*defaultHwInfo), AOT::DG1);
}
DG1TEST_F(Dg1ProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -81,8 +81,8 @@ RKLTEST_F(RklHwInfo, givenRklWhenCheckL0ThenReturnTrue) {
using RklProductHelper = ProductHelperTest;
RKLTEST_F(RklProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::RKL);
RKLTEST_F(RklProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::RKL);
}
RKLTEST_F(RklProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -236,6 +236,6 @@ TGLLPTEST_F(TgllpProductHelper, givenTgllpWhenObtainingBlitterPreferenceThenRetu
EXPECT_FALSE(productHelper->obtainBlitterPreference(pInHwInfo));
}
TGLLPTEST_F(TgllpProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::TGL);
TGLLPTEST_F(TgllpProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::TGL);
}

View File

@@ -82,9 +82,8 @@ BDWTEST_F(BdwProductHelper, givenProductHelperStringThenAfterSetupResultingVmeIs
EXPECT_FALSE(pInHwInfo.capabilityTable.supportsVme);
}
BDWTEST_F(BdwProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::BDW);
BDWTEST_F(BdwProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::BDW);
}
BDWTEST_F(BdwProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -8,6 +8,7 @@
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/gen9/hw_cmds_bxt.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
@@ -85,9 +86,9 @@ BXTTEST_F(BxtProductHelper, givenBoolWhenCallBxtHardwareInfoSetupThenFeatureTabl
}
}
BXTTEST_F(BxtProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
BXTTEST_F(BxtProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::APL);
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::APL);
}
BXTTEST_F(BxtProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -9,6 +9,7 @@
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/gen9/cfl/device_ids_configs_cfl.h"
#include "shared/source/gen9/hw_cmds_cfl.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
@@ -90,23 +91,23 @@ CFLTEST_F(CflProductHelper, givenBoolWhenCallCflHardwareInfoSetupThenFeatureTabl
}
}
CFLTEST_F(CflProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
CFLTEST_F(CflProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
for (const auto &deviceId : cflDeviceIds) {
pInHwInfo.platform.usDeviceID = deviceId;
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::CFL);
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::CFL);
}
for (const auto &deviceId : cmlDeviceIds) {
pInHwInfo.platform.usDeviceID = deviceId;
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::CML);
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::CML);
}
for (const auto &deviceId : whlDeviceIds) {
pInHwInfo.platform.usDeviceID = deviceId;
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::WHL);
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::WHL);
}
pInHwInfo.platform.usDeviceID = 0u;
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::UNKNOWN_ISA);
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::UNKNOWN_ISA);
}
CFLTEST_F(CflProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -8,6 +8,7 @@
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/gen9/hw_cmds_glk.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
@@ -85,9 +86,9 @@ GLKTEST_F(GlkProductHelper, givenBoolWhenCallGlkHardwareInfoSetupThenFeatureTabl
}
}
GLKTEST_F(GlkProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
GLKTEST_F(GlkProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::GLK);
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::GLK);
}
GLKTEST_F(GlkProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -8,6 +8,7 @@
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/gen9/kbl/device_ids_configs_kbl.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/hw_test.h"
@@ -99,19 +100,19 @@ KBLTEST_F(KblProductHelper, givenBoolWhenCallKblHardwareInfoSetupThenFeatureTabl
}
}
KBLTEST_F(KblProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
KBLTEST_F(KblProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
for (const auto &deviceId : amlDeviceIds) {
pInHwInfo.platform.usDeviceID = deviceId;
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::AML);
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::AML);
}
for (const auto &deviceId : kblDeviceIds) {
pInHwInfo.platform.usDeviceID = deviceId;
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::KBL);
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::KBL);
}
pInHwInfo.platform.usDeviceID = 0u;
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::UNKNOWN_ISA);
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::UNKNOWN_ISA);
}
KBLTEST_F(KblProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -8,6 +8,7 @@
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/gen9/hw_cmds_skl.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
@@ -109,8 +110,8 @@ SKLTEST_F(SklProductHelper, givenBoolWhenCallSklHardwareInfoSetupThenFeatureTabl
}
}
SKLTEST_F(SklProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::SKL);
SKLTEST_F(SklProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::SKL);
}
SKLTEST_F(SklProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {

View File

@@ -149,12 +149,11 @@ HWTEST2_F(CompilerProductHelperFixture, GivenPreXeHpThenMatrixMultiplyAccumulate
}
HWTEST2_F(CompilerProductHelperFixture, givenAotConfigWhenSetHwInfoRevisionIdThenCorrectValueIsSet, IsAtMostDg2) {
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
auto hwInfo = *defaultHwInfo;
auto &productHelper = getHelper<ProductHelper>();
auto productConfig = productHelper.getHwIpVersion(*defaultHwInfo);
auto productConfig = compilerProductHelper.getHwIpVersion(*defaultHwInfo);
HardwareIpVersion aotConfig = {0};
aotConfig.value = productConfig;
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
compilerProductHelper.setProductConfigForHwInfo(hwInfo, aotConfig);
EXPECT_EQ(hwInfo.platform.usRevId, aotConfig.revision);
EXPECT_EQ(hwInfo.ipVersion.value, aotConfig.value);
@@ -279,4 +278,14 @@ HWTEST2_F(CompilerProductHelperFixture, givenConfigWhenMatchConfigWithRevIdThenP
EXPECT_EQ(compilerProductHelper.matchRevisionIdWithProductConfig(config, 0x0), config);
EXPECT_EQ(compilerProductHelper.matchRevisionIdWithProductConfig(config, 0x1), config);
EXPECT_EQ(compilerProductHelper.matchRevisionIdWithProductConfig(config, 0x4), config);
}
}
HWTEST_F(CompilerProductHelperFixture, givenProductHelperWhenGetAndOverrideHwIpVersionThenCorrectMatchIsFound) {
DebugManagerStateRestore stateRestore;
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
uint32_t config = 0x1234;
DebugManager.flags.OverrideHwIpVersion.set(config);
hwInfo.ipVersion.value = 0x5678;
EXPECT_EQ(compilerProductHelper.getHwIpVersion(hwInfo), config);
}

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);
}

View File

@@ -5,6 +5,7 @@
*
*/
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/os_interface/linux/engine_info.h"
#include "shared/source/os_interface/linux/i915_prelim.h"
#include "shared/source/os_interface/linux/ioctl_helper.h"
@@ -589,12 +590,12 @@ TEST_F(IoctlHelperPrelimFixture, givenIoctlHelperWhenInitializatedThenIpVersionI
TEST_F(IoctlHelperPrelimFixture, givenIoctlHelperWhenFailOnInitializationThenIpVersionIsCorrect) {
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
auto &ipVersion = hwInfo->ipVersion;
ipVersion = {};
drm->failRetHwIpVersion = true;
drm->ioctlHelper->setupIpVersion();
auto config = productHelper.getHwIpVersion(*hwInfo);
auto config = compilerProductHelper.getHwIpVersion(*hwInfo);
EXPECT_EQ(config, ipVersion.value);
}

View File

@@ -5,6 +5,7 @@
*
*/
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/string.h"
#include "shared/source/os_interface/linux/drm_neo.h"
#include "shared/source/os_interface/linux/i915_prelim.h"
@@ -552,8 +553,8 @@ TEST_F(IoctlPrelimHelperTests, whenGettingPreferredLocationRegionThenReturnCorre
TEST_F(IoctlPrelimHelperTests, WhenSetupIpVersionIsCalledThenIpVersionIsCorrect) {
auto &hwInfo = *drm->getRootDeviceEnvironment().getHardwareInfo();
auto &productHelper = drm->getRootDeviceEnvironment().getHelper<ProductHelper>();
auto config = productHelper.getHwIpVersion(hwInfo);
auto &compilerProductHelper = drm->getRootDeviceEnvironment().getHelper<CompilerProductHelper>();
auto config = compilerProductHelper.getHwIpVersion(hwInfo);
ioctlHelper.setupIpVersion();
EXPECT_EQ(config, hwInfo.ipVersion.value);

View File

@@ -6,6 +6,7 @@
*/
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/os_interface/linux/engine_info.h"
#include "shared/source/os_interface/linux/memory_info.h"
#include "shared/source/os_interface/product_helper.h"
@@ -506,8 +507,8 @@ TEST(IoctlHelperTestsUpstream, WhenSetupIpVersionIsCalledThenIpVersionIsCorrect)
IoctlHelperUpstream ioctlHelper{*drm};
auto &hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
auto config = productHelper.getHwIpVersion(hwInfo);
auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
auto config = compilerProductHelper.getHwIpVersion(hwInfo);
ioctlHelper.setupIpVersion();
EXPECT_EQ(config, hwInfo.ipVersion.value);

View File

@@ -5,6 +5,7 @@
*
*/
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/register_offsets.h"
#include "shared/source/os_interface/linux/engine_info.h"
#include "shared/source/os_interface/linux/i915_prelim.h"
@@ -1143,8 +1144,8 @@ TEST(IoctlHelperXeTest, WhenSetupIpVersionIsCalledThenIpVersionIsCorrect) {
auto xeIoctlHelper = std::make_unique<MockIoctlHelperXe>(drm);
auto &hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
auto config = productHelper.getHwIpVersion(hwInfo);
auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
auto config = compilerProductHelper.getHwIpVersion(hwInfo);
xeIoctlHelper->setupIpVersion();
EXPECT_EQ(config, hwInfo.ipVersion.value);

View File

@@ -34,6 +34,7 @@ using namespace NEO;
ProductHelperTest::ProductHelperTest() {
executionEnvironment = std::make_unique<MockExecutionEnvironment>();
productHelper = &executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
compilerProductHelper = &executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
releaseHelper = executionEnvironment->rootDeviceEnvironments[0]->getReleaseHelper();
}
@@ -755,12 +756,3 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenCheckingIsTranslationException
HWTEST_F(ProductHelperTest, whenQueryingMaxNumSamplersThenReturnSixteen) {
EXPECT_EQ(16u, productHelper->getMaxNumSamplers());
}
HWTEST_F(ProductHelperTest, givenProductHelperWhenGetAndOverrideHwIpVersionThenCorrectMatchIsFound) {
DebugManagerStateRestore stateRestore;
HardwareInfo hwInfo = pInHwInfo;
uint32_t config = 0x1234;
DebugManager.flags.OverrideHwIpVersion.set(config);
hwInfo.ipVersion.value = config;
EXPECT_EQ(productHelper->getHwIpVersion(hwInfo), config);
}

View File

@@ -14,6 +14,7 @@
namespace NEO {
class ExecutionEnvironment;
class CompilerProductHelper;
class ProductHelper;
class ReleaseHelper;
} // namespace NEO
@@ -30,6 +31,7 @@ struct ProductHelperTest : public ::testing::Test {
HardwareInfo pInHwInfo{};
HardwareInfo outHwInfo{};
ProductHelper *productHelper = nullptr;
CompilerProductHelper *compilerProductHelper = nullptr;
ReleaseHelper *releaseHelper = nullptr;
PLATFORM *testPlatform = nullptr;
};

View File

@@ -6,8 +6,8 @@
*/
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/test/common/os_interface/windows/wddm_fixture.h"
#include "shared/test/common/test_macros/hw_test.h"
@@ -15,9 +15,9 @@ using namespace NEO;
TEST_F(WddmTest, WhenPopulateIpVersionWddmIsCalledThenIpVersionIsSet) {
auto &productHelper = wddm->rootDeviceEnvironment.getHelper<ProductHelper>();
auto &compilerProductHelper = wddm->rootDeviceEnvironment.getHelper<CompilerProductHelper>();
HardwareInfo hwInfo = *defaultHwInfo;
auto config = productHelper.getHwIpVersion(hwInfo);
auto config = compilerProductHelper.getHwIpVersion(hwInfo);
wddm->populateIpVersion(hwInfo);
EXPECT_EQ(config, hwInfo.ipVersion.value);

View File

@@ -21,15 +21,27 @@ PVCTEST_F(ProductConfigTests, givenPvcXlDeviceIdWhenDifferentRevisionIsPassedThe
hwInfo.platform.usDeviceID = deviceId;
hwInfo.platform.usRevId = 0x0;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XL_A0);
hwInfo.platform.usRevId = 0x1;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XL_A0P);
hwInfo.platform.usRevId = 0x6;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XL_A0P);
hwInfo.platform.usRevId = 0x10;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XL_A0);
hwInfo.platform.usRevId = 0x11;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XL_A0P);
hwInfo.platform.usRevId = 0x16;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XL_A0P);
}
}
@@ -39,37 +51,83 @@ PVCTEST_F(ProductConfigTests, givenPvcXtDeviceIdWhenDifferentRevisionIsPassedThe
hwInfo.platform.usDeviceID = deviceId;
hwInfo.platform.usRevId = 0x3;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XT_A0);
hwInfo.platform.usRevId = 0x5;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XT_B0);
hwInfo.platform.usRevId = 0x6;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XT_B1);
hwInfo.platform.usRevId = 0x7;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XT_C0);
hwInfo.platform.usRevId = 0x13;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XT_A0);
hwInfo.platform.usRevId = 0x15;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XT_B0);
hwInfo.platform.usRevId = 0x16;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XT_B1);
hwInfo.platform.usRevId = 0x17;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XT_C0);
}
}
PVCTEST_F(ProductConfigTests, givenDefaultDeviceAndRevisionIdWhenGetProductConfigThenPvcXtC0ConfigIsReturned) {
hwInfo.platform.usRevId = 0x0;
hwInfo.platform.usDeviceID = 0x0;
hwInfo.platform.usRevId = 0;
hwInfo.platform.usDeviceID = defaultHwInfo->platform.usDeviceID;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XT_C0);
}
PVCTEST_F(ProductConfigTests, givenInvalidRevisionIdWhenGetProductConfigThenUnknownIsaIsReturned) {
hwInfo.platform.usRevId = 0x2;
productConfig = productHelper->getHwIpVersion(hwInfo);
PVCTEST_F(ProductConfigTests, givenInvalidRevisionIdForPvcXtWhenGetProductConfigThenLatestPvcXtIsReturned) {
for (const auto &deviceId : pvcXtDeviceIds) {
hwInfo.platform.usDeviceID = deviceId;
hwInfo.platform.usRevId = 0x2;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XT_C0);
hwInfo.platform.usRevId = 0x4;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XT_C0);
}
}
PVCTEST_F(ProductConfigTests, givenInvalidRevisionIdForPvcXlWhenGetProductConfigThenLatestPvcXlIsReturned) {
for (const auto &deviceId : pvcXlDeviceIds) {
hwInfo.platform.usDeviceID = deviceId;
hwInfo.platform.usRevId = 0x2;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XL_A0P);
hwInfo.platform.usRevId = 0x4;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::PVC_XL_A0P);
}
}
PVCTEST_F(ProductConfigTests, givenInvalidDeviceIdWhenGetProductConfigThenInvalidConfigIsReturned) {
hwInfo.platform.usDeviceID = 0;
hwInfo.platform.usRevId = 0x0;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA);
hwInfo.platform.usRevId = 0x4;
productConfig = productHelper->getHwIpVersion(hwInfo);
hwInfo.platform.usRevId = 0x3;
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA);
}

View File

@@ -279,7 +279,7 @@ DG2TEST_F(ProductHelperTestDg2, givenDg2G10A0OrA1SteppingWhenAskingIfWAIsRequire
for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) {
hwInfo.platform.usRevId = productHelper->getHwRevIdFromStepping(revision, hwInfo);
hwInfo.platform.usDeviceID = deviceId;
hwInfo.ipVersion.value = productHelper->getHwIpVersion(hwInfo);
hwInfo.ipVersion.value = compilerProductHelper->getHwIpVersion(hwInfo);
if (hwInfo.ipVersion.value == AOT::UNKNOWN_ISA) {
continue;
}
@@ -733,7 +733,7 @@ DG2TEST_F(ProductConfigTests, givenInvalidRevisionIdWhenDeviceIdIsDefaultThenUnk
hwInfo.platform.usDeviceID = 0;
hwInfo.platform.usRevId = CommonConstants::invalidRevisionID;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA);
}
@@ -742,19 +742,19 @@ DG2TEST_F(ProductConfigTests, givenDg2G10DeviceIdWhenDifferentRevisionIsPassedTh
hwInfo.platform.usDeviceID = deviceId;
hwInfo.platform.usRevId = 0x0;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::DG2_G10_A0);
hwInfo.platform.usRevId = 0x1;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::DG2_G10_A1);
hwInfo.platform.usRevId = 0x4;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::DG2_G10_B0);
hwInfo.platform.usRevId = 0x8;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::DG2_G10_C0);
}
}
@@ -764,7 +764,7 @@ DG2TEST_F(ProductConfigTests, givenDg2DeviceIdWhenIncorrectRevisionIsPassedThenC
for (const auto &deviceId : *dg2) {
hwInfo.platform.usDeviceID = deviceId;
hwInfo.platform.usRevId = CommonConstants::invalidRevisionID;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA);
}
}
@@ -775,15 +775,15 @@ DG2TEST_F(ProductConfigTests, givenDg2G11DeviceIdWhenDifferentRevisionIsPassedTh
hwInfo.platform.usDeviceID = deviceId;
hwInfo.platform.usRevId = 0x0;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::DG2_G11_A0);
hwInfo.platform.usRevId = 0x4;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::DG2_G11_B0);
hwInfo.platform.usRevId = 0x5;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::DG2_G11_B1);
}
}
@@ -791,7 +791,7 @@ DG2TEST_F(ProductConfigTests, givenDg2G11DeviceIdWhenDifferentRevisionIsPassedTh
DG2TEST_F(ProductConfigTests, givenDg2G12DeviceIdWhenGetProductConfigThenCorrectConfigIsReturned) {
for (const auto &deviceId : dg2G12DeviceIds) {
hwInfo.platform.usDeviceID = deviceId;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::DG2_G12_A0);
}
}
@@ -800,7 +800,7 @@ DG2TEST_F(ProductConfigTests, givenNotSetDeviceAndRevisionIdWhenGetProductConfig
hwInfo.platform.usRevId = 0x0;
hwInfo.platform.usDeviceID = 0x0;
productConfig = productHelper->getHwIpVersion(hwInfo);
productConfig = compilerProductHelper->getHwIpVersion(hwInfo);
EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA);
}

View File

@@ -8,6 +8,7 @@
#include "shared/source/command_container/command_encoder.h"
#include "shared/source/command_stream/linear_stream.h"
#include "shared/source/command_stream/stream_properties.h"
#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/kernel/kernel_descriptor.h"
#include "shared/source/release_helper/release_helper.h"
#include "shared/source/xe_hpg_core/hw_cmds_dg2.h"
@@ -63,6 +64,7 @@ DG2TEST_F(CommandEncodeDG2Test, whenProgramComputeWalkerThenApplyL3WAForDg2G10A0
auto walkerCmd = FamilyType::cmdInitGpgpuWalker;
MockExecutionEnvironment executionEnvironment{};
auto &productHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper<ProductHelper>();
auto &compilerProductHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
@@ -72,7 +74,7 @@ DG2TEST_F(CommandEncodeDG2Test, whenProgramComputeWalkerThenApplyL3WAForDg2G10A0
for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) {
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
hwInfo.platform.usDeviceID = deviceId;
hwInfo.ipVersion = productHelper.getHwIpVersion(hwInfo);
hwInfo.ipVersion = compilerProductHelper.getHwIpVersion(hwInfo);
if (hwInfo.ipVersion.value == AOT::UNKNOWN_ISA) {
continue;