From a0ed1ab846acc656b4428d8e8c9303515cfb2740 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Thu, 31 Aug 2023 14:46:02 +0000 Subject: [PATCH] test: add new matcher for xe lpg platforms Related-To: NEO-8187 Signed-off-by: Mateusz Jablonski --- .../test_macros/header/common_matchers.h | 7 + .../test/unit_test/xe_hpg_core/CMakeLists.txt | 1 - .../unit_test/xe_hpg_core/mtl/CMakeLists.txt | 1 - .../xe_hpg_core/mtl/hw_info_tests_mtl.cpp | 28 +-- .../mtl/product_helper_tests_mtl.cpp | 168 ------------------ .../xe_hpg_core/mtl/test_device_caps_mtl.cpp | 18 -- ...s_agnostic_product_helper_xe_lpg_tests.cpp | 147 +++++++++++++-- .../os_agnostic_product_helper_xe_lpg_tests.h | 14 -- 8 files changed, 158 insertions(+), 226 deletions(-) delete mode 100644 shared/test/unit_test/xe_hpg_core/mtl/test_device_caps_mtl.cpp delete mode 100644 shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.h diff --git a/shared/test/common/test_macros/header/common_matchers.h b/shared/test/common/test_macros/header/common_matchers.h index f79bbd1ec7..78b76d31ec 100644 --- a/shared/test/common/test_macros/header/common_matchers.h +++ b/shared/test/common/test_macros/header/common_matchers.h @@ -85,3 +85,10 @@ using IsNotPvcOrDg2 = IsNotWithinProducts; using HasStatefulSupport = IsNotAnyGfxCores; using HasNoStatefulSupport = IsAnyGfxCores; + +struct IsXeLpg { + template + static constexpr bool isMatched() { + return IsXeHpgCore::isMatched() && !IsDG2::isMatched(); + } +}; diff --git a/shared/test/unit_test/xe_hpg_core/CMakeLists.txt b/shared/test/unit_test/xe_hpg_core/CMakeLists.txt index 758db485ec..4d733b1416 100644 --- a/shared/test/unit_test/xe_hpg_core/CMakeLists.txt +++ b/shared/test/unit_test/xe_hpg_core/CMakeLists.txt @@ -17,7 +17,6 @@ if(TESTS_XE_HPG_CORE) ${CMAKE_CURRENT_SOURCE_DIR}/gfx_core_helper_tests_xe_hpg_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/image_surface_state_tests_xe_hpg_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/os_agnostic_product_helper_xe_lpg_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/os_agnostic_product_helper_xe_lpg_tests.h ${CMAKE_CURRENT_SOURCE_DIR}/simd_helper_tests_xe_hpg_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_xe_hpg_core.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_encode_dispatch_kernel_xe_hpg_core.cpp diff --git a/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt b/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt index 97071ba0b4..3b2185b21d 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt +++ b/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt @@ -17,7 +17,6 @@ if(TESTS_MTL) ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_tests_mtl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_mtl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/product_config_helper_tests_mtl.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_mtl.cpp ) add_subdirectories() diff --git a/shared/test/unit_test/xe_hpg_core/mtl/hw_info_tests_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/hw_info_tests_mtl.cpp index 0bd86d3729..6bacc6f572 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/hw_info_tests_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/hw_info_tests_mtl.cpp @@ -80,18 +80,6 @@ MTLTEST_F(MtlHwInfoTests, givenMtlCapabilityTableWhenCheckDirectSubmissionEngine } } -MTLTEST_F(MtlHwInfoTests, WhenSetupHardwareInfoWithSetupFeatureTableFlagTrueOrFalseIsCalledThenFeatureTableHasCorrectValueOfFtrLinearCCS) { - HardwareInfo hwInfo = *defaultHwInfo; - auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); - FeatureTable &featureTable = hwInfo.featureTable; - - EXPECT_FALSE(featureTable.flags.ftrLinearCCS); - MtlHwConfig::setupHardwareInfo(&hwInfo, false, *compilerProductHelper); - EXPECT_FALSE(featureTable.flags.ftrLinearCCS); - MtlHwConfig::setupHardwareInfo(&hwInfo, true, *compilerProductHelper); - EXPECT_TRUE(featureTable.flags.ftrLinearCCS); -} - MTLTEST_F(MtlHwInfoTests, WhenSetupHardwareInfoThenCorrectValuesOfCCSAndMultiTileInfoAreSet) { HardwareInfo hwInfo = *defaultHwInfo; auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); @@ -134,3 +122,19 @@ MTLTEST_F(MtlHwInfoTests, GivenEmptyHwInfoForUnitTestsWhenSetupHardwareInfoIsCal EXPECT_TRUE(gtSystemInfo.SliceInfo[i].Enabled); } } + +MTLTEST_F(MtlHwInfoTests, givenMtlConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) { + HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); + GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; + MtlHwConfig::setupHardwareInfoBase(&hwInfo, false, *compilerProductHelper); + + EXPECT_EQ(336u, gtSystemInfo.TotalVsThreads); + EXPECT_EQ(336u, gtSystemInfo.TotalHsThreads); + EXPECT_EQ(336u, gtSystemInfo.TotalDsThreads); + EXPECT_EQ(336u, gtSystemInfo.TotalGsThreads); + EXPECT_EQ(64u, gtSystemInfo.TotalPsThreadsWindowerRange); + EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); + EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); + EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); +} diff --git a/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp index c4e406085a..05de7529ce 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp @@ -5,186 +5,18 @@ * */ -#include "shared/source/command_stream/stream_properties.h" -#include "shared/source/execution_environment/execution_environment.h" -#include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/compiler_product_helper.h" -#include "shared/source/memory_manager/allocation_type.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/release_helper/release_helper.h" #include "shared/source/xe_hpg_core/hw_cmds_mtl.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" -#include "shared/test/common/helpers/variable_backup.h" -#include "shared/test/common/mocks/mock_command_stream_receiver.h" -#include "shared/test/common/mocks/mock_device.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/product_helper_tests.h" -#include "shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.h" -#include "aubstream/product_family.h" #include "platforms.h" using namespace NEO; using MtlProductHelper = ProductHelperTest; -MTLTEST_F(MtlProductHelper, givenMtlConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) { - HardwareInfo hwInfo = *defaultHwInfo; - auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); - GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - MtlHwConfig::setupHardwareInfoBase(&hwInfo, false, *compilerProductHelper); - - EXPECT_EQ(336u, gtSystemInfo.TotalVsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalHsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalDsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalGsThreads); - EXPECT_EQ(64u, gtSystemInfo.TotalPsThreadsWindowerRange); - EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); - EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); - EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); -} - -MTLTEST_F(MtlProductHelper, givenMtlConfigWhenSetupHardwareInfoThenGtSystemInfoHasNonZeroValues) { - HardwareInfo hwInfo = *defaultHwInfo; - auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); - GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - MtlHwConfig::setupHardwareInfo(&hwInfo, false, *compilerProductHelper); - - EXPECT_GT(gtSystemInfo.SliceCount, 0u); - EXPECT_GT(gtSystemInfo.SubSliceCount, 0u); - EXPECT_GT(gtSystemInfo.DualSubSliceCount, 0u); - EXPECT_GT(gtSystemInfo.EUCount, 0u); - EXPECT_GT(gtSystemInfo.MaxEuPerSubSlice, 0u); - EXPECT_GT(gtSystemInfo.MaxSlicesSupported, 0u); - EXPECT_GT_VAL(gtSystemInfo.L3CacheSizeInKb, 0u); - EXPECT_GT(gtSystemInfo.L3BankCount, 0u); - - EXPECT_TRUE(gtSystemInfo.CCSInfo.IsValid); - EXPECT_GT(gtSystemInfo.CCSInfo.NumberOfCCSEnabled, 0u); -} - -MTLTEST_F(MtlProductHelper, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { - EXPECT_EQ(aub_stream::ProductFamily::Mtl, productHelper->getAubStreamProductFamily()); -} - -MTLTEST_F(MtlProductHelper, givenProductHelperWhenCheckDirectSubmissionSupportedThenTrueIsReturned) { - EXPECT_TRUE(productHelper->isDirectSubmissionSupported(pInHwInfo)); -} - -MTLTEST_F(MtlProductHelper, givenMtlProductHelperWhenCheckDirectSubmissionConstantCacheInvalidationNeededThenTrueIsReturned) { - auto hwInfo = *defaultHwInfo; - EXPECT_TRUE(productHelper->isDirectSubmissionConstantCacheInvalidationNeeded(hwInfo)); -} - -MTLTEST_F(MtlProductHelper, givenMtlProductHelperWhenIsInitBuiltinAsyncSupportedThenReturnFalse) { - EXPECT_FALSE(productHelper->isInitBuiltinAsyncSupported(*defaultHwInfo)); -} - -MTLTEST_F(MtlProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { - EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported()); -} - -MTLTEST_F(MtlProductHelper, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) { - - EXPECT_FALSE(productHelper->getScmPropertyThreadArbitrationPolicySupport()); - EXPECT_TRUE(productHelper->getScmPropertyCoherencyRequiredSupport()); - EXPECT_TRUE(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport()); - EXPECT_TRUE(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport()); - EXPECT_TRUE(productHelper->getScmPropertyLargeGrfModeSupport()); - EXPECT_FALSE(productHelper->getScmPropertyDevicePreemptionModeSupport()); - - EXPECT_FALSE(productHelper->getStateBaseAddressPropertyGlobalAtomicsSupport()); - EXPECT_TRUE(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport()); - - EXPECT_TRUE(productHelper->getFrontEndPropertyScratchSizeSupport()); - EXPECT_TRUE(productHelper->getFrontEndPropertyPrivateScratchSizeSupport()); - - EXPECT_TRUE(productHelper->getPreemptionDbgPropertyPreemptionModeSupport()); - EXPECT_TRUE(productHelper->getPreemptionDbgPropertyStateSipSupport()); - EXPECT_FALSE(productHelper->getPreemptionDbgPropertyCsrSurfaceSupport()); - - EXPECT_FALSE(productHelper->getFrontEndPropertyComputeDispatchAllWalkerSupport()); - EXPECT_TRUE(productHelper->getFrontEndPropertyDisableEuFusionSupport()); - EXPECT_TRUE(productHelper->getFrontEndPropertyDisableOverDispatchSupport()); - EXPECT_TRUE(productHelper->getFrontEndPropertySingleSliceDispatchCcsModeSupport()); - - EXPECT_FALSE(productHelper->getPipelineSelectPropertyMediaSamplerDopClockGateSupport()); - EXPECT_TRUE(productHelper->getPipelineSelectPropertySystolicModeSupport()); -} - -MTLTEST_F(MtlProductHelper, givenProductHelperWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { - - auto hwInfo = *defaultHwInfo; - EXPECT_TRUE(productHelper->isDisableOverdispatchAvailable(hwInfo)); - - FrontEndPropertiesSupport fePropertiesSupport{}; - productHelper->fillFrontEndPropertiesSupportStructure(fePropertiesSupport, hwInfo); - EXPECT_TRUE(fePropertiesSupport.disableOverdispatch); -} - -MTLTEST_F(MtlProductHelper, givenCompressionFtrEnabledWhenAskingForPageTableManagerThenReturnCorrectValue) { - auto hwInfo = *defaultHwInfo; - - hwInfo.capabilityTable.ftrRenderCompressedBuffers = false; - hwInfo.capabilityTable.ftrRenderCompressedImages = false; - EXPECT_FALSE(productHelper->isPageTableManagerSupported(hwInfo)); - - hwInfo.capabilityTable.ftrRenderCompressedBuffers = true; - hwInfo.capabilityTable.ftrRenderCompressedImages = false; - EXPECT_TRUE(productHelper->isPageTableManagerSupported(hwInfo)); - - hwInfo.capabilityTable.ftrRenderCompressedBuffers = false; - hwInfo.capabilityTable.ftrRenderCompressedImages = true; - EXPECT_TRUE(productHelper->isPageTableManagerSupported(hwInfo)); - - hwInfo.capabilityTable.ftrRenderCompressedBuffers = true; - hwInfo.capabilityTable.ftrRenderCompressedImages = true; - EXPECT_TRUE(productHelper->isPageTableManagerSupported(hwInfo)); -} - -MTLTEST_F(MtlProductHelper, givenHwIpVersionWhenIsPipeControlPriorToNonPipelinedStateCommandsWARequiredIsCalledOnCcsThenAllowBasedOnReleaseHelper) { - HardwareInfo hwInfo = *defaultHwInfo; - auto isRcs = false; - - AOT::PRODUCT_CONFIG ipReleases[] = {AOT::MTL_M_A0, AOT::MTL_M_B0, AOT::MTL_P_A0, AOT::MTL_P_B0}; - for (auto &ipRelease : ipReleases) { - hwInfo.ipVersion.value = ipRelease; - refreshReleaseHelper(&hwInfo); - - const auto &[isBasicWARequired, isExtendedWARequired] = productHelper->isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs, releaseHelper); - - EXPECT_FALSE(isExtendedWARequired); - EXPECT_EQ(releaseHelper->isPipeControlPriorToNonPipelinedStateCommandsWARequired(), isBasicWARequired); - } -} - -MTLTEST_F(MtlProductHelper, givenMtlAndReleaseHelperNullptrWhenCallingGetMediaFrequencyTileIndexThenReturnFalse) { - uint32_t tileIndex = 0; - ReleaseHelper *releaseHelper = nullptr; - EXPECT_FALSE(productHelper->getMediaFrequencyTileIndex(releaseHelper, tileIndex)); -} - MTLTEST_F(MtlProductHelper, givenCompilerProductHelperWhenGetDefaultHwIpVersionThenCorrectValueIsSet) { EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), AOT::MTL_M_A0); } - -using ProductHelperTestMtl = Test; - -MTLTEST_F(ProductHelperTestMtl, givenMtlWhenCheckIsCachingOnCpuAvailableThenAlwaysFalse) { - const auto &productHelper = getHelper(); - EXPECT_FALSE(productHelper.isCachingOnCpuAvailable()); -} - -MTLTEST_F(ProductHelperTestMtl, givenMtlWhenCheckPreferredAllocationMethodThenAllocateByKmdIsReturned) { - const auto &productHelper = getHelper(); - XeLpgTests::testPreferredAllocationMethod(productHelper); -} - -MTLTEST_F(ProductHelperTestMtl, givenBooleanUncachedWhenCallOverridePatIndexThenProperPatIndexIsReturned) { - const auto &productHelper = getHelper(); - XeLpgTests::testOverridePatIndex(productHelper); -} \ No newline at end of file diff --git a/shared/test/unit_test/xe_hpg_core/mtl/test_device_caps_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/test_device_caps_mtl.cpp deleted file mode 100644 index d75ae646c1..0000000000 --- a/shared/test/unit_test/xe_hpg_core/mtl/test_device_caps_mtl.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (C) 2022-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/test/common/fixtures/device_fixture.h" -#include "shared/test/common/mocks/mock_device.h" -#include "shared/test/common/test_macros/hw_test.h" - -using namespace NEO; - -using MtlUsDeviceIdTest = Test; - -MTLTEST_F(MtlUsDeviceIdTest, givenMtlProductWhenCheckFp64SupportThenReturnFalse) { - EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsFP64); -} diff --git a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp b/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp index 373c741e92..3945e72283 100644 --- a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp +++ b/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp @@ -5,26 +5,31 @@ * */ -#include "shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.h" - #include "shared/source/memory_manager/allocation_type.h" #include "shared/source/os_interface/product_helper.h" -#include "shared/test/common/test_macros/test.h" +#include "shared/source/release_helper/release_helper.h" +#include "shared/test/common/fixtures/device_fixture.h" +#include "shared/test/common/helpers/default_hw_info.h" +#include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/test_macros/hw_test.h" + +#include "aubstream/product_family.h" +#include "platforms.h" using namespace NEO; -void XeLpgTests::testOverridePatIndex(const ProductHelper &productHelper) { - uint64_t patIndex = 1u; - bool isUncached = true; - EXPECT_EQ(2u, productHelper.overridePatIndex(isUncached, patIndex)); - isUncached = false; - EXPECT_EQ(patIndex, productHelper.overridePatIndex(isUncached, patIndex)); -} +struct XeLpgProductHelperTests : public ::Test { + void SetUp() override { + ::Test::SetUp(); + productHelper = &pDevice->getProductHelper(); + } + ProductHelper const *productHelper = nullptr; +}; -void XeLpgTests::testPreferredAllocationMethod(const ProductHelper &productHelper) { +HWTEST2_F(XeLpgProductHelperTests, whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturned, IsXeLpg) { for (auto i = 0; i < static_cast(AllocationType::COUNT); i++) { auto allocationType = static_cast(i); - auto preferredAllocationMethod = productHelper.getPreferredAllocationMethod(allocationType); + auto preferredAllocationMethod = productHelper->getPreferredAllocationMethod(allocationType); if (allocationType == AllocationType::TAG_BUFFER || allocationType == AllocationType::TIMESTAMP_PACKET_TAG_BUFFER) { EXPECT_FALSE(preferredAllocationMethod.has_value()); @@ -34,3 +39,121 @@ void XeLpgTests::testPreferredAllocationMethod(const ProductHelper &productHelpe } } } + +HWTEST2_F(XeLpgProductHelperTests, givenBooleanUncachedWhenCallOverridePatIndexThenProperPatIndexIsReturned, IsXeLpg) { + uint64_t patIndex = 1u; + bool isUncached = true; + EXPECT_EQ(2u, productHelper->overridePatIndex(isUncached, patIndex)); + + isUncached = false; + EXPECT_EQ(patIndex, productHelper->overridePatIndex(isUncached, patIndex)); +} + +HWTEST2_F(XeLpgProductHelperTests, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned, IsXeLpg) { + EXPECT_EQ(aub_stream::ProductFamily::Mtl, productHelper->getAubStreamProductFamily()); +} + +HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCheckDirectSubmissionSupportedThenTrueIsReturned, IsXeLpg) { + EXPECT_TRUE(productHelper->isDirectSubmissionSupported(*defaultHwInfo)); +} + +HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCheckDirectSubmissionConstantCacheInvalidationNeededThenTrueIsReturned, IsXeLpg) { + auto hwInfo = *defaultHwInfo; + EXPECT_TRUE(productHelper->isDirectSubmissionConstantCacheInvalidationNeeded(hwInfo)); +} + +HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenIsInitBuiltinAsyncSupportedThenReturnFalse, IsXeLpg) { + EXPECT_FALSE(productHelper->isInitBuiltinAsyncSupported(*defaultHwInfo)); +} + +HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue, IsXeLpg) { + EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported()); +} + +HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues, IsXeLpg) { + + EXPECT_FALSE(productHelper->getScmPropertyThreadArbitrationPolicySupport()); + EXPECT_TRUE(productHelper->getScmPropertyCoherencyRequiredSupport()); + EXPECT_TRUE(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport()); + EXPECT_TRUE(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport()); + EXPECT_TRUE(productHelper->getScmPropertyLargeGrfModeSupport()); + EXPECT_FALSE(productHelper->getScmPropertyDevicePreemptionModeSupport()); + + EXPECT_FALSE(productHelper->getStateBaseAddressPropertyGlobalAtomicsSupport()); + EXPECT_TRUE(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport()); + + EXPECT_TRUE(productHelper->getFrontEndPropertyScratchSizeSupport()); + EXPECT_TRUE(productHelper->getFrontEndPropertyPrivateScratchSizeSupport()); + + EXPECT_TRUE(productHelper->getPreemptionDbgPropertyPreemptionModeSupport()); + EXPECT_TRUE(productHelper->getPreemptionDbgPropertyStateSipSupport()); + EXPECT_FALSE(productHelper->getPreemptionDbgPropertyCsrSurfaceSupport()); + + EXPECT_FALSE(productHelper->getFrontEndPropertyComputeDispatchAllWalkerSupport()); + EXPECT_TRUE(productHelper->getFrontEndPropertyDisableEuFusionSupport()); + EXPECT_TRUE(productHelper->getFrontEndPropertyDisableOverDispatchSupport()); + EXPECT_TRUE(productHelper->getFrontEndPropertySingleSliceDispatchCcsModeSupport()); + + EXPECT_FALSE(productHelper->getPipelineSelectPropertyMediaSamplerDopClockGateSupport()); + EXPECT_TRUE(productHelper->getPipelineSelectPropertySystolicModeSupport()); +} + +HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned, IsXeLpg) { + + auto hwInfo = *defaultHwInfo; + EXPECT_TRUE(productHelper->isDisableOverdispatchAvailable(hwInfo)); + + FrontEndPropertiesSupport fePropertiesSupport{}; + productHelper->fillFrontEndPropertiesSupportStructure(fePropertiesSupport, hwInfo); + EXPECT_TRUE(fePropertiesSupport.disableOverdispatch); +} + +HWTEST2_F(XeLpgProductHelperTests, givenCompressionFtrEnabledWhenAskingForPageTableManagerThenReturnCorrectValue, IsXeLpg) { + auto hwInfo = *defaultHwInfo; + + hwInfo.capabilityTable.ftrRenderCompressedBuffers = false; + hwInfo.capabilityTable.ftrRenderCompressedImages = false; + EXPECT_FALSE(productHelper->isPageTableManagerSupported(hwInfo)); + + hwInfo.capabilityTable.ftrRenderCompressedBuffers = true; + hwInfo.capabilityTable.ftrRenderCompressedImages = false; + EXPECT_TRUE(productHelper->isPageTableManagerSupported(hwInfo)); + + hwInfo.capabilityTable.ftrRenderCompressedBuffers = false; + hwInfo.capabilityTable.ftrRenderCompressedImages = true; + EXPECT_TRUE(productHelper->isPageTableManagerSupported(hwInfo)); + + hwInfo.capabilityTable.ftrRenderCompressedBuffers = true; + hwInfo.capabilityTable.ftrRenderCompressedImages = true; + EXPECT_TRUE(productHelper->isPageTableManagerSupported(hwInfo)); +} + +HWTEST2_F(XeLpgProductHelperTests, givenHwIpVersionWhenIsPipeControlPriorToNonPipelinedStateCommandsWARequiredIsCalledOnCcsThenAllowBasedOnReleaseHelper, IsXeLpg) { + HardwareInfo hwInfo = *defaultHwInfo; + auto isRcs = false; + + AOT::PRODUCT_CONFIG ipReleases[] = {AOT::MTL_M_A0, AOT::MTL_M_B0, AOT::MTL_P_A0, AOT::MTL_P_B0}; + for (auto &ipRelease : ipReleases) { + hwInfo.ipVersion.value = ipRelease; + auto releaseHelper = ReleaseHelper::create(ipRelease); + + const auto &[isBasicWARequired, isExtendedWARequired] = productHelper->isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs, releaseHelper.get()); + + EXPECT_FALSE(isExtendedWARequired); + EXPECT_EQ(releaseHelper->isPipeControlPriorToNonPipelinedStateCommandsWARequired(), isBasicWARequired); + } +} + +HWTEST2_F(XeLpgProductHelperTests, givenReleaseHelperNullptrWhenCallingGetMediaFrequencyTileIndexThenReturnFalse, IsXeLpg) { + uint32_t tileIndex = 0; + ReleaseHelper *releaseHelper = nullptr; + EXPECT_FALSE(productHelper->getMediaFrequencyTileIndex(releaseHelper, tileIndex)); +} + +HWTEST2_F(XeLpgProductHelperTests, whenCheckIsCachingOnCpuAvailableThenAlwaysFalse, IsXeLpg) { + EXPECT_FALSE(productHelper->isCachingOnCpuAvailable()); +} + +HWTEST2_F(XeLpgProductHelperTests, whenCheckFp64SupportThenReturnTrue, IsXeLpg) { + EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsFP64); +} \ No newline at end of file diff --git a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.h b/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.h deleted file mode 100644 index 83c7a55d92..0000000000 --- a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (C) 2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -namespace NEO { -class ProductHelper; -struct XeLpgTests { - static void testOverridePatIndex(const ProductHelper &productHelper); - static void testPreferredAllocationMethod(const ProductHelper &productHelper); -}; -} // namespace NEO \ No newline at end of file