diff --git a/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl b/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl index 8a404e9268..5dcc04a896 100644 --- a/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl +++ b/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl @@ -56,4 +56,14 @@ bool ProductHelperHw::checkBcsForDirectSubmissionStop() const { return true; } +template <> +bool ProductHelperHw::isDeviceUsmAllocationReuseSupported() const { + return true; +} + +template <> +bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { + return true; +} + } // namespace NEO diff --git a/shared/test/unit_test/os_interface/product_helper_tests.cpp b/shared/test/unit_test/os_interface/product_helper_tests.cpp index 13d0108769..3d9dc1ead6 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -827,19 +827,6 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsUsmAllocationReuseS } } -HWTEST2_F(ProductHelperTest, givenProductHelperWhenCheckingIsUsmAllocationReuseSupportedThenCorrectValueIsReturned, IsXe2HpgCore) { - { - VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::OCL); - EXPECT_TRUE(productHelper->isHostUsmAllocationReuseSupported()); - EXPECT_TRUE(productHelper->isDeviceUsmAllocationReuseSupported()); - } - { - VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::L0); - EXPECT_FALSE(productHelper->isHostUsmAllocationReuseSupported()); - EXPECT_FALSE(productHelper->isDeviceUsmAllocationReuseSupported()); - } -} - HWTEST_F(ProductHelperTest, givenProductHelperWhenCheckingIsUnlockingLockedPtrNecessaryThenReturnFalse) { EXPECT_FALSE(productHelper->isUnlockingLockedPtrNecessary(pInHwInfo)); } diff --git a/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp b/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp index 51b3823556..b707bb2f90 100644 --- a/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp +++ b/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp @@ -6,12 +6,14 @@ */ #include "shared/source/command_stream/stream_properties.h" +#include "shared/source/helpers/api_specific_config.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/xe2_hpg_core/hw_cmds_bmg.h" #include "shared/source/xe2_hpg_core/hw_info_xe2_hpg_core.h" #include "shared/test/common/helpers/default_hw_info.h" +#include "shared/test/common/helpers/variable_backup.h" #include "shared/test/common/mocks/mock_release_helper.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" @@ -20,6 +22,9 @@ #include "aubstream/product_family.h" #include "neo_aot_platforms.h" +namespace NEO { +extern ApiSpecificConfig::ApiType apiTypeForUlts; +} using namespace NEO; using BmgProductHelper = ProductHelperTest; @@ -132,3 +137,29 @@ BMGTEST_F(BmgProductHelper, whenAdjustScratchSizeThenSizeIsDoubled) { BMGTEST_F(BmgProductHelper, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenTrueIsReturned) { EXPECT_TRUE(productHelper->deferMOCSToPatIndex(true)); } + +BMGTEST_F(BmgProductHelper, givenProductHelperWhenCheckingIsUsmPoolAllocatorSupportedThenCorrectValueIsReturned) { + { + VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::OCL); + EXPECT_TRUE(productHelper->isHostUsmPoolAllocatorSupported()); + EXPECT_TRUE(productHelper->isDeviceUsmPoolAllocatorSupported()); + } + { + VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::L0); + EXPECT_TRUE(productHelper->isHostUsmPoolAllocatorSupported()); + EXPECT_TRUE(productHelper->isDeviceUsmPoolAllocatorSupported()); + } +} + +BMGTEST_F(BmgProductHelper, givenProductHelperWhenCheckingIsUsmReuseSupportedThenCorrectValueIsReturned) { + { + VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::OCL); + EXPECT_TRUE(productHelper->isHostUsmAllocationReuseSupported()); + EXPECT_TRUE(productHelper->isDeviceUsmAllocationReuseSupported()); + } + { + VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::L0); + EXPECT_TRUE(productHelper->isHostUsmAllocationReuseSupported()); + EXPECT_TRUE(productHelper->isDeviceUsmAllocationReuseSupported()); + } +} diff --git a/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp b/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp index 78c80acc52..d7173b191a 100644 --- a/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp +++ b/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp @@ -140,6 +140,19 @@ LNLTEST_F(LnlProductHelper, givenProductHelperWhenCheckingIsBufferPoolAllocatorS EXPECT_TRUE(productHelper->isBufferPoolAllocatorSupported()); } +LNLTEST_F(LnlProductHelper, givenProductHelperWhenCheckingIsUsmAllocationReuseSupportedThenCorrectValueIsReturned) { + { + VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::OCL); + EXPECT_TRUE(productHelper->isHostUsmAllocationReuseSupported()); + EXPECT_TRUE(productHelper->isDeviceUsmAllocationReuseSupported()); + } + { + VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::L0); + EXPECT_FALSE(productHelper->isHostUsmAllocationReuseSupported()); + EXPECT_FALSE(productHelper->isDeviceUsmAllocationReuseSupported()); + } +} + LNLTEST_F(LnlProductHelper, givenProductHelperWhenCheckingIsHostDeviceUsmPoolAllocatorSupportedThenCorrectValueIsReturned) { { VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::OCL);