diff --git a/level_zero/core/source/driver/driver_handle_imp.cpp b/level_zero/core/source/driver/driver_handle_imp.cpp index e752bb6f52..696e25d122 100644 --- a/level_zero/core/source/driver/driver_handle_imp.cpp +++ b/level_zero/core/source/driver/driver_handle_imp.cpp @@ -21,6 +21,7 @@ #include "shared/source/memory_manager/allocation_properties.h" #include "shared/source/memory_manager/memory_manager.h" #include "shared/source/memory_manager/unified_memory_manager.h" +#include "shared/source/memory_manager/usm_pool_params.h" #include "shared/source/os_interface/device_factory.h" #include "shared/source/os_interface/os_interface.h" #include "shared/source/os_interface/os_library.h" @@ -378,30 +379,27 @@ void DriverHandleImp::initHostUsmAllocPool() { nullptr == device->getL0Debugger() && NEO::DeviceFactory::isHwModeSelected(); } - auto poolSize = 2 * MemoryConstants::megaByte; + auto poolParams = NEO::UsmPoolParams::getUsmPoolParams(); if (NEO::debugManager.flags.EnableHostUsmAllocationPool.get() != -1) { usmHostAllocPoolingEnabled = NEO::debugManager.flags.EnableHostUsmAllocationPool.get() > 0; - poolSize = NEO::debugManager.flags.EnableHostUsmAllocationPool.get() * MemoryConstants::megaByte; + poolParams.poolSize = NEO::debugManager.flags.EnableHostUsmAllocationPool.get() * MemoryConstants::megaByte; } if (usmHostAllocPoolingEnabled) { NEO::SVMAllocsManager::UnifiedMemoryProperties memoryProperties(InternalMemoryType::hostUnifiedMemory, MemoryConstants::pageSize2M, rootDeviceIndices, deviceBitfields); - usmHostMemAllocPool.initialize(svmAllocsManager, memoryProperties, poolSize, 0u, 1 * MemoryConstants::megaByte); + usmHostMemAllocPool.initialize(svmAllocsManager, memoryProperties, poolParams.poolSize, poolParams.minServicedSize, poolParams.maxServicedSize); } } void DriverHandleImp::initDeviceUsmAllocPool(NEO::Device &device) { - const uint64_t minServicedSize = 0u; - const uint64_t maxServicedSize = 1 * MemoryConstants::megaByte; bool enabled = NEO::ApiSpecificConfig::isDeviceUsmPoolingEnabled() && device.getProductHelper().isDeviceUsmPoolAllocatorSupported() && nullptr == device.getL0Debugger() && NEO::DeviceFactory::isHwModeSelected(); - uint64_t poolSize = 2 * MemoryConstants::megaByte; - + auto poolParams = NEO::UsmPoolParams::getUsmPoolParams(); if (NEO::debugManager.flags.EnableDeviceUsmAllocationPool.get() != -1) { enabled = NEO::debugManager.flags.EnableDeviceUsmAllocationPool.get() > 0; - poolSize = NEO::debugManager.flags.EnableDeviceUsmAllocationPool.get() * MemoryConstants::megaByte; + poolParams.poolSize = NEO::debugManager.flags.EnableDeviceUsmAllocationPool.get() * MemoryConstants::megaByte; } if (enabled) { @@ -415,7 +413,7 @@ void DriverHandleImp::initDeviceUsmAllocPool(NEO::Device &device) { deviceBitfields); poolMemoryProperties.device = &device; poolMemoryProperties.allocationFlags.flags.compressedHint = compressionEnabledByDefault; - device.getUsmMemAllocPool()->initialize(this->svmAllocsManager, poolMemoryProperties, poolSize, minServicedSize, maxServicedSize); + device.getUsmMemAllocPool()->initialize(this->svmAllocsManager, poolMemoryProperties, poolParams.poolSize, poolParams.minServicedSize, poolParams.maxServicedSize); } } diff --git a/opencl/source/context/context.cpp b/opencl/source/context/context.cpp index 926632b156..7b60b50ec2 100644 --- a/opencl/source/context/context.cpp +++ b/opencl/source/context/context.cpp @@ -504,22 +504,6 @@ bool Context::isSingleDeviceContext() { return getNumDevices() == 1 && devices[0]->getNumGenericSubDevices() == 0; } -UsmPoolParams Context::getUsmDevicePoolParams() const { - const auto &productHelper = devices[0]->getDevice().getProductHelper(); - - if (productHelper.is2MBLocalMemAlignmentEnabled()) { - return { - .poolSize = 16 * MemoryConstants::megaByte, - .minServicedSize = 0u, - .maxServicedSize = 2 * MemoryConstants::megaByte}; - } - - return { - .poolSize = 2 * MemoryConstants::megaByte, - .minServicedSize = 0u, - .maxServicedSize = 1 * MemoryConstants::megaByte}; -} - void Context::initializeDeviceUsmAllocationPool() { if (this->usmPoolInitialized) { return; @@ -539,7 +523,7 @@ void Context::initializeDeviceUsmAllocationPool() { productHelper.isDeviceUsmPoolAllocatorSupported() && DeviceFactory::isHwModeSelected(); - auto usmDevicePoolParams = getUsmDevicePoolParams(); + auto usmDevicePoolParams = UsmPoolParams::getUsmPoolParams(); if (debugManager.flags.EnableDeviceUsmAllocationPool.get() != -1) { enabled = debugManager.flags.EnableDeviceUsmAllocationPool.get() > 0; usmDevicePoolParams.poolSize = debugManager.flags.EnableDeviceUsmAllocationPool.get() * MemoryConstants::megaByte; diff --git a/opencl/source/context/context.h b/opencl/source/context/context.h index b41962fb61..259eeb85e0 100644 --- a/opencl/source/context/context.h +++ b/opencl/source/context/context.h @@ -10,6 +10,7 @@ #include "shared/source/helpers/constants.h" #include "shared/source/helpers/string.h" #include "shared/source/memory_manager/unified_memory_pooling.h" +#include "shared/source/memory_manager/usm_pool_params.h" #include "shared/source/utilities/buffer_pool_allocator.h" #include "shared/source/utilities/stackvec.h" @@ -20,7 +21,6 @@ #include "opencl/source/gtpin/gtpin_notify.h" #include "opencl/source/helpers/base_object.h" #include "opencl/source/helpers/destructor_callbacks.h" -#include "opencl/source/helpers/usm_pool_params.h" #include "opencl/source/mem_obj/map_operations_handler.h" #include @@ -266,8 +266,6 @@ class Context : public BaseObject<_cl_context> { } }; - UsmPoolParams getUsmDevicePoolParams() const; - Context(void(CL_CALLBACK *pfnNotify)(const char *, const void *, size_t, void *) = nullptr, void *userData = nullptr); diff --git a/opencl/source/helpers/CMakeLists.txt b/opencl/source/helpers/CMakeLists.txt index a0fd9ebf27..6686d3cb19 100644 --- a/opencl/source/helpers/CMakeLists.txt +++ b/opencl/source/helpers/CMakeLists.txt @@ -48,8 +48,6 @@ set(RUNTIME_SRCS_HELPERS_BASE ${CMAKE_CURRENT_SOURCE_DIR}/task_information.cpp ${CMAKE_CURRENT_SOURCE_DIR}/task_information.h ${CMAKE_CURRENT_SOURCE_DIR}/task_information.inl - ${CMAKE_CURRENT_SOURCE_DIR}/usm_pool_params.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/usm_pool_params.h ) if(SUPPORT_XEHP_AND_LATER) diff --git a/opencl/source/helpers/usm_pool_params.cpp b/opencl/source/helpers/usm_pool_params.cpp deleted file mode 100644 index 0b19c8a699..0000000000 --- a/opencl/source/helpers/usm_pool_params.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2018-2025 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "opencl/source/helpers/usm_pool_params.h" - -#include "shared/source/helpers/constants.h" - -namespace NEO { -UsmPoolParams UsmPoolParams::getUsmHostPoolParams() { - return { - .poolSize = 2 * MemoryConstants::megaByte, - .minServicedSize = 0u, - .maxServicedSize = 1 * MemoryConstants::megaByte}; -} -} // namespace NEO diff --git a/opencl/source/platform/platform.cpp b/opencl/source/platform/platform.cpp index 4c9b421480..3d0e708696 100644 --- a/opencl/source/platform/platform.cpp +++ b/opencl/source/platform/platform.cpp @@ -18,6 +18,7 @@ #include "shared/source/helpers/debug_helpers.h" #include "shared/source/helpers/get_info.h" #include "shared/source/helpers/hw_info.h" +#include "shared/source/memory_manager/usm_pool_params.h" #include "shared/source/os_interface/debug_env_reader.h" #include "shared/source/os_interface/device_factory.h" #include "shared/source/pin/pin.h" @@ -26,7 +27,6 @@ #include "opencl/source/cl_device/cl_device.h" #include "opencl/source/gtpin/gtpin_notify.h" #include "opencl/source/helpers/get_info_status_mapper.h" -#include "opencl/source/helpers/usm_pool_params.h" #include "opencl/source/platform/platform_info.h" #include "opencl/source/sharings/sharing_factory.h" @@ -325,7 +325,7 @@ void Platform::initializeHostUsmAllocationPool() { usmHostAllocPoolingEnabled &= device->getProductHelper().isHostUsmPoolAllocatorSupported() && DeviceFactory::isHwModeSelected(); } - auto usmHostPoolParams = UsmPoolParams::getUsmHostPoolParams(); + auto usmHostPoolParams = UsmPoolParams::getUsmPoolParams(); if (debugManager.flags.EnableHostUsmAllocationPool.get() != -1) { usmHostAllocPoolingEnabled = debugManager.flags.EnableHostUsmAllocationPool.get() > 0; usmHostPoolParams.poolSize = debugManager.flags.EnableHostUsmAllocationPool.get() * MemoryConstants::megaByte; diff --git a/opencl/test/unit_test/context/context_tests.cpp b/opencl/test/unit_test/context/context_tests.cpp index c50af72151..26e698d483 100644 --- a/opencl/test/unit_test/context/context_tests.cpp +++ b/opencl/test/unit_test/context/context_tests.cpp @@ -11,6 +11,7 @@ #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/local_memory_access_modes.h" #include "shared/source/memory_manager/unified_memory_manager.h" +#include "shared/source/memory_manager/usm_pool_params.h" #include "shared/source/os_interface/device_factory.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/variable_backup.h" @@ -25,7 +26,6 @@ #include "opencl/source/command_queue/command_queue.h" #include "opencl/source/context/context.inl" #include "opencl/source/gtpin/gtpin_defs.h" -#include "opencl/source/helpers/usm_pool_params.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/sharings/sharing.h" #include "opencl/test/unit_test/fixtures/platform_fixture.h" @@ -799,46 +799,16 @@ struct ContextUsmPoolParamsTest : public ::testing::Test { DebugManagerStateRestore restore; }; -TEST_F(ContextUsmPoolParamsTest, GivenDisabled2MBLocalMemAlignmentWhenGettingUsmPoolParamsThenReturnCorrectValues) { - mockProductHelper->is2MBLocalMemAlignmentEnabledResult = false; - +TEST_F(ContextUsmPoolParamsTest, whenGettingUsmPoolParamsThenReturnCorrectValues) { cl_device_id devices[] = {device}; context.reset(Context::create(nullptr, ClDeviceVector(devices, 1), nullptr, nullptr, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); - const UsmPoolParams expectedUsmHostPoolParams{ - .poolSize = 2 * MemoryConstants::megaByte, - .minServicedSize = 0u, - .maxServicedSize = 1 * MemoryConstants::megaByte}; - - const UsmPoolParams expectedUsmDevicePoolParams{ - .poolSize = 2 * MemoryConstants::megaByte, - .minServicedSize = 0u, - .maxServicedSize = 1 * MemoryConstants::megaByte}; - - EXPECT_TRUE(compareUsmPoolParams(expectedUsmHostPoolParams, UsmPoolParams::getUsmHostPoolParams())); - EXPECT_TRUE(compareUsmPoolParams(expectedUsmDevicePoolParams, context->getUsmDevicePoolParams())); -} - -TEST_F(ContextUsmPoolParamsTest, GivenEnabled2MBLocalMemAlignmentWhenGettingUsmPoolParamsThenReturnCorrectValues) { - mockProductHelper->is2MBLocalMemAlignmentEnabledResult = true; - - cl_device_id devices[] = {device}; - context.reset(Context::create(nullptr, ClDeviceVector(devices, 1), nullptr, nullptr, retVal)); - EXPECT_EQ(CL_SUCCESS, retVal); - - const UsmPoolParams expectedUsmHostPoolParams{ - .poolSize = 2 * MemoryConstants::megaByte, - .minServicedSize = 0u, - .maxServicedSize = 1 * MemoryConstants::megaByte}; - - const UsmPoolParams expectedUsmDevicePoolParams{ - .poolSize = 16 * MemoryConstants::megaByte, + const UsmPoolParams expectedPoolParams{ + .poolSize = UsmPoolParams::getUsmPoolSize(), .minServicedSize = 0u, .maxServicedSize = 2 * MemoryConstants::megaByte}; - - EXPECT_TRUE(compareUsmPoolParams(expectedUsmHostPoolParams, UsmPoolParams::getUsmHostPoolParams())); - EXPECT_TRUE(compareUsmPoolParams(expectedUsmDevicePoolParams, context->getUsmDevicePoolParams())); + EXPECT_TRUE(compareUsmPoolParams(expectedPoolParams, UsmPoolParams::getUsmPoolParams())); } TEST_F(ContextUsmPoolParamsTest, GivenUsmPoolAllocatorSupportedWhenInitializingUsmPoolsThenPoolsAreInitializedWithCorrectParams) { @@ -863,21 +833,10 @@ TEST_F(ContextUsmPoolParamsTest, GivenUsmPoolAllocatorSupportedWhenInitializingU .poolSize = mockHostUsmMemAllocPool->poolSize, .minServicedSize = mockHostUsmMemAllocPool->minServicedSize, .maxServicedSize = mockHostUsmMemAllocPool->maxServicedSize}; - const UsmPoolParams expectedUsmHostPoolParams = UsmPoolParams::getUsmHostPoolParams(); + const UsmPoolParams expectedUsmHostPoolParams = UsmPoolParams::getUsmPoolParams(); EXPECT_TRUE(compareUsmPoolParams(expectedUsmHostPoolParams, givenUsmHostPoolParams)); } - - { - auto mockDeviceUsmMemAllocPool = static_cast(&context->getDeviceMemAllocPool()); - const UsmPoolParams givenUsmDevicePoolParams{ - .poolSize = mockDeviceUsmMemAllocPool->poolSize, - .minServicedSize = mockDeviceUsmMemAllocPool->minServicedSize, - .maxServicedSize = mockDeviceUsmMemAllocPool->maxServicedSize}; - const UsmPoolParams expectedUsmDevicePoolParams = context->getUsmDevicePoolParams(); - - EXPECT_TRUE(compareUsmPoolParams(expectedUsmDevicePoolParams, givenUsmDevicePoolParams)); - } } TEST_F(ContextUsmPoolParamsTest, GivenUsmPoolAllocatorSupportedWhenInitializingUsmPoolsThenPoolsAreInitializedOnlyWithHwCsr) { diff --git a/opencl/test/unit_test/linux/CMakeLists.txt b/opencl/test/unit_test/linux/CMakeLists.txt index e44f10a879..cb54a8b660 100644 --- a/opencl/test/unit_test/linux/CMakeLists.txt +++ b/opencl/test/unit_test/linux/CMakeLists.txt @@ -28,6 +28,7 @@ add_executable(igdrcl_${target_name} ${NEO_SHARED_DIRECTORY}/dll/device_dll.cpp ${NEO_SHARED_DIRECTORY}/dll/direct_submission_controller_enabled.cpp ${NEO_SHARED_DIRECTORY}/dll/unified_memory_reuse_cleaner_enabled.cpp + ${NEO_SHARED_DIRECTORY}/dll/usm_pool_size.cpp ${NEO_SHARED_DIRECTORY}/dll/linux/drm_neo_create.cpp ${NEO_SHARED_DIRECTORY}/dll/linux${BRANCH_DIR_SUFFIX}/options_linux.cpp ${NEO_SHARED_DIRECTORY}/dll/linux/options_linux.inl diff --git a/opencl/test/unit_test/linux/main_linux_dll.cpp b/opencl/test/unit_test/linux/main_linux_dll.cpp index 010a976100..38bab4c87d 100644 --- a/opencl/test/unit_test/linux/main_linux_dll.cpp +++ b/opencl/test/unit_test/linux/main_linux_dll.cpp @@ -12,6 +12,7 @@ #include "shared/source/helpers/basic_math.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/memory_manager/memory_manager.h" +#include "shared/source/memory_manager/usm_pool_params.h" #include "shared/source/os_interface/driver_info.h" #include "shared/source/os_interface/linux/allocator_helper.h" #include "shared/source/os_interface/linux/i915.h" @@ -641,6 +642,10 @@ TEST(AllocatorHelper, givenExpectedSizeToReserveWhenGetSizeToReserveCalledThenEx EXPECT_EQ((maxNBitValue(47) + 1) / 4, NEO::getSizeToReserve()); } +TEST(UsmPoolTest, whenGetUsmPoolSizeCalledThenReturnCorrectSize) { + EXPECT_EQ(32 * MemoryConstants::megaByte, NEO::UsmPoolParams::getUsmPoolSize()); +} + TEST(DrmMemoryManagerCreate, whenCallCreateMemoryManagerThenDrmMemoryManagerIsCreated) { DebugManagerStateRestore restorer; debugManager.flags.OverridePatIndex.set(0); diff --git a/opencl/test/unit_test/mem_obj/usm_memory_pool_tests.cpp b/opencl/test/unit_test/mem_obj/usm_memory_pool_tests.cpp index 976c1b7a24..e4f66d39a7 100644 --- a/opencl/test/unit_test/mem_obj/usm_memory_pool_tests.cpp +++ b/opencl/test/unit_test/mem_obj/usm_memory_pool_tests.cpp @@ -103,8 +103,8 @@ TEST_F(UsmPoolTest, givenUsmPoolsSupportedWhenCreatingAllocationsThenPoolsAreIni EXPECT_NE(nullptr, pooledHostAlloc); clMemFreeINTEL(mockContext.get(), pooledHostAlloc); - EXPECT_EQ(2 * MemoryConstants::megaByte, mockDeviceUsmMemAllocPool->poolSize); - EXPECT_EQ(2 * MemoryConstants::megaByte, mockHostUsmMemAllocPool->poolSize); + EXPECT_EQ(UsmPoolParams::getUsmPoolSize(), mockDeviceUsmMemAllocPool->poolSize); + EXPECT_EQ(UsmPoolParams::getUsmPoolSize(), mockHostUsmMemAllocPool->poolSize); EXPECT_TRUE(mockDeviceUsmMemAllocPool->isInitialized()); EXPECT_TRUE(mockHostUsmMemAllocPool->isInitialized()); } diff --git a/opencl/test/unit_test/mocks/mock_context.h b/opencl/test/unit_test/mocks/mock_context.h index 4b685ddbc3..fa44bd46a7 100644 --- a/opencl/test/unit_test/mocks/mock_context.h +++ b/opencl/test/unit_test/mocks/mock_context.h @@ -33,7 +33,6 @@ class MockContext : public Context { using Context::deviceBitfields; using Context::devices; using Context::driverDiagnostics; - using Context::getUsmDevicePoolParams; using Context::maxRootDeviceIndex; using Context::memoryManager; using Context::preferD3dSharedResources; diff --git a/opencl/test/unit_test/windows/CMakeLists.txt b/opencl/test/unit_test/windows/CMakeLists.txt index 83eece79c9..be8c7a4bfe 100644 --- a/opencl/test/unit_test/windows/CMakeLists.txt +++ b/opencl/test/unit_test/windows/CMakeLists.txt @@ -36,6 +36,7 @@ if(WIN32) ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/sys_calls_winmm.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/wddm_calls.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_get_staging_buffer_size.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_usm_pool_size.cpp ${NEO_SOURCE_DIR}/opencl/test/unit_test/test_macros/test_checks_ocl.cpp ) diff --git a/shared/source/dll/CMakeLists.txt b/shared/source/dll/CMakeLists.txt index d25237b48e..23124ce296 100644 --- a/shared/source/dll/CMakeLists.txt +++ b/shared/source/dll/CMakeLists.txt @@ -19,6 +19,7 @@ set(NEO_SHARED_DLLS ${CMAKE_CURRENT_SOURCE_DIR}/create_command_stream.cpp ${CMAKE_CURRENT_SOURCE_DIR}/options_dll.cpp ${CMAKE_CURRENT_SOURCE_DIR}/get_staging_buffer_size.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/usm_pool_size.cpp ) add_library(neo_shared_dlls_precompiled_objects OBJECT ${NEO_SHARED_DLLS}) diff --git a/shared/source/dll/usm_pool_size.cpp b/shared/source/dll/usm_pool_size.cpp new file mode 100644 index 0000000000..821dded802 --- /dev/null +++ b/shared/source/dll/usm_pool_size.cpp @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/helpers/constants.h" +#include "shared/source/memory_manager/usm_pool_params.h" + +namespace NEO { +size_t UsmPoolParams::getUsmPoolSize() { + return 32 * MemoryConstants::megaByte; +} +} // namespace NEO diff --git a/shared/source/memory_manager/CMakeLists.txt b/shared/source/memory_manager/CMakeLists.txt index dba473a369..dfa16c2e00 100644 --- a/shared/source/memory_manager/CMakeLists.txt +++ b/shared/source/memory_manager/CMakeLists.txt @@ -65,6 +65,8 @@ set(NEO_CORE_MEMORY_MANAGER ${CMAKE_CURRENT_SOURCE_DIR}/page_table.inl ${CMAKE_CURRENT_SOURCE_DIR}/prefetch_manager.cpp ${CMAKE_CURRENT_SOURCE_DIR}/prefetch_manager.h + ${CMAKE_CURRENT_SOURCE_DIR}/usm_pool_params.h + ${CMAKE_CURRENT_SOURCE_DIR}/usm_pool_params.cpp ) if(ENABLE_DYNAMIC_MEMORY_TRACKING) diff --git a/shared/source/memory_manager/usm_pool_params.cpp b/shared/source/memory_manager/usm_pool_params.cpp new file mode 100644 index 0000000000..301583f2b5 --- /dev/null +++ b/shared/source/memory_manager/usm_pool_params.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/memory_manager/usm_pool_params.h" + +#include "shared/source/helpers/constants.h" + +namespace NEO { +UsmPoolParams UsmPoolParams::getUsmPoolParams() { + return { + .poolSize = UsmPoolParams::getUsmPoolSize(), + .minServicedSize = 0u, + .maxServicedSize = 2 * MemoryConstants::megaByte}; +} +} // namespace NEO diff --git a/opencl/source/helpers/usm_pool_params.h b/shared/source/memory_manager/usm_pool_params.h similarity index 76% rename from opencl/source/helpers/usm_pool_params.h rename to shared/source/memory_manager/usm_pool_params.h index f8b7193eb4..c966397082 100644 --- a/opencl/source/helpers/usm_pool_params.h +++ b/shared/source/memory_manager/usm_pool_params.h @@ -14,6 +14,7 @@ struct UsmPoolParams { size_t minServicedSize{0}; size_t maxServicedSize{0}; - static UsmPoolParams getUsmHostPoolParams(); + static UsmPoolParams getUsmPoolParams(); + static size_t getUsmPoolSize(); }; } // namespace NEO diff --git a/shared/test/common/libult/CMakeLists.txt b/shared/test/common/libult/CMakeLists.txt index 2d69952081..fca698fced 100644 --- a/shared/test/common/libult/CMakeLists.txt +++ b/shared/test/common/libult/CMakeLists.txt @@ -210,6 +210,7 @@ set(neo_libult_SRCS_LINUX ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/setup_external_dependencies_${DRIVER_MODEL}.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/linux/sys_calls_linux_ult.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_get_staging_buffer_size.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_usm_pool_size.cpp ) set_property(GLOBAL APPEND PROPERTY neo_libult_SRCS_LINUX ${neo_libult_SRCS_LINUX}) @@ -226,6 +227,7 @@ set(neo_libult_SRCS_WINDOWS ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/sys_calls_winmm.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/wddm_calls.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_get_staging_buffer_size.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_usm_pool_size.cpp ) set_property(GLOBAL APPEND PROPERTY neo_libult_SRCS_WINDOWS ${neo_libult_SRCS_WINDOWS}) diff --git a/shared/test/common/mocks/mock_usm_pool_size.cpp b/shared/test/common/mocks/mock_usm_pool_size.cpp new file mode 100644 index 0000000000..9863190e9f --- /dev/null +++ b/shared/test/common/mocks/mock_usm_pool_size.cpp @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/helpers/constants.h" +#include "shared/source/memory_manager/usm_pool_params.h" + +namespace NEO { +size_t UsmPoolParams::getUsmPoolSize() { + return MemoryConstants::pageSize; +} +} // namespace NEO