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..612e60fb43 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 @@ -6,6 +6,7 @@ */ #include "shared/source/command_stream/command_stream_receiver.h" +#include "shared/source/helpers/api_specific_config.h" #include "shared/source/memory_manager/allocation_type.h" #include "aubstream/product_family.h" @@ -56,4 +57,14 @@ bool ProductHelperHw::checkBcsForDirectSubmissionStop() const { return true; } +template <> +bool ProductHelperHw::isDeviceUsmPoolAllocatorSupported() const { + return ApiSpecificConfig::OCL == ApiSpecificConfig::getApiType(); +} + +template <> +bool ProductHelperHw::isHostUsmPoolAllocatorSupported() const { + return ApiSpecificConfig::OCL == ApiSpecificConfig::getApiType(); +} + } // namespace NEO 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 70690f66ef..31a01b37fd 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" @@ -19,7 +21,9 @@ #include "aubstream/product_family.h" #include "neo_aot_platforms.h" - +namespace NEO { +extern ApiSpecificConfig::ApiType apiTypeForUlts; +} using namespace NEO; using BmgProductHelper = ProductHelperTest; @@ -131,3 +135,16 @@ BMGTEST_F(BmgProductHelper, whenAdjustScratchSizeThenSizeIsDoubled) { BMGTEST_F(BmgProductHelper, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenTrueIsReturned) { EXPECT_TRUE(productHelper->deferMOCSToPatIndex(true)); } + +BMGTEST_F(BmgProductHelper, givenProductHelperWhenCheckingIsHostDeviceUsmPoolAllocatorSupportedThenCorrectValueIsReturned) { + { + VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::OCL); + EXPECT_TRUE(productHelper->isHostUsmPoolAllocatorSupported()); + EXPECT_TRUE(productHelper->isDeviceUsmPoolAllocatorSupported()); + } + { + VariableBackup backup(&apiTypeForUlts, ApiSpecificConfig::L0); + EXPECT_FALSE(productHelper->isHostUsmPoolAllocatorSupported()); + EXPECT_FALSE(productHelper->isDeviceUsmPoolAllocatorSupported()); + } +} \ No newline at end of file