ProductHelper ults cleanup - gen11

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-6853

Don't use DeviceFixture if not needed.
Use RootDeviceEnvironment getHelper <ProductHelper>
This commit is contained in:
Kamil Kopryk
2022-11-23 15:31:56 +00:00
committed by Compute-Runtime-Automation
parent 405d718bbe
commit 7593aad816
6 changed files with 157 additions and 180 deletions

View File

@ -10,7 +10,7 @@
using namespace NEO;
struct HwInfoConfigTestLinuxEhl : HwInfoConfigTestLinux {
struct EhlProductHelperLinux : HwInfoConfigTestLinux {
void SetUp() override {
HwInfoConfigTestLinux::SetUp();
@ -18,27 +18,24 @@ struct HwInfoConfigTestLinuxEhl : HwInfoConfigTestLinux {
}
};
EHLTEST_F(HwInfoConfigTestLinuxEhl, GivenEhlThenHwInfoIsCorrect) {
auto &productHelper = getHelper<ProductHelper>();
int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
EHLTEST_F(EhlProductHelperLinux, GivenEhlThenHwInfoIsCorrect) {
int ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
EXPECT_EQ(0, ret);
EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount);
EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount);
EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount);
}
EHLTEST_F(HwInfoConfigTestLinuxEhl, GivenInvalidDeviceIdWhenConfiguringHwInfoThenNegativeOneReturned) {
auto &productHelper = getHelper<ProductHelper>();
EHLTEST_F(EhlProductHelperLinux, GivenInvalidDeviceIdWhenConfiguringHwInfoThenNegativeOneReturned) {
drm->failRetTopology = true;
drm->storedRetValForEUVal = -1;
auto ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
EXPECT_EQ(-1, ret);
drm->storedRetValForEUVal = 0;
drm->storedRetValForSSVal = -1;
ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
EXPECT_EQ(-1, ret);
}

View File

@ -10,36 +10,36 @@
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
#include "shared/test/unit_test/os_interface/hw_info_config_tests.h"
#include "platforms.h"
using namespace NEO;
using EhlHwInfo = ::testing::Test;
using EhlProductHelper = HwInfoConfigTest;
EHLTEST_F(EhlHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) {
HardwareInfo hwInfo = *defaultHwInfo;
EHLTEST_F(EhlProductHelper, givenProductHelperStringThenAfterSetupResultingVmeIsDisabled) {
hardwareInfoSetup[productFamily](&hwInfo, false, 0x100040008);
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler);
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption);
EXPECT_FALSE(hwInfo.capabilityTable.supportsVme);
hardwareInfoSetup[productFamily](&pInHwInfo, false, 0x100040008);
EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler);
EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcPreemption);
EXPECT_FALSE(pInHwInfo.capabilityTable.supportsVme);
}
EHLTEST_F(EhlHwInfo, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
EHLTEST_F(EhlProductHelper, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
bool boolValue[]{
true, false};
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
GT_SYSTEM_INFO &gtSystemInfo = pInHwInfo.gtSystemInfo;
FeatureTable &featureTable = pInHwInfo.featureTable;
WorkaroundTable &workaroundTable = pInHwInfo.workaroundTable;
for (auto setParamBool : boolValue) {
gtSystemInfo = {0};
featureTable = {};
workaroundTable = {};
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, 0x100040008);
hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, 0x100040008);
EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
@ -62,46 +62,42 @@ EHLTEST_F(EhlHwInfo, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTableAndWor
}
}
EHLTEST_F(EhlHwInfo, givenHwInfoConfigWhenGetProductConfigThenCorrectMatchIsFound) {
HardwareInfo hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
EXPECT_EQ(hwInfoConfig.getProductConfigFromHwInfo(hwInfo), AOT::EHL);
EHLTEST_F(EhlProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getProductConfigFromHwInfo(pInHwInfo), AOT::EHL);
}
EHLTEST_F(EhlHwInfo, givenHwInfoConfigWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {
HardwareInfo hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
EXPECT_TRUE(hwInfoConfig.isEvictionIfNecessaryFlagSupported());
EHLTEST_F(EhlProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {
EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported());
}
EHLTEST_F(EhlHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) {
HardwareInfo hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
EHLTEST_F(EhlProductHelper, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) {
EXPECT_TRUE(hwInfoConfig.getScmPropertyThreadArbitrationPolicySupport());
EXPECT_TRUE(hwInfoConfig.getScmPropertyCoherencyRequiredSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyZPassAsyncComputeThreadLimitSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyPixelAsyncComputeThreadLimitSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyLargeGrfModeSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyDevicePreemptionModeSupport());
EXPECT_TRUE(productHelper->getScmPropertyThreadArbitrationPolicySupport());
EXPECT_TRUE(productHelper->getScmPropertyCoherencyRequiredSupport());
EXPECT_FALSE(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport());
EXPECT_FALSE(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport());
EXPECT_FALSE(productHelper->getScmPropertyLargeGrfModeSupport());
EXPECT_FALSE(productHelper->getScmPropertyDevicePreemptionModeSupport());
EXPECT_FALSE(hwInfoConfig.getStateBaseAddressPropertyGlobalAtomicsSupport());
EXPECT_TRUE(hwInfoConfig.getStateBaseAddressPropertyStatelessMocsSupport());
EXPECT_FALSE(hwInfoConfig.getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport());
EXPECT_FALSE(productHelper->getStateBaseAddressPropertyGlobalAtomicsSupport());
EXPECT_TRUE(productHelper->getStateBaseAddressPropertyStatelessMocsSupport());
EXPECT_FALSE(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport());
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyScratchSizeSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyPrivateScratchSizeSupport());
EXPECT_TRUE(productHelper->getFrontEndPropertyScratchSizeSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyPrivateScratchSizeSupport());
EXPECT_TRUE(hwInfoConfig.getPreemptionDbgPropertyPreemptionModeSupport());
EXPECT_TRUE(hwInfoConfig.getPreemptionDbgPropertyStateSipSupport());
EXPECT_TRUE(hwInfoConfig.getPreemptionDbgPropertyCsrSurfaceSupport());
EXPECT_TRUE(productHelper->getPreemptionDbgPropertyPreemptionModeSupport());
EXPECT_TRUE(productHelper->getPreemptionDbgPropertyStateSipSupport());
EXPECT_TRUE(productHelper->getPreemptionDbgPropertyCsrSurfaceSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyComputeDispatchAllWalkerSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyComputeDispatchAllWalkerSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
EXPECT_TRUE(productHelper->getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(productHelper->getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(productHelper->getPipelineSelectPropertySystolicModeSupport());
}

View File

@ -11,15 +11,15 @@
using namespace NEO;
struct HwInfoConfigTestLinuxIcllp : HwInfoConfigTestLinux {
struct IcllpProductHelperLinux : HwInfoConfigTestLinux {
void SetUp() override {
HwInfoConfigTestLinux::SetUp();
}
};
ICLLPTEST_F(HwInfoConfigTestLinuxIcllp, GivenIcllpThenHwInfoIsCorrect) {
auto &productHelper = getHelper<ProductHelper>();
auto ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
ICLLPTEST_F(IcllpProductHelperLinux, GivenIcllpThenHwInfoIsCorrect) {
auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
EXPECT_EQ(0, ret);
EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount);
EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount);
@ -29,18 +29,16 @@ ICLLPTEST_F(HwInfoConfigTestLinuxIcllp, GivenIcllpThenHwInfoIsCorrect) {
EXPECT_FALSE(outHwInfo.featureTable.flags.ftrTileY);
}
ICLLPTEST_F(HwInfoConfigTestLinuxIcllp, GivenInvalidDeviceIdWhenConfiguringHwInfoThenNegativeOneReturned) {
auto &productHelper = getHelper<ProductHelper>();
ICLLPTEST_F(IcllpProductHelperLinux, GivenInvalidDeviceIdWhenConfiguringHwInfoThenNegativeOneReturned) {
drm->failRetTopology = true;
drm->storedRetValForEUVal = -1;
auto ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
EXPECT_EQ(-1, ret);
drm->storedRetValForEUVal = 0;
drm->storedRetValForSSVal = -1;
ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
EXPECT_EQ(-1, ret);
}

View File

@ -17,43 +17,41 @@
using namespace NEO;
using IcllpHwInfoConfig = ::testing::Test;
using IcllpProductHelper = HwInfoConfigTest;
ICLLPTEST_F(IcllpHwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) {
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
ICLLPTEST_F(IcllpProductHelper, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) {
GT_SYSTEM_INFO &gtSystemInfo = pInHwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
gtSystemInfo = {0};
EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config));
EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config));
EXPECT_EQ(0u, gtSystemInfo.SliceCount);
EXPECT_EQ(0u, gtSystemInfo.SubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.EUCount);
}
ICLLPTEST_F(IcllpHwInfoConfig, givenHwInfoConfigWhenAskedIfAdditionalMediaSamplerProgrammingIsRequiredThenTrueIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_TRUE(hwInfoConfig.isAdditionalMediaSamplerProgrammingRequired());
ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenAskedIfAdditionalMediaSamplerProgrammingIsRequiredThenTrueIsReturned) {
EXPECT_TRUE(productHelper->isAdditionalMediaSamplerProgrammingRequired());
}
ICLLPTEST_F(IcllpHwInfoConfig, givenHwInfoConfigWhenAskedIfInitialFlagsProgrammingIsRequiredThenTrueIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_TRUE(hwInfoConfig.isInitialFlagsProgrammingRequired());
ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenAskedIfInitialFlagsProgrammingIsRequiredThenTrueIsReturned) {
EXPECT_TRUE(productHelper->isInitialFlagsProgrammingRequired());
}
ICLLPTEST_F(IcllpHwInfoConfig, givenHwInfoConfigWhenAskedIfReturnedCmdSizeForMediaSamplerAdjustmentIsRequiredThenTrueIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_TRUE(hwInfoConfig.isReturnedCmdSizeForMediaSamplerAdjustmentRequired());
ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenAskedIfReturnedCmdSizeForMediaSamplerAdjustmentIsRequiredThenTrueIsReturned) {
EXPECT_TRUE(productHelper->isReturnedCmdSizeForMediaSamplerAdjustmentRequired());
}
using IcllpHwInfo = HwInfoConfigTest;
ICLLPTEST_F(IcllpHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) {
ICLLPTEST_F(IcllpProductHelper, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) {
EXPECT_EQ(aub_stream::ProductFamily::Icllp, productHelper->getAubStreamProductFamily());
}
ICLLPTEST_F(IcllpHwInfo, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
ICLLPTEST_F(IcllpProductHelper, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
uint64_t configs[] = {
0x100080008,
0x100040008,
@ -61,10 +59,9 @@ ICLLPTEST_F(IcllpHwInfo, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatureTable
bool boolValue[]{
true, false};
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
GT_SYSTEM_INFO &gtSystemInfo = pInHwInfo.gtSystemInfo;
FeatureTable &featureTable = pInHwInfo.featureTable;
WorkaroundTable &workaroundTable = pInHwInfo.workaroundTable;
for (auto config : configs) {
for (auto setParamBool : boolValue) {
@ -72,7 +69,7 @@ ICLLPTEST_F(IcllpHwInfo, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatureTable
gtSystemInfo = {0};
featureTable = {};
workaroundTable = {};
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config);
hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, config);
EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
@ -96,45 +93,41 @@ ICLLPTEST_F(IcllpHwInfo, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatureTable
}
}
ICLLPTEST_F(IcllpHwInfo, givenHwInfoConfigWhenGetProductConfigThenCorrectMatchIsFound) {
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
EXPECT_EQ(hwInfoConfig.getProductConfigFromHwInfo(*defaultHwInfo), AOT::ICL);
ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getProductConfigFromHwInfo(*defaultHwInfo), AOT::ICL);
}
ICLLPTEST_F(IcllpHwInfo, givenHwInfoConfigWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {
HardwareInfo hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
EXPECT_TRUE(hwInfoConfig.isEvictionIfNecessaryFlagSupported());
ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {
EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported());
}
ICLLPTEST_F(IcllpHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) {
HardwareInfo hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) {
EXPECT_TRUE(hwInfoConfig.getScmPropertyThreadArbitrationPolicySupport());
EXPECT_TRUE(hwInfoConfig.getScmPropertyCoherencyRequiredSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyZPassAsyncComputeThreadLimitSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyPixelAsyncComputeThreadLimitSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyLargeGrfModeSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyDevicePreemptionModeSupport());
EXPECT_TRUE(productHelper->getScmPropertyThreadArbitrationPolicySupport());
EXPECT_TRUE(productHelper->getScmPropertyCoherencyRequiredSupport());
EXPECT_FALSE(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport());
EXPECT_FALSE(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport());
EXPECT_FALSE(productHelper->getScmPropertyLargeGrfModeSupport());
EXPECT_FALSE(productHelper->getScmPropertyDevicePreemptionModeSupport());
EXPECT_FALSE(hwInfoConfig.getStateBaseAddressPropertyGlobalAtomicsSupport());
EXPECT_TRUE(hwInfoConfig.getStateBaseAddressPropertyStatelessMocsSupport());
EXPECT_FALSE(hwInfoConfig.getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport());
EXPECT_FALSE(productHelper->getStateBaseAddressPropertyGlobalAtomicsSupport());
EXPECT_TRUE(productHelper->getStateBaseAddressPropertyStatelessMocsSupport());
EXPECT_FALSE(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport());
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyScratchSizeSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyPrivateScratchSizeSupport());
EXPECT_TRUE(productHelper->getFrontEndPropertyScratchSizeSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyPrivateScratchSizeSupport());
EXPECT_TRUE(hwInfoConfig.getPreemptionDbgPropertyPreemptionModeSupport());
EXPECT_TRUE(hwInfoConfig.getPreemptionDbgPropertyStateSipSupport());
EXPECT_TRUE(hwInfoConfig.getPreemptionDbgPropertyCsrSurfaceSupport());
EXPECT_TRUE(productHelper->getPreemptionDbgPropertyPreemptionModeSupport());
EXPECT_TRUE(productHelper->getPreemptionDbgPropertyStateSipSupport());
EXPECT_TRUE(productHelper->getPreemptionDbgPropertyCsrSurfaceSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyComputeDispatchAllWalkerSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyComputeDispatchAllWalkerSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
EXPECT_TRUE(productHelper->getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(productHelper->getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(productHelper->getPipelineSelectPropertySystolicModeSupport());
}

View File

@ -10,7 +10,7 @@
using namespace NEO;
struct HwInfoConfigTestLinuxLkf : HwInfoConfigTestLinux {
struct LkfProductHelperLinux : HwInfoConfigTestLinux {
void SetUp() override {
HwInfoConfigTestLinux::SetUp();
@ -18,9 +18,9 @@ struct HwInfoConfigTestLinuxLkf : HwInfoConfigTestLinux {
}
};
LKFTEST_F(HwInfoConfigTestLinuxLkf, configureHwInfoLkf) {
auto &productHelper = getHelper<ProductHelper>();
auto ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
LKFTEST_F(LkfProductHelperLinux, GivenLkfThenHwInfoIsCorrect) {
auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
EXPECT_EQ(0, ret);
EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount);
EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount);
@ -29,18 +29,18 @@ LKFTEST_F(HwInfoConfigTestLinuxLkf, configureHwInfoLkf) {
EXPECT_FALSE(outHwInfo.featureTable.flags.ftrTileY);
}
LKFTEST_F(HwInfoConfigTestLinuxLkf, negative) {
auto &productHelper = getHelper<ProductHelper>();
auto ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
LKFTEST_F(LkfProductHelperLinux, GivenInvalidDeviceIdWhenConfiguringHwInfoThenNegativeOneReturned) {
auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
drm->failRetTopology = true;
drm->storedRetValForEUVal = -1;
ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
EXPECT_EQ(-1, ret);
drm->storedRetValForEUVal = 0;
drm->storedRetValForSSVal = -1;
ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
EXPECT_EQ(-1, ret);
}
@ -48,7 +48,7 @@ template <typename T>
class LkfHwInfoTests : public ::testing::Test {};
using lkfTestTypes = ::testing::Types<LkfHw1x8x8>;
TYPED_TEST_CASE(LkfHwInfoTests, lkfTestTypes);
TYPED_TEST(LkfHwInfoTests, gtSetupIsCorrect) {
TYPED_TEST(LkfHwInfoTests, WhenGtIsSetupThenGtSystemInfoIsCorrect) {
HardwareInfo hwInfo = *defaultHwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);

View File

@ -10,46 +10,43 @@
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
#include "shared/test/unit_test/os_interface/hw_info_config_tests.h"
#include "platforms.h"
using namespace NEO;
TEST(LkfHwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) {
if (IGFX_LAKEFIELD != productFamily) {
return;
}
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
using LkfProductHelper = HwInfoConfigTest;
LKFTEST_F(LkfProductHelper, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) {
GT_SYSTEM_INFO &gtSystemInfo = pInHwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
gtSystemInfo = {0};
EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config));
EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config));
EXPECT_EQ(0u, gtSystemInfo.SliceCount);
EXPECT_EQ(0u, gtSystemInfo.SubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.EUCount);
}
using LkfHwInfo = ::testing::Test;
LKFTEST_F(LkfHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) {
HardwareInfo hwInfo = *defaultHwInfo;
LKFTEST_F(LkfProductHelper, givenProductHelperStringThenAfterSetupResultingVmeIsDisabled) {
uint64_t config = 0x100080008;
hardwareInfoSetup[productFamily](&hwInfo, false, config);
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler);
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption);
EXPECT_FALSE(hwInfo.capabilityTable.supportsVme);
hardwareInfoSetup[productFamily](&pInHwInfo, false, config);
EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler);
EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcPreemption);
EXPECT_FALSE(pInHwInfo.capabilityTable.supportsVme);
}
LKFTEST_F(LkfHwInfo, givenBoolWhenCallLkfHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
LKFTEST_F(LkfProductHelper, givenBoolWhenCallLkfHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
bool boolValue[]{
true, false};
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
GT_SYSTEM_INFO &gtSystemInfo = pInHwInfo.gtSystemInfo;
FeatureTable &featureTable = pInHwInfo.featureTable;
WorkaroundTable &workaroundTable = pInHwInfo.workaroundTable;
uint64_t config = 0x100080008;
@ -58,7 +55,7 @@ LKFTEST_F(LkfHwInfo, givenBoolWhenCallLkfHardwareInfoSetupThenFeatureTableAndWor
gtSystemInfo = {0};
featureTable = {};
workaroundTable = {};
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config);
hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, config);
EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
@ -81,46 +78,42 @@ LKFTEST_F(LkfHwInfo, givenBoolWhenCallLkfHardwareInfoSetupThenFeatureTableAndWor
}
}
LKFTEST_F(LkfHwInfo, givenHwInfoConfigWhenGetProductConfigThenCorrectMatchIsFound) {
HardwareInfo hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
EXPECT_EQ(hwInfoConfig.getProductConfigFromHwInfo(hwInfo), AOT::LKF);
LKFTEST_F(LkfProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
EXPECT_EQ(productHelper->getProductConfigFromHwInfo(pInHwInfo), AOT::LKF);
}
LKFTEST_F(LkfHwInfo, givenHwInfoConfigWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {
HardwareInfo hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
EXPECT_TRUE(hwInfoConfig.isEvictionIfNecessaryFlagSupported());
LKFTEST_F(LkfProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {
EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported());
}
LKFTEST_F(LkfHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) {
HardwareInfo hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
LKFTEST_F(LkfProductHelper, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) {
EXPECT_TRUE(hwInfoConfig.getScmPropertyThreadArbitrationPolicySupport());
EXPECT_TRUE(hwInfoConfig.getScmPropertyCoherencyRequiredSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyZPassAsyncComputeThreadLimitSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyPixelAsyncComputeThreadLimitSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyLargeGrfModeSupport());
EXPECT_FALSE(hwInfoConfig.getScmPropertyDevicePreemptionModeSupport());
EXPECT_TRUE(productHelper->getScmPropertyThreadArbitrationPolicySupport());
EXPECT_TRUE(productHelper->getScmPropertyCoherencyRequiredSupport());
EXPECT_FALSE(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport());
EXPECT_FALSE(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport());
EXPECT_FALSE(productHelper->getScmPropertyLargeGrfModeSupport());
EXPECT_FALSE(productHelper->getScmPropertyDevicePreemptionModeSupport());
EXPECT_FALSE(hwInfoConfig.getStateBaseAddressPropertyGlobalAtomicsSupport());
EXPECT_TRUE(hwInfoConfig.getStateBaseAddressPropertyStatelessMocsSupport());
EXPECT_FALSE(hwInfoConfig.getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport());
EXPECT_FALSE(productHelper->getStateBaseAddressPropertyGlobalAtomicsSupport());
EXPECT_TRUE(productHelper->getStateBaseAddressPropertyStatelessMocsSupport());
EXPECT_FALSE(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport());
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyScratchSizeSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyPrivateScratchSizeSupport());
EXPECT_TRUE(productHelper->getFrontEndPropertyScratchSizeSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyPrivateScratchSizeSupport());
EXPECT_TRUE(hwInfoConfig.getPreemptionDbgPropertyPreemptionModeSupport());
EXPECT_TRUE(hwInfoConfig.getPreemptionDbgPropertyStateSipSupport());
EXPECT_TRUE(hwInfoConfig.getPreemptionDbgPropertyCsrSurfaceSupport());
EXPECT_TRUE(productHelper->getPreemptionDbgPropertyPreemptionModeSupport());
EXPECT_TRUE(productHelper->getPreemptionDbgPropertyStateSipSupport());
EXPECT_TRUE(productHelper->getPreemptionDbgPropertyCsrSurfaceSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyComputeDispatchAllWalkerSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyComputeDispatchAllWalkerSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(productHelper->getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
EXPECT_TRUE(productHelper->getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(productHelper->getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(productHelper->getPipelineSelectPropertySystolicModeSupport());
}