mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
ProductHelper ults cleanup - XeHpc
Related-To: NEO-6853 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com> Don't use DeviceFixture if not needed Use HwInfoConfigTest fixture
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
a7d4162ca2
commit
ba9c50694d
@ -19,7 +19,7 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct HwInfoConfigTestLinuxPvc : HwInfoConfigTestLinux {
|
||||
struct PvcProductHelperLinux : HwInfoConfigTestLinux {
|
||||
void SetUp() override {
|
||||
HwInfoConfigTestLinux::SetUp();
|
||||
|
||||
@ -28,34 +28,33 @@ struct HwInfoConfigTestLinuxPvc : HwInfoConfigTestLinux {
|
||||
}
|
||||
};
|
||||
|
||||
PVCTEST_F(HwInfoConfigTestLinuxPvc, WhenConfiguringHwInfoThenZeroIsReturned) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
auto ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
|
||||
PVCTEST_F(PvcProductHelperLinux, WhenConfiguringHwInfoThenZeroIsReturned) {
|
||||
|
||||
auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment());
|
||||
EXPECT_EQ(0, ret);
|
||||
}
|
||||
|
||||
PVCTEST_F(HwInfoConfigTestLinuxPvc, given57bAddressSpaceWhenConfiguringHwInfoThenSetFtrFlag) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
PVCTEST_F(PvcProductHelperLinux, given57bAddressSpaceWhenConfiguringHwInfoThenSetFtrFlag) {
|
||||
|
||||
outHwInfo.featureTable.flags.ftr57bGPUAddressing = false;
|
||||
outHwInfo.platform.eRenderCoreFamily = defaultHwInfo->platform.eRenderCoreFamily;
|
||||
|
||||
outHwInfo.capabilityTable.gpuAddressSpace = maxNBitValue(48);
|
||||
int ret = productHelper.configureHardwareCustom(&outHwInfo, osInterface);
|
||||
int ret = productHelper->configureHardwareCustom(&outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_FALSE(outHwInfo.featureTable.flags.ftr57bGPUAddressing);
|
||||
|
||||
outHwInfo.capabilityTable.gpuAddressSpace = maxNBitValue(57);
|
||||
ret = productHelper.configureHardwareCustom(&outHwInfo, osInterface);
|
||||
ret = productHelper->configureHardwareCustom(&outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
auto value = outHwInfo.featureTable.flags.ftr57bGPUAddressing;
|
||||
EXPECT_EQ(1u, value);
|
||||
}
|
||||
|
||||
PVCTEST_F(HwInfoConfigTestLinuxPvc, GivenPvcWhenConfigureHardwareCustomThenKmdNotifyIsEnabled) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
PVCTEST_F(PvcProductHelperLinux, GivenPvcWhenConfigureHardwareCustomThenKmdNotifyIsEnabled) {
|
||||
|
||||
OSInterface osIface;
|
||||
productHelper.configureHardwareCustom(&pInHwInfo, &osIface);
|
||||
productHelper->configureHardwareCustom(&pInHwInfo, &osIface);
|
||||
EXPECT_TRUE(pInHwInfo.capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(150ll, pInHwInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
EXPECT_TRUE(pInHwInfo.capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission);
|
||||
@ -64,50 +63,48 @@ PVCTEST_F(HwInfoConfigTestLinuxPvc, GivenPvcWhenConfigureHardwareCustomThenKmdNo
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPatIndexProgrammingSupportedThenReturnFalse, IGFX_PVC);
|
||||
|
||||
PVCTEST_F(HwInfoConfigTestLinuxPvc, givenHwInfoConfigWhenAskedIfPatIndexProgrammingSupportedThenReturnTrue) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
|
||||
EXPECT_TRUE(hwInfoConfig.isVmBindPatIndexProgrammingSupported());
|
||||
PVCTEST_F(PvcProductHelperLinux, givenProductHelperWhenAskedIfPatIndexProgrammingSupportedThenReturnTrue) {
|
||||
|
||||
EXPECT_TRUE(productHelper->isVmBindPatIndexProgrammingSupported());
|
||||
}
|
||||
|
||||
PVCTEST_F(ProductConfigTests, givenAotConfigWhenSetHwInfoRevisionIdForPvcThenCorrectValueIsSet) {
|
||||
PVCTEST_F(PvcProductHelperLinux, givenAotConfigWhenSetHwInfoRevisionIdForPvcThenCorrectValueIsSet) {
|
||||
for (const auto &config : AOT_PVC::productConfigs) {
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = config;
|
||||
CompilerHwInfoConfig::get(hwInfo.platform.eProductFamily)->setProductConfigForHwInfo(hwInfo, aotConfig);
|
||||
EXPECT_EQ(hwInfo.platform.usRevId, aotConfig.ProductConfigID.Revision);
|
||||
CompilerHwInfoConfig::get(pInHwInfo.platform.eProductFamily)->setProductConfigForHwInfo(pInHwInfo, aotConfig);
|
||||
EXPECT_EQ(pInHwInfo.platform.usRevId, aotConfig.ProductConfigID.Revision);
|
||||
}
|
||||
}
|
||||
|
||||
PVCTEST_F(HwInfoConfigTestLinuxPvc, givenOsInterfaceIsNullWhenGetDeviceMemoryPhysicalSizeInBytesIsCalledThenReturnZero) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
EXPECT_EQ(0u, hwInfoConfig->getDeviceMemoryPhysicalSizeInBytes(nullptr, 0));
|
||||
PVCTEST_F(PvcProductHelperLinux, givenOsInterfaceIsNullWhenGetDeviceMemoryPhysicalSizeInBytesIsCalledThenReturnZero) {
|
||||
EXPECT_EQ(0u, productHelper->getDeviceMemoryPhysicalSizeInBytes(nullptr, 0));
|
||||
}
|
||||
|
||||
PVCTEST_F(HwInfoConfigTestLinuxPvc, givenHwInfoConfigWhenAskedIsBlitSplitEnqueueWARequiredThenReturnTrue) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
EXPECT_TRUE(hwInfoConfig->isBlitSplitEnqueueWARequired(pInHwInfo));
|
||||
PVCTEST_F(PvcProductHelperLinux, givenProductHelperWhenAskedIsBlitSplitEnqueueWARequiredThenReturnTrue) {
|
||||
EXPECT_TRUE(productHelper->isBlitSplitEnqueueWARequired(pInHwInfo));
|
||||
}
|
||||
|
||||
PVCTEST_F(HwInfoConfigTestLinuxPvc, givenOsInterfaceIsNullWhenGetDeviceMemoryMaxBandWidthInBytesPerSecondIsCalledThenReturnZero) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelperLinux, givenOsInterfaceIsNullWhenGetDeviceMemoryMaxBandWidthInBytesPerSecondIsCalledThenReturnZero) {
|
||||
|
||||
auto testHwInfo = *defaultHwInfo;
|
||||
testHwInfo.platform.usRevId = 0x8;
|
||||
EXPECT_EQ(0u, hwInfoConfig->getDeviceMemoryMaxBandWidthInBytesPerSecond(testHwInfo, nullptr, 0));
|
||||
EXPECT_EQ(0u, productHelper->getDeviceMemoryMaxBandWidthInBytesPerSecond(testHwInfo, nullptr, 0));
|
||||
}
|
||||
|
||||
PVCTEST_F(HwInfoConfigTestLinuxPvc, WhenGetDeviceMemoryPhysicalSizeInBytesIsCalledThenReturnSuccess) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelperLinux, WhenGetDeviceMemoryPhysicalSizeInBytesIsCalledThenReturnSuccess) {
|
||||
|
||||
drm->setPciPath("device");
|
||||
drm->storedGetDeviceMemoryPhysicalSizeInBytesStatus = true;
|
||||
drm->useBaseGetDeviceMemoryPhysicalSizeInBytes = false;
|
||||
EXPECT_EQ(1024u, hwInfoConfig->getDeviceMemoryPhysicalSizeInBytes(osInterface, 0));
|
||||
EXPECT_EQ(1024u, productHelper->getDeviceMemoryPhysicalSizeInBytes(osInterface, 0));
|
||||
}
|
||||
|
||||
PVCTEST_F(HwInfoConfigTestLinuxPvc, WhenGetDeviceMemoryMaxBandWidthInBytesPerSecondIsCalledThenReturnSuccess) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelperLinux, WhenGetDeviceMemoryMaxBandWidthInBytesPerSecondIsCalledThenReturnSuccess) {
|
||||
|
||||
auto testHwInfo = *defaultHwInfo;
|
||||
testHwInfo.platform.usRevId = 0x8;
|
||||
drm->storedGetDeviceMemoryMaxClockRateInMhzStatus = true;
|
||||
drm->useBaseGetDeviceMemoryMaxClockRateInMhz = false;
|
||||
EXPECT_EQ(51200000000u, hwInfoConfig->getDeviceMemoryMaxBandWidthInBytesPerSecond(testHwInfo, osInterface, 0));
|
||||
EXPECT_EQ(51200000000u, productHelper->getDeviceMemoryMaxBandWidthInBytesPerSecond(testHwInfo, osInterface, 0));
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/source/xe_hpc_core/hw_cmds_pvc.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/gtest_helpers.h"
|
||||
@ -22,236 +21,213 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using PvcHwInfoConfig = Test<DeviceFixture>;
|
||||
using PvcHwInfo = HwInfoConfigTest;
|
||||
using PvcProductHelper = HwInfoConfigTest;
|
||||
|
||||
PVCTEST_F(PvcHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) {
|
||||
PVCTEST_F(PvcProductHelper, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) {
|
||||
EXPECT_EQ(aub_stream::ProductFamily::Pvc, productHelper->getAubStreamProductFamily());
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPVCRevId3AndAboveWhenGettingThreadEuRatioForScratchThen16IsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelper, givenPVCRevId3AndAboveWhenGettingThreadEuRatioForScratchThen16IsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
hwInfo.platform.usRevId = 3;
|
||||
EXPECT_EQ(16u, hwInfoConfig.getThreadEuRatioForScratch(hwInfo));
|
||||
EXPECT_EQ(16u, productHelper->getThreadEuRatioForScratch(hwInfo));
|
||||
|
||||
hwInfo.platform.usRevId = 4;
|
||||
EXPECT_EQ(16u, hwInfoConfig.getThreadEuRatioForScratch(hwInfo));
|
||||
EXPECT_EQ(16u, productHelper->getThreadEuRatioForScratch(hwInfo));
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPVCRevId0WhenGettingThreadEuRatioForScratchThen8IsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelper, givenPVCRevId0WhenGettingThreadEuRatioForScratchThen8IsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
hwInfo.platform.usRevId = 0;
|
||||
EXPECT_EQ(8u, hwInfoConfig.getThreadEuRatioForScratch(hwInfo));
|
||||
EXPECT_EQ(8u, productHelper->getThreadEuRatioForScratch(hwInfo));
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPVCWithDifferentSteppingsThenImplicitScalingIsEnabledForBAndHigher) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
|
||||
PVCTEST_F(PvcProductHelper, givenPVCWithDifferentSteppingsThenImplicitScalingIsEnabledForBAndHigher) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
for (uint32_t stepping = 0; stepping < 0x10; stepping++) {
|
||||
auto hwRevIdFromStepping = hwInfoConfig.getHwRevIdFromStepping(stepping, hwInfo);
|
||||
auto hwRevIdFromStepping = productHelper->getHwRevIdFromStepping(stepping, hwInfo);
|
||||
if (hwRevIdFromStepping != CommonConstants::invalidStepping) {
|
||||
hwInfo.platform.usRevId = hwRevIdFromStepping;
|
||||
const bool shouldSupportImplicitScaling = hwRevIdFromStepping >= REVISION_B;
|
||||
EXPECT_EQ(shouldSupportImplicitScaling, hwInfoConfig.isImplicitScalingSupported(hwInfo)) << "hwRevId: " << hwRevIdFromStepping;
|
||||
EXPECT_EQ(shouldSupportImplicitScaling, productHelper->isImplicitScalingSupported(hwInfo)) << "hwRevId: " << hwRevIdFromStepping;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPvcHwInfoWhenIsIpSamplingSupportedThenCorrectResultIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelper, givenPvcHwInfoWhenIsIpSamplingSupportedThenCorrectResultIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
for (const auto &deviceId : pvcXlDeviceIds) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
EXPECT_FALSE(hwInfoConfig.isIpSamplingSupported(hwInfo));
|
||||
EXPECT_FALSE(productHelper->isIpSamplingSupported(hwInfo));
|
||||
}
|
||||
|
||||
for (const auto &deviceId : pvcXtDeviceIds) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
EXPECT_TRUE(hwInfoConfig.isIpSamplingSupported(hwInfo));
|
||||
EXPECT_TRUE(productHelper->isIpSamplingSupported(hwInfo));
|
||||
}
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenHwInfoConfigWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
EXPECT_TRUE(hwInfoConfig.isEvictionIfNecessaryFlagSupported());
|
||||
PVCTEST_F(PvcProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {
|
||||
|
||||
EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported());
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPvcHwInfoConfigWhenIsPrefetcherDisablingInDirectSubmissionRequiredThenFalseIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
EXPECT_FALSE(hwInfoConfig.isPrefetcherDisablingInDirectSubmissionRequired());
|
||||
PVCTEST_F(PvcProductHelper, givenPvcProductHelperWhenIsPrefetcherDisablingInDirectSubmissionRequiredThenFalseIsReturned) {
|
||||
EXPECT_FALSE(productHelper->isPrefetcherDisablingInDirectSubmissionRequired());
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPvcHwInfoConfigWhenIsStatefulAddressingModeSupportedThenReturnFalse) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
EXPECT_FALSE(hwInfoConfig.isStatefulAddressingModeSupported());
|
||||
PVCTEST_F(PvcProductHelper, givenPvcProductHelperWhenIsStatefulAddressingModeSupportedThenReturnFalse) {
|
||||
EXPECT_FALSE(productHelper->isStatefulAddressingModeSupported());
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPvcSteppingWhenQueryIsComputeDispatchAllWalkerEnableInCfeStateRequiredThenAppropriateValueIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelper, givenPvcSteppingWhenQueryIsComputeDispatchAllWalkerEnableInCfeStateRequiredThenAppropriateValueIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
hwInfo.platform.usRevId = 0x0;
|
||||
EXPECT_FALSE(hwInfoConfig.isComputeDispatchAllWalkerEnableInCfeStateRequired(hwInfo));
|
||||
EXPECT_FALSE(productHelper->isComputeDispatchAllWalkerEnableInCfeStateRequired(hwInfo));
|
||||
|
||||
hwInfo.platform.usRevId = 0x6;
|
||||
EXPECT_TRUE(hwInfoConfig.isComputeDispatchAllWalkerEnableInCfeStateRequired(hwInfo));
|
||||
EXPECT_TRUE(productHelper->isComputeDispatchAllWalkerEnableInCfeStateRequired(hwInfo));
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) {
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
PVCTEST_F(PvcProductHelper, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) {
|
||||
|
||||
EXPECT_TRUE(hwInfoConfig.getScmPropertyThreadArbitrationPolicySupport());
|
||||
EXPECT_TRUE(hwInfoConfig.getScmPropertyCoherencyRequiredSupport());
|
||||
EXPECT_FALSE(hwInfoConfig.getScmPropertyZPassAsyncComputeThreadLimitSupport());
|
||||
EXPECT_FALSE(hwInfoConfig.getScmPropertyPixelAsyncComputeThreadLimitSupport());
|
||||
EXPECT_TRUE(hwInfoConfig.getScmPropertyLargeGrfModeSupport());
|
||||
EXPECT_FALSE(hwInfoConfig.getScmPropertyDevicePreemptionModeSupport());
|
||||
EXPECT_TRUE(productHelper->getScmPropertyThreadArbitrationPolicySupport());
|
||||
EXPECT_TRUE(productHelper->getScmPropertyCoherencyRequiredSupport());
|
||||
EXPECT_FALSE(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport());
|
||||
EXPECT_FALSE(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport());
|
||||
EXPECT_TRUE(productHelper->getScmPropertyLargeGrfModeSupport());
|
||||
EXPECT_FALSE(productHelper->getScmPropertyDevicePreemptionModeSupport());
|
||||
|
||||
EXPECT_FALSE(hwInfoConfig.getStateBaseAddressPropertyGlobalAtomicsSupport());
|
||||
EXPECT_TRUE(hwInfoConfig.getStateBaseAddressPropertyStatelessMocsSupport());
|
||||
EXPECT_TRUE(hwInfoConfig.getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport());
|
||||
EXPECT_FALSE(productHelper->getStateBaseAddressPropertyGlobalAtomicsSupport());
|
||||
EXPECT_TRUE(productHelper->getStateBaseAddressPropertyStatelessMocsSupport());
|
||||
EXPECT_TRUE(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport());
|
||||
|
||||
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyScratchSizeSupport());
|
||||
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyPrivateScratchSizeSupport());
|
||||
EXPECT_TRUE(productHelper->getFrontEndPropertyScratchSizeSupport());
|
||||
EXPECT_TRUE(productHelper->getFrontEndPropertyPrivateScratchSizeSupport());
|
||||
|
||||
EXPECT_TRUE(hwInfoConfig.getPreemptionDbgPropertyPreemptionModeSupport());
|
||||
EXPECT_TRUE(hwInfoConfig.getPreemptionDbgPropertyStateSipSupport());
|
||||
EXPECT_FALSE(hwInfoConfig.getPreemptionDbgPropertyCsrSurfaceSupport());
|
||||
EXPECT_TRUE(productHelper->getPreemptionDbgPropertyPreemptionModeSupport());
|
||||
EXPECT_TRUE(productHelper->getPreemptionDbgPropertyStateSipSupport());
|
||||
EXPECT_FALSE(productHelper->getPreemptionDbgPropertyCsrSurfaceSupport());
|
||||
|
||||
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyComputeDispatchAllWalkerSupport());
|
||||
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
|
||||
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
|
||||
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
|
||||
EXPECT_TRUE(productHelper->getFrontEndPropertyComputeDispatchAllWalkerSupport());
|
||||
EXPECT_FALSE(productHelper->getFrontEndPropertyDisableEuFusionSupport());
|
||||
EXPECT_TRUE(productHelper->getFrontEndPropertyDisableOverDispatchSupport());
|
||||
EXPECT_TRUE(productHelper->getFrontEndPropertySingleSliceDispatchCcsModeSupport());
|
||||
|
||||
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
|
||||
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
|
||||
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
|
||||
EXPECT_TRUE(productHelper->getPipelineSelectPropertyModeSelectedSupport());
|
||||
EXPECT_FALSE(productHelper->getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
|
||||
EXPECT_TRUE(productHelper->getPipelineSelectPropertySystolicModeSupport());
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPvcWhenCallingGetDeviceMemoryNameThenHbmIsReturned) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
auto deviceMemoryName = hwInfoConfig->getDeviceMemoryName();
|
||||
PVCTEST_F(PvcProductHelper, givenPvcWhenCallingGetDeviceMemoryNameThenHbmIsReturned) {
|
||||
|
||||
auto deviceMemoryName = productHelper->getDeviceMemoryName();
|
||||
EXPECT_TRUE(hasSubstr(deviceMemoryName, std::string("HBM")));
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenHwInfoConfigWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) {
|
||||
auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelper, givenProductHelperWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
EXPECT_FALSE(hwInfoConfig.isDisableOverdispatchAvailable(hwInfo));
|
||||
EXPECT_FALSE(productHelper->isDisableOverdispatchAvailable(hwInfo));
|
||||
|
||||
FrontEndPropertiesSupport fePropertiesSupport{};
|
||||
hwInfoConfig.fillFrontEndPropertiesSupportStructure(fePropertiesSupport, hwInfo);
|
||||
productHelper->fillFrontEndPropertiesSupportStructure(fePropertiesSupport, hwInfo);
|
||||
EXPECT_FALSE(fePropertiesSupport.disableOverdispatch);
|
||||
|
||||
hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo);
|
||||
EXPECT_TRUE(hwInfoConfig.isDisableOverdispatchAvailable(hwInfo));
|
||||
hwInfo.platform.usRevId = productHelper->getHwRevIdFromStepping(REVISION_B, hwInfo);
|
||||
EXPECT_TRUE(productHelper->isDisableOverdispatchAvailable(hwInfo));
|
||||
|
||||
hwInfoConfig.fillFrontEndPropertiesSupportStructure(fePropertiesSupport, hwInfo);
|
||||
productHelper->fillFrontEndPropertiesSupportStructure(fePropertiesSupport, hwInfo);
|
||||
EXPECT_TRUE(fePropertiesSupport.disableOverdispatch);
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenHwInfoConfigWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenTrueIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelper, givenProductHelperWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenTrueIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
auto isRcs = false;
|
||||
|
||||
const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs);
|
||||
const auto &[isBasicWARequired, isExtendedWARequired] = productHelper->isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs);
|
||||
|
||||
EXPECT_FALSE(isBasicWARequired);
|
||||
EXPECT_FALSE(isExtendedWARequired);
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPvcHwInfoConfigWhenCheckDirectSubmissionSupportedThenTrueIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelper, givenPvcProductHelperWhenCheckDirectSubmissionSupportedThenTrueIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
EXPECT_TRUE(hwInfoConfig.isDirectSubmissionSupported(hwInfo));
|
||||
EXPECT_TRUE(productHelper->isDirectSubmissionSupported(hwInfo));
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPvcHwInfoConfigWhenCheckCopyEngineSelectorEnabledThenFalseIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelper, givenPvcProductHelperWhenCheckCopyEngineSelectorEnabledThenFalseIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
EXPECT_FALSE(hwInfoConfig.isCopyEngineSelectorEnabled(hwInfo));
|
||||
EXPECT_FALSE(productHelper->isCopyEngineSelectorEnabled(hwInfo));
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenHwInfoConfigAndProgramExtendedPipeControlPriorToNonPipelinedStateCommandDisabledWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenFalseIsReturned) {
|
||||
PVCTEST_F(PvcProductHelper, givenProductHelperAndProgramExtendedPipeControlPriorToNonPipelinedStateCommandDisabledWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenFalseIsReturned) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.set(0);
|
||||
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
auto isRcs = false;
|
||||
|
||||
const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs);
|
||||
const auto &[isBasicWARequired, isExtendedWARequired] = productHelper->isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs);
|
||||
|
||||
EXPECT_FALSE(isExtendedWARequired);
|
||||
EXPECT_FALSE(isBasicWARequired);
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPvcWhenConfiguringThenDisableCccs) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
|
||||
productHelper.configureHardwareCustom(&hwInfo, nullptr);
|
||||
EXPECT_FALSE(hwInfo.featureTable.flags.ftrRcsNode);
|
||||
PVCTEST_F(PvcProductHelper, givenPvcWhenConfiguringThenDisableCccs) {
|
||||
productHelper->configureHardwareCustom(&pInHwInfo, nullptr);
|
||||
EXPECT_FALSE(pInHwInfo.featureTable.flags.ftrRcsNode);
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenDebugVariableSetWhenConfiguringThenEnableCccs) {
|
||||
PVCTEST_F(PvcProductHelper, givenDebugVariableSetWhenConfiguringThenEnableCccs) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.NodeOrdinal.set(static_cast<int32_t>(aub_stream::EngineType::ENGINE_CCCS));
|
||||
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
|
||||
productHelper.configureHardwareCustom(&hwInfo, nullptr);
|
||||
productHelper->configureHardwareCustom(&hwInfo, nullptr);
|
||||
EXPECT_TRUE(hwInfo.featureTable.flags.ftrRcsNode);
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenDeviceIdThenProperMaxThreadsForWorkgroupIsReturned) {
|
||||
PVCTEST_F(PvcProductHelper, givenDeviceIdThenProperMaxThreadsForWorkgroupIsReturned) {
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
||||
for (const auto &deviceId : pvcXlDeviceIds) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
EXPECT_EQ(64u, hwInfoConfig.getMaxThreadsForWorkgroupInDSSOrSS(hwInfo, 64u, 64u));
|
||||
EXPECT_EQ(64u, productHelper->getMaxThreadsForWorkgroupInDSSOrSS(hwInfo, 64u, 64u));
|
||||
}
|
||||
|
||||
for (const auto &deviceId : pvcXtDeviceIds) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
uint32_t numThreadsPerEU = hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
|
||||
EXPECT_EQ(64u * numThreadsPerEU, hwInfoConfig.getMaxThreadsForWorkgroupInDSSOrSS(hwInfo, 64u, 64u));
|
||||
EXPECT_EQ(64u * numThreadsPerEU, productHelper->getMaxThreadsForWorkgroupInDSSOrSS(hwInfo, 64u, 64u));
|
||||
}
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConversionIsCorrect) {
|
||||
PVCTEST_F(PvcProductHelper, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConversionIsCorrect) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
||||
for (uint32_t testValue = 0; testValue < 0xFF; testValue++) {
|
||||
for (const auto *pvc : {&pvcXlDeviceIds, &pvcXtDeviceIds}) {
|
||||
for (const auto &deviceId : *pvc) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
auto hwRevIdFromStepping = hwInfoConfig.getHwRevIdFromStepping(testValue, hwInfo);
|
||||
auto hwRevIdFromStepping = productHelper->getHwRevIdFromStepping(testValue, hwInfo);
|
||||
if (hwRevIdFromStepping != CommonConstants::invalidStepping) {
|
||||
hwInfo.platform.usRevId = hwRevIdFromStepping;
|
||||
EXPECT_EQ(testValue, hwInfoConfig.getSteppingFromHwRevId(hwInfo));
|
||||
EXPECT_EQ(testValue, productHelper->getSteppingFromHwRevId(hwInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
hwInfo.platform.usRevId = testValue;
|
||||
auto steppingFromHwRevId = hwInfoConfig.getSteppingFromHwRevId(hwInfo);
|
||||
auto steppingFromHwRevId = productHelper->getSteppingFromHwRevId(hwInfo);
|
||||
if (steppingFromHwRevId != CommonConstants::invalidStepping) {
|
||||
bool anyMatchAfterConversionFromStepping = false;
|
||||
for (const auto *pvc : {&pvcXlDeviceIds, &pvcXtDeviceIds}) {
|
||||
for (const auto &deviceId : *pvc) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
auto hwRevId = hwInfoConfig.getHwRevIdFromStepping(steppingFromHwRevId, hwInfo);
|
||||
auto hwRevId = productHelper->getHwRevIdFromStepping(steppingFromHwRevId, hwInfo);
|
||||
EXPECT_NE(CommonConstants::invalidStepping, hwRevId);
|
||||
// expect values to match. 0x1 and 0x0 translate to the same stepping so they are interpreted as a match too.
|
||||
if (((testValue & PVC::pvcSteppingBits) == (hwRevId & PVC::pvcSteppingBits)) ||
|
||||
@ -265,17 +241,16 @@ PVCTEST_F(PvcHwInfoConfig, givenVariousValuesWhenConvertingHwRevIdAndSteppingThe
|
||||
}
|
||||
}
|
||||
|
||||
PVCTEST_F(PvcHwInfoConfig, givenPvcHwInfoConfigWhenIsIpSamplingSupportedThenCorrectResultIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
|
||||
PVCTEST_F(PvcProductHelper, givenPvcProductHelperWhenIsIpSamplingSupportedThenCorrectResultIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
for (const auto &deviceId : pvcXlDeviceIds) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
EXPECT_FALSE(hwInfoConfig.isIpSamplingSupported(hwInfo));
|
||||
EXPECT_FALSE(productHelper->isIpSamplingSupported(hwInfo));
|
||||
}
|
||||
|
||||
for (const auto &deviceId : pvcXtDeviceIds) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
EXPECT_TRUE(hwInfoConfig.isIpSamplingSupported(hwInfo));
|
||||
EXPECT_TRUE(productHelper->isIpSamplingSupported(hwInfo));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user