diff --git a/opencl/test/unit_test/command_queue/command_queue_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_tests.cpp index bc9eaaa4b8..d5a9c0e783 100644 --- a/opencl/test/unit_test/command_queue/command_queue_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_tests.cpp @@ -715,7 +715,7 @@ HWTEST_P(CommandQueueIndirectHeapTest, givenCommandStreamReceiverWithReusableAll auto memoryManager = pDevice->getMemoryManager(); - auto allocationSize = NEO::HeapSize::getDefaultHeapSize(this->GetParam()) * 2; + auto allocationSize = NEO::HeapSize::defaultHeapSize * 2; GraphicsAllocation *allocation = nullptr; diff --git a/opencl/test/unit_test/linux/CMakeLists.txt b/opencl/test/unit_test/linux/CMakeLists.txt index 4331295149..cb54a8b660 100644 --- a/opencl/test/unit_test/linux/CMakeLists.txt +++ b/opencl/test/unit_test/linux/CMakeLists.txt @@ -29,7 +29,6 @@ add_executable(igdrcl_${target_name} ${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/default_heap_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 a7f4dd73be..c1c34fb722 100644 --- a/opencl/test/unit_test/linux/main_linux_dll.cpp +++ b/opencl/test/unit_test/linux/main_linux_dll.cpp @@ -11,7 +11,6 @@ #include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/basic_math.h" #include "shared/source/helpers/gfx_core_helper.h" -#include "shared/source/indirect_heap/heap_size.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" @@ -650,12 +649,6 @@ TEST(UsmPoolTest, whenGetUsmPoolSizeCalledThenReturnCorrectSize) { EXPECT_EQ(usmPoolSize, NEO::UsmPoolParams::getUsmPoolSize(gfxCoreHelper)); } -TEST(HeapTest, whenGetDefaultHeapSizeThenReturnCorrectValue) { - EXPECT_EQ(4 * MemoryConstants::megaByte, NEO::HeapSize::getDefaultHeapSize(IndirectHeapType::indirectObject)); - EXPECT_EQ(MemoryConstants::pageSize64k, NEO::HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState)); - EXPECT_EQ(MemoryConstants::pageSize64k, NEO::HeapSize::getDefaultHeapSize(IndirectHeapType::dynamicState)); -} - TEST(DrmMemoryManagerCreate, whenCallCreateMemoryManagerThenDrmMemoryManagerIsCreated) { DebugManagerStateRestore restorer; debugManager.flags.OverridePatIndex.set(0); diff --git a/opencl/test/unit_test/windows/CMakeLists.txt b/opencl/test/unit_test/windows/CMakeLists.txt index 561162103c..be8c7a4bfe 100644 --- a/opencl/test/unit_test/windows/CMakeLists.txt +++ b/opencl/test/unit_test/windows/CMakeLists.txt @@ -19,7 +19,7 @@ if(WIN32) add_executable(igdrcl_windows_dll_tests ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}get_devices_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/main_windows_dll.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/wddm_create_tests.cpp ${NEO_IGDRCL_WINDOWS_DLL_TESTS_TARGET_OBJECTS} ${NEO_SHARED_DIRECTORY}/dll/device_dll.cpp ${NEO_SHARED_DIRECTORY}/dll/direct_submission_controller_enabled.cpp @@ -27,7 +27,6 @@ if(WIN32) ${NEO_SHARED_DIRECTORY}/dll/unified_memory_reuse_cleaner_enabled.cpp ${NEO_SHARED_DIRECTORY}/dll/create_command_stream.cpp ${NEO_SHARED_DIRECTORY}/dll/wddm/wddm_create.cpp - ${NEO_SHARED_DIRECTORY}/dll/default_heap_size.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_wddm.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/create_wddm_memory_manager.cpp ${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows${BRANCH_DIR_SUFFIX}/options.cpp diff --git a/opencl/test/unit_test/windows/main_windows_dll.cpp b/opencl/test/unit_test/windows/wddm_create_tests.cpp similarity index 68% rename from opencl/test/unit_test/windows/main_windows_dll.cpp rename to opencl/test/unit_test/windows/wddm_create_tests.cpp index 20068c8a27..309034465d 100644 --- a/opencl/test/unit_test/windows/main_windows_dll.cpp +++ b/opencl/test/unit_test/windows/wddm_create_tests.cpp @@ -7,7 +7,6 @@ #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/indirect_heap/heap_size.h" #include "shared/source/os_interface/os_interface.h" #include "shared/source/os_interface/windows/wddm/wddm.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" @@ -25,9 +24,3 @@ TEST(wddmCreateTests, givenInputVersionWhenCreatingThenCreateRequestedObject) { std::unique_ptr wddm(Wddm::createWddm(std::unique_ptr(hwDeviceIds[0].release()->as()), rootDeviceEnvironment)); EXPECT_NE(nullptr, wddm); } - -TEST(DefaultHeapSizeTest, whenGetDefaultHeapSizeThenReturnCorrectValue) { - EXPECT_EQ(4 * MemoryConstants::megaByte, NEO::HeapSize::getDefaultHeapSize(IndirectHeapType::indirectObject)); - EXPECT_EQ(MemoryConstants::pageSize64k, NEO::HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState)); - EXPECT_EQ(MemoryConstants::pageSize64k, NEO::HeapSize::getDefaultHeapSize(IndirectHeapType::dynamicState)); -} diff --git a/shared/source/command_container/cmdcontainer.cpp b/shared/source/command_container/cmdcontainer.cpp index 7af5d9c434..06aeba9fbb 100644 --- a/shared/source/command_container/cmdcontainer.cpp +++ b/shared/source/command_container/cmdcontainer.cpp @@ -597,11 +597,11 @@ bool CommandContainer::skipHeapAllocationCreation(HeapType heapType) { } size_t CommandContainer::getHeapSize(HeapType heapType) { - size_t defaultHeapSize = HeapSize::getDefaultHeapSize(heapType); + size_t defaultHeapSize = HeapSize::defaultHeapSize; if (HeapType::surfaceState == heapType) { defaultHeapSize = this->defaultSshSize; } - return HeapSize::getHeapSize(defaultHeapSize); + return HeapSize::getDefaultHeapSize(defaultHeapSize); } void *CommandContainer::findCpuBaseForCmdBufferAddress(void *cmdBufferAddress) { diff --git a/shared/source/command_stream/command_stream_receiver.cpp b/shared/source/command_stream/command_stream_receiver.cpp index 867c53e7dd..d7f7eb68a1 100644 --- a/shared/source/command_stream/command_stream_receiver.cpp +++ b/shared/source/command_stream/command_stream_receiver.cpp @@ -757,7 +757,7 @@ IndirectHeap &CommandStreamReceiver::getIndirectHeap(IndirectHeap::Type heapType void CommandStreamReceiver::allocateHeapMemory(IndirectHeap::Type heapType, size_t minRequiredSize, IndirectHeap *&indirectHeap) { size_t reservedSize = 0; - auto finalHeapSize = HeapSize::getHeapSize(HeapSize::getDefaultHeapSize(heapType)); + auto finalHeapSize = HeapSize::getDefaultHeapSize(HeapSize::defaultHeapSize); if (IndirectHeap::Type::surfaceState == heapType) { finalHeapSize = defaultSshSize; } diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index acdc4d1d38..14428446af 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -76,7 +76,7 @@ CommandStreamReceiverHw::CommandStreamReceiverHw(ExecutionEnvironment if (debugManager.flags.FlattenBatchBufferForAUBDump.get() || debugManager.flags.AddPatchInfoCommentsForAUBDump.get()) { flatBatchBufferHelper.reset(new FlatBatchBufferHelperHw(executionEnvironment)); } - defaultSshSize = HeapSize::getHeapSize(EncodeStates::getSshHeapSize()); + defaultSshSize = HeapSize::getDefaultHeapSize(EncodeStates::getSshHeapSize()); this->use4GbHeaps = are4GbHeapsAvailable(); timestampPacketWriteEnabled = gfxCoreHelper.timestampPacketWriteSupported(); diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index f1f1ecb69b..4accddd491 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -647,7 +647,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, ForceLocalMemoryAccessMode, -1, "-1: don't overr DECLARE_DEBUG_VARIABLE(int32_t, ForceUserptrAlignment, -1, "-1: no force (4kb), >0: n kb alignment") DECLARE_DEBUG_VARIABLE(int32_t, ForceCommandBufferAlignment, -1, "-1: no force (64kb), >0: n kb alignment") DECLARE_DEBUG_VARIABLE(int32_t, ForceIOHAlignment, -1, "-1: no force, >0: n byte alignment") -DECLARE_DEBUG_VARIABLE(int32_t, ForceDefaultHeapSize, -1, "-1: no force (4MB for IOH, 64kb for DSH and SSH), >0: n kb size") +DECLARE_DEBUG_VARIABLE(int32_t, ForceDefaultHeapSize, -1, "-1: no force (64kb), >0: n kb size") DECLARE_DEBUG_VARIABLE(int32_t, PreferCopyEngineForCopyBufferToBuffer, -1, "-1: default, 0: prefer EUs, 1: prefer blitter") DECLARE_DEBUG_VARIABLE(int64_t, ForceSystemMemoryPlacement, 0, "0: default, >0: (bitmask) for given Graphics Allocation Type, force system memory placement") DECLARE_DEBUG_VARIABLE(int64_t, ForceNonSystemMemoryPlacement, 0, "0: default, >0: (bitmask) for given Graphics Allocation Type, force non-system memory placement") diff --git a/shared/source/dll/CMakeLists.txt b/shared/source/dll/CMakeLists.txt index 90aa837605..23124ce296 100644 --- a/shared/source/dll/CMakeLists.txt +++ b/shared/source/dll/CMakeLists.txt @@ -20,7 +20,6 @@ set(NEO_SHARED_DLLS ${CMAKE_CURRENT_SOURCE_DIR}/options_dll.cpp ${CMAKE_CURRENT_SOURCE_DIR}/get_staging_buffer_size.cpp ${CMAKE_CURRENT_SOURCE_DIR}/usm_pool_size.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/default_heap_size.cpp ) add_library(neo_shared_dlls_precompiled_objects OBJECT ${NEO_SHARED_DLLS}) diff --git a/shared/source/dll/default_heap_size.cpp b/shared/source/dll/default_heap_size.cpp deleted file mode 100644 index 66c1d907ff..0000000000 --- a/shared/source/dll/default_heap_size.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2025 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/helpers/constants.h" -#include "shared/source/indirect_heap/heap_size.h" - -namespace NEO { -namespace HeapSize { - -size_t getDefaultHeapSize(IndirectHeapType heapType) { - if (heapType == IndirectHeapType::indirectObject) { - return 4 * MemoryConstants::megaByte; - } - return MemoryConstants::pageSize64k; -} - -} // namespace HeapSize -} // namespace NEO diff --git a/shared/source/helpers/gfx_core_helper.h b/shared/source/helpers/gfx_core_helper.h index ed83203aa2..9e82f351ce 100644 --- a/shared/source/helpers/gfx_core_helper.h +++ b/shared/source/helpers/gfx_core_helper.h @@ -206,7 +206,7 @@ class GfxCoreHelper { uint32_t &requiredWalkOrder, uint32_t simd) const = 0; virtual uint32_t getMaxPtssIndex(const ProductHelper &productHelper) const = 0; - virtual size_t getDefaultSshSize(const ProductHelper &productHelper) const = 0; + virtual uint32_t getDefaultSshSize(const ProductHelper &productHelper) const = 0; virtual bool usmCompressionSupported(const NEO::HardwareInfo &hwInfo) const = 0; @@ -478,7 +478,7 @@ class GfxCoreHelperHw : public GfxCoreHelper { uint32_t &requiredWalkOrder, uint32_t simd) const override; uint32_t getMaxPtssIndex(const ProductHelper &productHelper) const override; - size_t getDefaultSshSize(const ProductHelper &productHelper) const override; + uint32_t getDefaultSshSize(const ProductHelper &productHelper) const override; bool usmCompressionSupported(const NEO::HardwareInfo &hwInfo) const override; diff --git a/shared/source/helpers/gfx_core_helper_base.inl b/shared/source/helpers/gfx_core_helper_base.inl index b5aae62737..98751c9914 100644 --- a/shared/source/helpers/gfx_core_helper_base.inl +++ b/shared/source/helpers/gfx_core_helper_base.inl @@ -856,8 +856,8 @@ uint32_t GfxCoreHelperHw::getMaxPtssIndex(const ProductHelper &produc } template -size_t GfxCoreHelperHw::getDefaultSshSize(const ProductHelper &productHelper) const { - return HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState); +uint32_t GfxCoreHelperHw::getDefaultSshSize(const ProductHelper &productHelper) const { + return HeapSize::defaultHeapSize; } template diff --git a/shared/source/indirect_heap/heap_size.cpp b/shared/source/indirect_heap/heap_size.cpp index 38c8f8e016..31c81e74e9 100644 --- a/shared/source/indirect_heap/heap_size.cpp +++ b/shared/source/indirect_heap/heap_size.cpp @@ -12,7 +12,7 @@ namespace NEO { namespace HeapSize { -size_t getHeapSize(size_t defaultValue) { +size_t getDefaultHeapSize(size_t defaultValue) { auto defaultSize = defaultValue; if (debugManager.flags.ForceDefaultHeapSize.get() != -1) { defaultSize = debugManager.flags.ForceDefaultHeapSize.get() * MemoryConstants::kiloByte; diff --git a/shared/source/indirect_heap/heap_size.h b/shared/source/indirect_heap/heap_size.h index 025c78e6da..220bd64e75 100644 --- a/shared/source/indirect_heap/heap_size.h +++ b/shared/source/indirect_heap/heap_size.h @@ -6,16 +6,14 @@ */ #pragma once - -#include "shared/source/indirect_heap/indirect_heap_type.h" - -#include +#include "shared/source/helpers/constants.h" namespace NEO { namespace HeapSize { -size_t getDefaultHeapSize(IndirectHeapType heapType); -size_t getHeapSize(size_t defaultValue); +inline constexpr size_t defaultHeapSize = 64 * MemoryConstants::kiloByte; + +size_t getDefaultHeapSize(size_t defaultValue); } // namespace HeapSize } // namespace NEO diff --git a/shared/test/common/libult/CMakeLists.txt b/shared/test/common/libult/CMakeLists.txt index 29b6f79df6..273ae81c43 100644 --- a/shared/test/common/libult/CMakeLists.txt +++ b/shared/test/common/libult/CMakeLists.txt @@ -212,7 +212,6 @@ set(neo_libult_SRCS_LINUX ${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 - ${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_default_heap_size.cpp ) set_property(GLOBAL APPEND PROPERTY neo_libult_SRCS_LINUX ${neo_libult_SRCS_LINUX}) @@ -230,7 +229,6 @@ set(neo_libult_SRCS_WINDOWS ${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_SHARED_TEST_DIRECTORY}/common/mocks/mock_default_heap_size.cpp ) set_property(GLOBAL APPEND PROPERTY neo_libult_SRCS_WINDOWS ${neo_libult_SRCS_WINDOWS}) diff --git a/shared/test/common/mocks/mock_default_heap_size.cpp b/shared/test/common/mocks/mock_default_heap_size.cpp deleted file mode 100644 index 992b4db64c..0000000000 --- a/shared/test/common/mocks/mock_default_heap_size.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (C) 2025 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/helpers/constants.h" -#include "shared/source/indirect_heap/heap_size.h" - -namespace NEO { -namespace HeapSize { - -size_t getDefaultHeapSize(IndirectHeapType heapType) { - return MemoryConstants::pageSize64k; -} -} // namespace HeapSize -} // namespace NEO diff --git a/shared/test/unit_test/command_container/command_container_tests.cpp b/shared/test/unit_test/command_container/command_container_tests.cpp index 4ae0baf4cc..eac6a0dbcc 100644 --- a/shared/test/unit_test/command_container/command_container_tests.cpp +++ b/shared/test/unit_test/command_container/command_container_tests.cpp @@ -100,7 +100,7 @@ TEST_F(CommandContainerHeapStateTests, givenDirtyHeapsWhenSettingStateForSingleH TEST_F(CommandContainerTest, givenCmdContainerWhenCreatingCommandBufferThenCorrectAllocationTypeIsSet) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); ASSERT_NE(0u, cmdContainer.getCmdBufferAllocations().size()); EXPECT_EQ(AllocationType::commandBuffer, cmdContainer.getCmdBufferAllocations()[0]->getAllocationType()); @@ -113,7 +113,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenCreatingCommandBufferThenCorre TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenInitializeThenCreateAdditionalLinearStream) { MyMockCommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, true); EXPECT_NE(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), nullptr); @@ -128,7 +128,7 @@ TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenInitializ TEST_F(CommandContainerTest, whenInitializeThenNotCreateAdditionalLinearStream) { MyMockCommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), nullptr); @@ -141,7 +141,7 @@ TEST_F(CommandContainerTest, whenInitializeThenNotCreateAdditionalLinearStream) TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectAllocationTypes) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); for (uint32_t i = 0; i < HeapType::numTypes; i++) { HeapType heapType = static_cast(i); @@ -162,7 +162,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectA TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIsInitialized) { CommandContainer cmdContainer; - auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(CommandContainer::ErrorCode::success, status); EXPECT_EQ(pDevice, cmdContainer.getDevice()); @@ -193,7 +193,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIs TEST_F(CommandContainerTest, givenCommandContainerWhenHeapNotRequiredThenHeapIsNotInitialized) { CommandContainer cmdContainer; - auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false); EXPECT_EQ(CommandContainer::ErrorCode::success, status); EXPECT_EQ(pDevice, cmdContainer.getDevice()); @@ -230,7 +230,7 @@ TEST_F(CommandContainerTest, givenEnabledLocalMemoryAndIsaInSystemMemoryWhenCmdC auto instructionHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(0, false); CommandContainer cmdContainer; - auto status = cmdContainer.initialize(device.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto status = cmdContainer.initialize(device.get(), nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(CommandContainer::ErrorCode::success, status); EXPECT_EQ(instructionHeapBaseAddress, cmdContainer.getInstructionHeapBaseAddress()); @@ -249,7 +249,7 @@ TEST_F(CommandContainerTest, givenForceDefaultHeapSizeWhenCmdContainerIsInitiali auto device = std::unique_ptr(Device::create(executionEnvironment, 0u)); CommandContainer cmdContainer; - auto status = cmdContainer.initialize(device.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto status = cmdContainer.initialize(device.get(), nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(CommandContainer::ErrorCode::success, status); auto indirectHeap = cmdContainer.getIndirectHeap(IndirectHeap::Type::indirectObject); @@ -259,21 +259,21 @@ TEST_F(CommandContainerTest, givenForceDefaultHeapSizeWhenCmdContainerIsInitiali TEST_F(CommandContainerTest, givenCommandContainerDuringInitWhenAllocateGfxMemoryFailsThenErrorIsReturned) { CommandContainer cmdContainer; pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(0, *pDevice->executionEnvironment)); - auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status); } TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenAllocateSecondaryCmdStreamFailsDuringInitializeThenErrorIsReturned) { CommandContainer cmdContainer; static_cast(pDevice->getMemoryManager())->maxSuccessAllocatedGraphicsMemoryIndex = 7; - auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true); + auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, true); EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status); } TEST_F(CommandContainerTest, givenCmdContainerWithAllocsListWhenAllocateAndResetThenCmdBufferAllocIsReused) { AllocationsList allocList; auto cmdContainer = std::make_unique(); - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false); auto &cmdBufferAllocs = cmdContainer->getCmdBufferAllocations(); auto memoryManager = static_cast(pDevice->getMemoryManager()); EXPECT_EQ(memoryManager->handleFenceCompletionCalled, 0u); @@ -310,7 +310,7 @@ TEST_F(CommandContainerTest, givenReusableAllocationsAndRemoveUserFenceInCmdlist AllocationsList allocList; auto cmdContainer = std::make_unique(); - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false); auto &cmdBufferAllocs = cmdContainer->getCmdBufferAllocations(); auto memoryManager = static_cast(pDevice->getMemoryManager()); EXPECT_EQ(0u, memoryManager->handleFenceCompletionCalled); @@ -336,7 +336,7 @@ TEST_F(CommandContainerTest, givenReusableAllocationsAndRemoveUserFenceInCmdlist AllocationsList allocList; auto cmdContainer = std::make_unique(); - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false); auto &cmdBufferAllocs = cmdContainer->getCmdBufferAllocations(); auto memoryManager = static_cast(pDevice->getMemoryManager()); EXPECT_EQ(0u, memoryManager->handleFenceCompletionCalled); @@ -360,7 +360,7 @@ TEST_F(CommandContainerTest, givenCommandContainerDuringInitWhenAllocateHeapMemo CommandContainer cmdContainer; auto tempMemoryManager = pDevice->executionEnvironment->memoryManager.release(); pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(1, *pDevice->executionEnvironment)); - auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status); delete tempMemoryManager; } @@ -375,10 +375,10 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenSettingIndirectHeapAllocat TEST_F(CommandContainerTest, givenHeapAllocationsWhenDestroyCommandContainerThenHeapAllocationsAreReused) { std::unique_ptr cmdContainer(new CommandContainer); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto heapAllocationsAddress = cmdContainer->getIndirectHeapAllocation(HeapType::surfaceState)->getUnderlyingBuffer(); cmdContainer.reset(new CommandContainer); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); bool status = true; for (uint32_t i = 0; i < HeapType::numTypes && !status; i++) { auto heapType = static_cast(i); @@ -393,7 +393,7 @@ TEST_F(CommandContainerTest, givenHeapAllocationsWhenDestroyCommandContainerThen TEST_F(CommandContainerTest, givenCommandContainerWhenResetThenStateIsReset) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); LinearStream stream; uint32_t usedSize = 1; cmdContainer.getCommandStream()->getSpace(usedSize); @@ -407,7 +407,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenResetThenStateIsReset) { TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddNullPtrToResidencyContainerThenNothingIsAdded) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto size = cmdContainer.getResidencyContainer().size(); cmdContainer.addToResidencyContainer(nullptr); EXPECT_EQ(cmdContainer.getResidencyContainer().size(), size); @@ -416,14 +416,14 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddNullPtrToResidenc TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenCmdBuffersAreAddedToResidencyContainer) { CommandContainer cmdContainer; EXPECT_EQ(cmdContainer.getResidencyContainer().size(), 0u); - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, true); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, true); EXPECT_EQ(cmdContainer.getResidencyContainer().size(), 2u); EXPECT_EQ(cmdContainer.getResidencyContainer().size(), cmdContainer.getCmdBufferAllocations().size()); } TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddAlreadyAddedAllocationAndDuplicatesRemovedThenExpectedSizeIsReturned) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); MockGraphicsAllocation mockAllocation; auto sizeBefore = cmdContainer.getResidencyContainer().size(); @@ -447,7 +447,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddAlreadyAddedAlloc HWTEST_F(CommandContainerTest, givenCmdContainerWhenInitializeCalledThenSSHHeapHasBindlessOffsetReserved) { std::unique_ptr cmdContainer(new CommandContainer); cmdContainer->setReservedSshSize(4 * MemoryConstants::pageSize); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->setDirtyStateForAllHeaps(false); auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState); @@ -460,7 +460,7 @@ HWTEST_F(CommandContainerTest, givenNotEnoughSpaceInSSHWhenGettingHeapWithRequir using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; std::unique_ptr cmdContainer(new CommandContainer); cmdContainer->setReservedSshSize(4 * MemoryConstants::pageSize); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->setDirtyStateForAllHeaps(false); auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState); @@ -475,7 +475,7 @@ HWTEST_F(CommandContainerTest, givenNotEnoughSpaceInSSHWhenGettingHeapWithRequir TEST_F(CommandContainerTest, givenAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenExistingAllocationIsReturned) { std::unique_ptr cmdContainer(new CommandContainer); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->setDirtyStateForAllHeaps(false); HeapType heapTypes[] = {HeapType::surfaceState, HeapType::dynamicState}; @@ -510,7 +510,7 @@ TEST_F(CommandContainerTest, givenAvailableSpaceWhenGetHeapWithRequiredSizeAndAl TEST_F(CommandContainerTest, givenUnalignedAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenHeapReturnedIsCorrectlyAligned) { std::unique_ptr cmdContainer(new CommandContainer); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->setDirtyStateForAllHeaps(false); auto heapAllocation = cmdContainer->getIndirectHeapAllocation(HeapType::surfaceState); auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState); @@ -534,7 +534,7 @@ TEST_F(CommandContainerTest, givenUnalignedAvailableSpaceWhenGetHeapWithRequired TEST_F(CommandContainerTest, givenNoAlignmentAndAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenHeapReturnedIsNotAligned) { std::unique_ptr cmdContainer(new CommandContainer); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->setDirtyStateForAllHeaps(false); auto heapAllocation = cmdContainer->getIndirectHeapAllocation(HeapType::surfaceState); auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState); @@ -558,7 +558,7 @@ TEST_F(CommandContainerTest, givenNoAlignmentAndAvailableSpaceWhenGetHeapWithReq TEST_F(CommandContainerTest, givenNotEnoughSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenNewAllocationIsReturned) { std::unique_ptr cmdContainer(new CommandContainer); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->setDirtyStateForAllHeaps(false); HeapType heapTypes[] = {HeapType::surfaceState, HeapType::dynamicState}; @@ -596,7 +596,7 @@ TEST_F(CommandContainerTest, givenNotEnoughSpaceWhenGetHeapWithRequiredSizeAndAl TEST_F(CommandContainerTest, givenNotEnoughSpaceWhenCreatedAllocationHaveDifferentBaseThenHeapIsDirty) { std::unique_ptr cmdContainer(new CommandContainer); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->setDirtyStateForAllHeaps(false); HeapType type = HeapType::indirectObject; @@ -628,7 +628,7 @@ TEST_F(CommandContainerTest, givenNotEnoughSpaceWhenCreatedAllocationHaveDiffere TEST_F(CommandContainerTest, whenAllocateNextCmdBufferIsCalledThenNewAllocationIsCreatedAndCommandStreamReplaced) { std::unique_ptr cmdContainer(new CommandContainer); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto stream = cmdContainer->getCommandStream(); ASSERT_NE(nullptr, stream); @@ -656,7 +656,7 @@ TEST_F(CommandContainerTest, whenAllocateNextCmdBufferIsCalledThenNewAllocationI TEST_F(CommandContainerTest, whenResettingCommandContainerThenStoredCmdBuffersAreFreedAndStreamIsReplacedWithInitialBuffer) { std::unique_ptr cmdContainer(new CommandContainer); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->allocateNextCommandBuffer(); cmdContainer->allocateNextCommandBuffer(); @@ -702,7 +702,7 @@ TEST_P(CommandContainerHeaps, givenCommandContainerWhenGetAllowHeapGrowCalledThe CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::dynamicState == heapType) { EXPECT_EQ(cmdContainer.getIndirectHeap(heapType), nullptr); } else { @@ -720,7 +720,7 @@ TEST_P(CommandContainerHeaps, givenCommandContainerWhenGetingMoreThanAvailableSi HeapType heapType = GetParam(); CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer.setDirtyStateForAllHeaps(false); auto heap = cmdContainer.getIndirectHeap(heapType); if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::dynamicState == heapType) { @@ -755,10 +755,10 @@ TEST_P(CommandContainerHeaps, givenCommandContainerForDifferentRootDevicesThenHe auto device1 = std::unique_ptr(Device::create(executionEnvironment, 1u)); CommandContainer cmdContainer0; - cmdContainer0.initialize(device0.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer0.initialize(device0.get(), nullptr, HeapSize::defaultHeapSize, true, false); CommandContainer cmdContainer1; - cmdContainer1.initialize(device1.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer1.initialize(device1.get(), nullptr, HeapSize::defaultHeapSize, true, false); if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::dynamicState == heapType) { EXPECT_EQ(cmdContainer0.getIndirectHeap(heapType), nullptr); EXPECT_EQ(cmdContainer1.getIndirectHeap(heapType), nullptr); @@ -785,13 +785,13 @@ TEST_F(CommandContainerHeaps, givenCommandContainerForDifferentRootDevicesThenCm auto device1 = std::unique_ptr(Device::create(executionEnvironment, 1u)); CommandContainer cmdContainer0; - cmdContainer0.initialize(device0.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer0.initialize(device0.get(), nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(1u, cmdContainer0.getCmdBufferAllocations().size()); uint32_t cmdBufferAllocationIndex0 = cmdContainer0.getCmdBufferAllocations().front()->getRootDeviceIndex(); EXPECT_EQ(device0->getRootDeviceIndex(), cmdBufferAllocationIndex0); CommandContainer cmdContainer1; - cmdContainer1.initialize(device1.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer1.initialize(device1.get(), nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(1u, cmdContainer1.getCmdBufferAllocations().size()); uint32_t cmdBufferAllocationIndex1 = cmdContainer1.getCmdBufferAllocations().front()->getRootDeviceIndex(); EXPECT_EQ(device1->getRootDeviceIndex(), cmdBufferAllocationIndex1); @@ -813,13 +813,13 @@ TEST_F(CommandContainerHeaps, givenCommandContainerForDifferentRootDevicesThenIn auto &gfxCoreHelper1 = device1->getGfxCoreHelper(); CommandContainer cmdContainer0; - cmdContainer0.initialize(device0.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer0.initialize(device0.get(), nullptr, HeapSize::defaultHeapSize, true, false); bool useLocalMemory0 = !gfxCoreHelper0.useSystemMemoryPlacementForISA(device0->getHardwareInfo()); uint64_t baseAddressHeapDevice0 = device0->getMemoryManager()->getInternalHeapBaseAddress(device0->getRootDeviceIndex(), useLocalMemory0); EXPECT_EQ(cmdContainer0.getInstructionHeapBaseAddress(), baseAddressHeapDevice0); CommandContainer cmdContainer1; - cmdContainer1.initialize(device1.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer1.initialize(device1.get(), nullptr, HeapSize::defaultHeapSize, true, false); bool useLocalMemory1 = !gfxCoreHelper1.useSystemMemoryPlacementForISA(device0->getHardwareInfo()); uint64_t baseAddressHeapDevice1 = device1->getMemoryManager()->getInternalHeapBaseAddress(device1->getRootDeviceIndex(), useLocalMemory1); EXPECT_EQ(cmdContainer1.getInstructionHeapBaseAddress(), baseAddressHeapDevice1); @@ -830,7 +830,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenDestructionThenNonHeapAllo MockGraphicsAllocation alloc; size_t size = 0x1000; alloc.setSize(size); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->getDeallocationContainer().push_back(&alloc); cmdContainer.reset(); EXPECT_EQ(alloc.getUnderlyingBufferSize(), size); @@ -838,7 +838,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenDestructionThenNonHeapAllo TEST_F(CommandContainerTest, givenContainerAllocatesNextCommandBufferWhenResettingContainerThenExpectFirstCommandBufferAllocationIsReused) { auto cmdContainer = std::make_unique(); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto stream = cmdContainer->getCommandStream(); ASSERT_NE(nullptr, stream); @@ -883,14 +883,14 @@ class MyLinearStreamMock : public LinearStream { TEST_F(CommandContainerTest, givenCmdContainerWhenContainerIsInitializedThenStreamContainsContainerPtr) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(reinterpret_cast(cmdContainer.getCommandStream())->cmdContainer, &cmdContainer); } TEST_F(CommandContainerTest, givenCmdContainerWhenContainerIsInitializedThenStreamSizeEqualAlignedTotalCmdBuffSizeDecreasedOfReservedSize) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); size_t alignedSize = alignUp(CommandContainer::totalCmdBufferSize, MemoryConstants::pageSize64k); EXPECT_EQ(cmdContainer.getCommandStream()->getMaxAvailableSpace(), alignedSize - CommandContainer::cmdBufferReservedSize); } @@ -900,21 +900,21 @@ TEST_F(CommandContainerTest, GivenCmdContainerAndDebugFlagWhenContainerIsInitial debugManager.flags.OverrideCmdListCmdBufferSizeInKb.set(0); MyMockCommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); size_t alignedSize = alignUp(cmdContainer.getAlignedCmdBufferSize(), MemoryConstants::pageSize64k); EXPECT_EQ(cmdContainer.getCommandStream()->getMaxAvailableSpace(), alignedSize - MyMockCommandContainer::cmdBufferReservedSize); auto newSizeInKB = 512; debugManager.flags.OverrideCmdListCmdBufferSizeInKb.set(newSizeInKB); MyMockCommandContainer cmdContainer2; - cmdContainer2.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer2.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); alignedSize = alignUp(cmdContainer.getAlignedCmdBufferSize(), MemoryConstants::pageSize64k); EXPECT_EQ(cmdContainer2.getCommandStream()->getMaxAvailableSpace(), alignedSize - MyMockCommandContainer::cmdBufferReservedSize); } TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingNextCmdBufferThenStreamSizeEqualAlignedTotalCmdBuffSizeDecreasedOfReservedSize) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer.allocateNextCommandBuffer(); size_t alignedSize = alignUp(CommandContainer::totalCmdBufferSize, MemoryConstants::pageSize64k); EXPECT_EQ(cmdContainer.getCommandStream()->getMaxAvailableSpace(), alignedSize - CommandContainer::cmdBufferReservedSize); @@ -922,7 +922,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingNextCmdBufferThenStr TEST_F(CommandContainerTest, givenCmdContainerWhenCloseAndAllocateNextCommandBufferCalledThenBBEndPlacedAtEndOfLinearStream) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); auto ptr = cmdContainer.getCommandStream()->getSpace(0u); cmdContainer.closeAndAllocateNextCommandBuffer(); @@ -931,7 +931,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenCloseAndAllocateNextCommandBuf TEST_F(CommandContainerTest, givenCmdContainerWhenCloseAndAllocateNextCommandBufferCalledThenNewCmdBufferAllocationCreated) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u); cmdContainer.closeAndAllocateNextCommandBuffer(); EXPECT_EQ(cmdContainer.getCmdBufferAllocations().size(), 2u); @@ -939,7 +939,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenCloseAndAllocateNextCommandBuf TEST_F(CommandContainerTest, givenCmdContainerWhenSetCmdBufferThenCmdBufferSetCorrectly) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); AllocationProperties properties{pDevice->getRootDeviceIndex(), true /* allocateMemory*/, @@ -958,7 +958,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenSetCmdBufferThenCmdBufferSetCo TEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithoutAnyAllocationInListThenReturnNullptr) { auto cmdContainer = std::make_unique(); AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false); auto csr = pDevice->getDefaultEngine().commandStreamReceiver; cmdContainer->setImmediateCmdListCsr(csr); cmdContainer->immediateReusableAllocationList = std::make_unique(); @@ -975,7 +975,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithAl *csr.tagAddress = 0u; AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false); cmdContainer->setImmediateCmdListCsr(&csr); cmdContainer->immediateReusableAllocationList = std::make_unique(); @@ -996,7 +996,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithAl *csr.tagAddress = 10u; AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false); cmdContainer->setImmediateCmdListCsr(&csr); cmdContainer->immediateReusableAllocationList = std::make_unique(); @@ -1013,7 +1013,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithAl HWTEST_F(CommandContainerTest, GivenCmdContainerWhenContainerIsInitializedThenSurfaceStateIndirectHeapSizeIsCorrect) { MyMockCommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto size = cmdContainer.allocationIndirectHeaps[IndirectHeap::Type::surfaceState]->getUnderlyingBufferSize(); constexpr size_t expectedHeapSize = MemoryConstants::pageSize64k; EXPECT_EQ(expectedHeapSize, size); @@ -1050,7 +1050,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerHasImmediateCsrWhenGettingHeapWi cmdContainer.immediateReusableAllocationList = std::make_unique(); cmdContainer.setNumIddPerBlock(1); - auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(CommandContainer::ErrorCode::success, code); EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(HeapType::dynamicState)); @@ -1226,7 +1226,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerUsedInRegularCmdListWhenGettingH HeapReserveArguments sshReserveArgs = {sshHeapPtr, 0, sshAlign}; HeapReserveArguments dshReserveArgs = {dshHeapPtr, 0, dshAlign}; - auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(CommandContainer::ErrorCode::success, code); cmdContainer.reserveSpaceForDispatch(sshReserveArgs, dshReserveArgs, true); @@ -1274,7 +1274,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerUsingPrivateHeapsWhenGettingRese HeapReserveArguments sshReserveArgs = {sshHeapPtr, 0, sshAlign}; HeapReserveArguments dshReserveArgs = {dshHeapPtr, 0, dshAlign}; - auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(CommandContainer::ErrorCode::success, code); constexpr size_t nonZeroSshSize = 4 * MemoryConstants::kiloByte; @@ -1317,7 +1317,7 @@ HWTEST_F(CommandContainerTest, cmdContainer.setNumIddPerBlock(1); - auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(CommandContainer::ErrorCode::success, code); constexpr size_t misalignedSize = 11; @@ -1427,7 +1427,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsThe auto csr = pDevice->getDefaultEngine().commandStreamReceiver; AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false); cmdContainer->setImmediateCmdListCsr(csr); auto heapHelper = reinterpret_cast(cmdContainer->getHeapHelper()); @@ -1462,7 +1462,7 @@ TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenFillReusa auto csr = pDevice->getDefaultEngine().commandStreamReceiver; AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, true); cmdContainer->setImmediateCmdListCsr(csr); auto actualResidencyContainerSize = cmdContainer->getResidencyContainer().size(); @@ -1491,7 +1491,7 @@ TEST_F(CommandContainerTest, givenSecondCmdContainerCreatedAfterFirstCmdContaine auto cmdContainer = std::make_unique(); AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, true); EXPECT_EQ(1u, cmdContainer->allocateCommandBufferCalled[0]); // forceHostMemory = 0 EXPECT_EQ(1u, cmdContainer->allocateCommandBufferCalled[1]); // forceHostMemory = 1 @@ -1501,7 +1501,7 @@ TEST_F(CommandContainerTest, givenSecondCmdContainerCreatedAfterFirstCmdContaine EXPECT_FALSE(allocList.peekIsEmpty()); cmdContainer = std::make_unique(); - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, true); EXPECT_EQ(0u, cmdContainer->allocateCommandBufferCalled[0]); // forceHostMemory = 0 EXPECT_EQ(0u, cmdContainer->allocateCommandBufferCalled[1]); // forceHostMemory = 1 @@ -1512,7 +1512,7 @@ TEST_F(CommandContainerTest, givenSecondCmdContainerCreatedAfterFirstCmdContaine TEST_F(CommandContainerTest, givenAllocateCommandBufferInHostMemoryCalledThenForceSystemMemoryFlagSetInAllocationStorageInfo) { auto cmdContainer = std::make_unique(); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, true); auto commandBufferAllocation = cmdContainer->allocateCommandBuffer(true /*forceHostMemory*/); EXPECT_TRUE(commandBufferAllocation->storageInfo.systemMemoryForced); @@ -1528,7 +1528,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsWit AllocationsList allocList; cmdContainer->enableHeapSharing(); - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false); cmdContainer->setImmediateCmdListCsr(csr); auto &reusableHeapsList = reinterpret_cast(cmdContainer->getHeapHelper())->storageForReuse->getAllocationsForReuse(); @@ -1555,7 +1555,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsWit auto cmdContainer = std::make_unique(); AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false); cmdContainer->setImmediateCmdListCsr(csr); auto &reusableHeapsList = reinterpret_cast(cmdContainer->getHeapHelper())->storageForReuse->getAllocationsForReuse(); @@ -1576,7 +1576,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsWit debugManager.flags.SetAmountOfReusableAllocations.set(1); auto cmdContainer = std::make_unique(); AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false); EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr); cmdContainer->fillReusableAllocationLists(); @@ -1591,7 +1591,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsAnd debugManager.flags.SetAmountOfReusableAllocations.set(1); auto cmdContainer = std::make_unique(); AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false); EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr); EXPECT_TRUE(allocList.peekIsEmpty()); @@ -1612,7 +1612,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWithoutGlobalListWhenFillReusableA DebugManagerStateRestore dbgRestore; debugManager.flags.SetAmountOfReusableAllocations.set(1); auto cmdContainer = std::make_unique(); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false); EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr); cmdContainer->fillReusableAllocationLists(); @@ -1630,7 +1630,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsWit auto cmdContainer = std::make_unique(); auto csr = pDevice->getDefaultEngine().commandStreamReceiver; AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false); cmdContainer->setImmediateCmdListCsr(csr); EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr); @@ -1647,7 +1647,7 @@ TEST_F(CommandContainerTest, givenCmdContainerAndCsrWhenGetHeapWithRequiredSizeA auto cmdContainer = std::make_unique(); auto csr = pDevice->getDefaultEngine().commandStreamReceiver; AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false); cmdContainer->setImmediateCmdListCsr(csr); cmdContainer->fillReusableAllocationLists(); @@ -1671,7 +1671,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsAnd auto cmdContainer = std::make_unique(); auto csr = pDevice->getDefaultEngine().commandStreamReceiver; AllocationsList allocList; - cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false); cmdContainer->setImmediateCmdListCsr(csr); cmdContainer->fillReusableAllocationLists(); @@ -1695,7 +1695,7 @@ TEST_F(CommandContainerHeapStateTests, givenCmdContainerWhenSettingHeapAddressMo TEST_F(CommandContainerTest, givenGlobalHeapModelSelectedWhenCmdContainerIsInitializedThenNoSurfaceAndDynamicHeapCreated) { MyMockCommandContainer cmdContainer; cmdContainer.setHeapAddressModel(HeapAddressModel::globalStateless); - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(NEO::HeapType::surfaceState)); EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(NEO::HeapType::dynamicState)); @@ -1703,7 +1703,7 @@ TEST_F(CommandContainerTest, givenGlobalHeapModelSelectedWhenCmdContainerIsIniti TEST_F(CommandContainerTest, givenCmdContainerAllocatesIndirectHeapWhenGettingMemoryPlacementThenFlagMatchesGraphicsAllocationPlacement) { auto cmdContainer = std::make_unique(); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(cmdContainer->isIndirectHeapInLocalMemory(), cmdContainer->getIndirectHeap(NEO::HeapType::indirectObject)->getGraphicsAllocation()->isAllocatedInLocalMemoryPool()); } @@ -1713,7 +1713,7 @@ TEST_F(CommandContainerTest, givenCmdContainerSetToSbaTrackingWhenStateHeapsCons auto cmdContainer = std::make_unique(); cmdContainer->setStateBaseAddressTracking(true); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); NEO::IndirectHeap *ioh = cmdContainer->getIndirectHeap(NEO::HeapType::indirectObject); ioh->getSpace(64); @@ -1739,7 +1739,7 @@ TEST_F(CommandContainerTest, givenCmdContainerSetToSbaTrackingWhenStateHeapsCons } TEST_F(CommandContainerTest, givenCmdContainerSetToSbaTrackingWhenContainerIsInitializedThenSurfaceHeapDefaultValueIsUsed) { - const size_t sshDefaultSize = 2 * HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState); + constexpr size_t sshDefaultSize = 2 * HeapSize::defaultHeapSize; auto &productHelper = pDevice->getProductHelper(); auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); auto expectedSshSize = gfxCoreHelper.getDefaultSshSize(productHelper); @@ -1751,7 +1751,7 @@ TEST_F(CommandContainerTest, givenCmdContainerSetToSbaTrackingWhenContainerIsIni cmdContainer = std::make_unique(); cmdContainer->setStateBaseAddressTracking(true); cmdContainer->initialize(pDevice, nullptr, sshDefaultSize, true, false); - EXPECT_EQ(2 * HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), cmdContainer->defaultSshSize); + EXPECT_EQ(2 * HeapSize::defaultHeapSize, cmdContainer->defaultSshSize); } HWTEST_F(CommandContainerTest, @@ -1761,7 +1761,7 @@ HWTEST_F(CommandContainerTest, CommandContainer cmdContainer; cmdContainer.setUsingPrimaryBuffer(true); EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer()); - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u); auto firstCmdBufferAllocation = cmdContainer.getCmdBufferAllocations()[0]; @@ -1796,7 +1796,7 @@ HWTEST_F(CommandContainerTest, CommandContainer cmdContainer; cmdContainer.setUsingPrimaryBuffer(true); EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer()); - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u); auto firstCmdBufferAllocation = cmdContainer.getCmdBufferAllocations()[0]; @@ -1851,7 +1851,7 @@ HWTEST_F(CommandContainerTest, CommandContainer cmdContainer; cmdContainer.setUsingPrimaryBuffer(true); EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer()); - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u); auto firstCmdBufferAllocation = cmdContainer.getCmdBufferAllocations()[0]; @@ -1886,7 +1886,7 @@ HWTEST_F(CommandContainerTest, CommandContainer cmdContainer; cmdContainer.setUsingPrimaryBuffer(true); EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer()); - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u); size_t consumedSize = 28; @@ -1927,7 +1927,7 @@ HWTEST_F(CommandContainerTest, TEST_F(CommandContainerTest, givenCmdContainerWhenImmediateCmdListCsrIsSetThenCommandStreamHasCmdContainerSetToNullptr) { CommandContainer cmdContainer; cmdContainer.setImmediateCmdListCsr(pDevice->getDefaultEngine().commandStreamReceiver); - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false); EXPECT_EQ(cmdContainer.getCommandStream()->getCmdContainer(), nullptr); } @@ -1935,7 +1935,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWithImmediateCsrWhenCreatingSecond MyMockCommandContainer cmdContainer; cmdContainer.setImmediateCmdListCsr(pDevice->getDefaultEngine().commandStreamReceiver); constexpr bool createSecondary = true; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, createSecondary); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, createSecondary); ASSERT_NE(nullptr, cmdContainer.secondaryCommandStreamForImmediateCmdList.get()); EXPECT_EQ(cmdContainer.secondaryCommandStreamForImmediateCmdList->getCmdContainer(), nullptr); } @@ -1943,7 +1943,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWithImmediateCsrWhenCreatingSecond TEST_F(CommandContainerTest, givenCmdContainerWhenOldHeapIsStoredAndResetContainerThenUseStorageForReuseForStoredHeap) { MyMockCommandContainer cmdContainer; - auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(CommandContainer::ErrorCode::success, status); auto &deallocationList = cmdContainer.getDeallocationContainer(); @@ -1994,7 +1994,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenOldHeapIsStoredAndResetContain TEST_F(CommandContainerTest, givenCmdContainerWhenNonHeapIsStoredAndResetContainerThenNonHeapAllocationIsNotStoredForReuse) { MyMockCommandContainer cmdContainer; - auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EXPECT_EQ(CommandContainer::ErrorCode::success, status); auto &deallocationList = cmdContainer.getDeallocationContainer(); EXPECT_EQ(0u, deallocationList.size()); @@ -2017,7 +2017,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenNonHeapIsStoredAndResetContain TEST_F(CommandContainerTest, givenHeaplessCmdContainerWhenResetContainerThenNoHeapInStorageForReuse) { MyMockCommandContainer cmdContainer; - auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false); EXPECT_EQ(CommandContainer::ErrorCode::success, status); auto &deallocationList = cmdContainer.getDeallocationContainer(); @@ -2030,7 +2030,7 @@ TEST_F(CommandContainerTest, givenHeaplessCmdContainerWhenResetContainerThenNoHe TEST_F(CommandContainerTest, givenInitializedContainerWhenSearchedAddressIsWithinCommandStreamThenReturnCommandStreamCpuBase) { MyMockCommandContainer cmdContainer; - auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false); EXPECT_EQ(CommandContainer::ErrorCode::success, status); void *cmdBuffer = ptrOffset(cmdContainer.getCommandStream()->getCpuBase(), 0x100); @@ -2041,7 +2041,7 @@ TEST_F(CommandContainerTest, givenInitializedContainerWhenSearchedAddressIsWithi TEST_F(CommandContainerTest, givenInitializedContainerWithTwoCommandBuffersWhenSearchedAddressIsWithinOldCommandBufferThenReturnOldCommandBufferCpuBase) { MyMockCommandContainer cmdContainer; - auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false); EXPECT_EQ(CommandContainer::ErrorCode::success, status); void *expectedCpuBase = cmdContainer.getCommandStream()->getCpuBase(); @@ -2056,7 +2056,7 @@ TEST_F(CommandContainerTest, givenInitializedContainerWithTwoCommandBuffersWhenS TEST_F(CommandContainerTest, givenInitializedContainerWhenSearchedAddressIsOutsideCommandStreamThenReturnNullptr) { MyMockCommandContainer cmdContainer; - auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false); + auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false); EXPECT_EQ(CommandContainer::ErrorCode::success, status); cmdContainer.allocateNextCommandBuffer(); diff --git a/shared/test/unit_test/command_stream/linear_stream_tests.cpp b/shared/test/unit_test/command_stream/linear_stream_tests.cpp index 7716cd992f..10f1d93e32 100644 --- a/shared/test/unit_test/command_stream/linear_stream_tests.cpp +++ b/shared/test/unit_test/command_stream/linear_stream_tests.cpp @@ -162,7 +162,7 @@ TEST_F(LinearStreamTest, givenLinearStreamWithoutCmdContainerWhenOneByteLeftInSt using CommandContainerLinearStreamTest = Test; TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenOneByteLeftInStreamThenGetSpaceThrowAbort) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto stream = reinterpret_cast(cmdContainer.getCommandStream()); stream->sizeUsed = stream->getMaxAvailableSpace() - 1; EXPECT_THROW(stream->getSpace(1), std::exception); @@ -170,7 +170,7 @@ TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenOn TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenNewCmdBufferAllocated) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); auto stream = reinterpret_cast(cmdContainer.getCommandStream()); size_t dummyCommandSize = 2; @@ -182,7 +182,7 @@ TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenTh TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenLinearStreamHasNewAllocation) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); auto stream = reinterpret_cast(cmdContainer.getCommandStream()); size_t dummyCommandSize = 2; @@ -195,7 +195,7 @@ TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenTh TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenGetSpaceReturnPtrFromNewAllocation) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); auto stream = reinterpret_cast(cmdContainer.getCommandStream()); size_t dummyCommandSize = 2; @@ -207,7 +207,7 @@ TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenTh TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsSpaceForCommandAndBBEndThenNewCmdBufferIsNotAllocated) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); auto stream = reinterpret_cast(cmdContainer.getCommandStream()); size_t dummyCommandSize = 2; @@ -219,7 +219,7 @@ TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenTh TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenBBEndAddedAtEndOfStream) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); auto stream = reinterpret_cast(cmdContainer.getCommandStream()); size_t dummyCommandSize = 2; diff --git a/shared/test/unit_test/debugger/test_l0_debugger.cpp b/shared/test/unit_test/debugger/test_l0_debugger.cpp index ea4015c85e..9b577a6fff 100644 --- a/shared/test/unit_test/debugger/test_l0_debugger.cpp +++ b/shared/test/unit_test/debugger/test_l0_debugger.cpp @@ -605,7 +605,7 @@ HWTEST2_P(L0DebuggerSimpleParameterizedTest, givenNotChangedSurfaceStateWhenCapt debugger->sbaTrackingGpuVa.address = 0x45670000; NEO::CommandContainer container; - container.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + container.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); NEO::Debugger::SbaAddresses sba = {}; sba.surfaceStateBaseAddress = 0x123456000; @@ -629,7 +629,7 @@ HWTEST2_P(L0DebuggerSimpleParameterizedTest, givenChangedBaseAddressesWhenCaptur debugger->sbaTrackingGpuVa.address = 0x45670000; { NEO::CommandContainer container; - container.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + container.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); NEO::Debugger::SbaAddresses sba = {}; sba.surfaceStateBaseAddress = 0x123456000; @@ -642,7 +642,7 @@ HWTEST2_P(L0DebuggerSimpleParameterizedTest, givenChangedBaseAddressesWhenCaptur { NEO::CommandContainer container; - container.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + container.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); NEO::Debugger::SbaAddresses sba = {}; sba.generalStateBaseAddress = 0x123456000; @@ -655,7 +655,7 @@ HWTEST2_P(L0DebuggerSimpleParameterizedTest, givenChangedBaseAddressesWhenCaptur { NEO::CommandContainer container; - container.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + container.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); NEO::Debugger::SbaAddresses sba = {}; sba.bindlessSurfaceStateBaseAddress = 0x123456000; diff --git a/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp b/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp index 189cbb161b..b093b099e2 100644 --- a/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp +++ b/shared/test/unit_test/encoders/command_encoder_tests_xehp_and_later.cpp @@ -155,7 +155,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterCommandEncoderTest, givenOffsetAndValue GenCmdList commands; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); constexpr uint32_t regOffset = 0x2000u; constexpr uint32_t immVal = 0xbaau; constexpr uint64_t dstAddress = 0xDEADCAF0u; diff --git a/shared/test/unit_test/encoders/test_encode_command_buffer.cpp b/shared/test/unit_test/encoders/test_encode_command_buffer.cpp index 1680bc1d0d..fd94d3c7d7 100644 --- a/shared/test/unit_test/encoders/test_encode_command_buffer.cpp +++ b/shared/test/unit_test/encoders/test_encode_command_buffer.cpp @@ -19,7 +19,7 @@ using EncodeBatchBufferStartOrEndTest = Test; HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBEndThenCommandIsAdded) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EncodeBatchBufferStartOrEnd::programBatchBufferEnd(cmdContainer); GenCmdList commands; @@ -32,7 +32,7 @@ HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBEndTh HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStartThenCommandIsAdded) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EncodeBatchBufferStartOrEnd::programBatchBufferStart(cmdContainer.getCommandStream(), 0, true, false, false); GenCmdList commands; @@ -45,7 +45,7 @@ HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStart HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStartWithSecondLevelParameterThenCommandIsProgrammedCorrectly) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EncodeBatchBufferStartOrEnd::programBatchBufferStart(cmdContainer.getCommandStream(), 0, true, false, false); GenCmdList commands; @@ -62,7 +62,7 @@ HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStart HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStartWithFirstLevelParameterThenCommandIsProgrammedCorrectly) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EncodeBatchBufferStartOrEnd::programBatchBufferStart(cmdContainer.getCommandStream(), 0, false, false, false); GenCmdList commands; @@ -79,7 +79,7 @@ HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStart HWTEST_F(EncodeBatchBufferStartOrEndTest, givenGpuAddressWhenEncodeBBStartThenAddressIsProgrammedCorrectly) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); uint64_t gpuAddress = 12 * MemoryConstants::pageSize; EncodeBatchBufferStartOrEnd::programBatchBufferStart(cmdContainer.getCommandStream(), gpuAddress, false, false, false); @@ -100,7 +100,7 @@ using EncodeNoopTest = Test; HWTEST_F(EncodeNoopTest, WhenAligningLinearStreamToCacheLineSizeThenItIsAlignedCorrectly) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto commandStream = cmdContainer.getCommandStream(); EncodeNoop::alignToCacheLine(*commandStream); @@ -113,7 +113,7 @@ HWTEST_F(EncodeNoopTest, WhenAligningLinearStreamToCacheLineSizeThenItIsAlignedC HWTEST_F(EncodeNoopTest, WhenEmittingNoopsThenExpectCorrectNumberOfBytesNooped) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); auto commandStream = cmdContainer.getCommandStream(); size_t usedBefore = commandStream->getUsed(); diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp index c7131dab12..ac5e023568 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp @@ -544,7 +544,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchMod { debugManager.flags.ForceBtpPrefetchMode.set(-1); cmdContainer.reset(new MyMockCommandContainer()); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; @@ -577,7 +577,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchMod { debugManager.flags.ForceBtpPrefetchMode.set(0); cmdContainer.reset(new MyMockCommandContainer()); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; @@ -605,7 +605,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchMod { debugManager.flags.ForceBtpPrefetchMode.set(1); cmdContainer.reset(new MyMockCommandContainer()); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; @@ -1429,7 +1429,7 @@ HWTEST_F(BindlessCommandEncodeStatesContainerTest, givenBindlessKernelAndBindles pDevice->getNumGenericSubDevices() > 1); auto commandContainer = std::make_unique(); - commandContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); commandContainer->setDirtyStateForAllHeaps(false); commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData; @@ -1456,7 +1456,7 @@ HWTEST2_F(BindlessCommandEncodeStatesContainerTest, givenBindfulKernelWhenBindle DebugManagerStateRestore dbgRestorer; debugManager.flags.UseBindlessMode.set(1); auto commandContainer = std::make_unique(); - commandContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); commandContainer->setDirtyStateForAllHeaps(false); commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData; pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice, @@ -1491,7 +1491,7 @@ HWTEST2_F(NgenGeneratorDispatchKernelEncodeTest, givenBindfulKernelAndIsNotGener using DefaultWalkerType = typename FamilyType::DefaultWalkerType; for (auto isGeneratedByIgc : {false, true}) { auto commandContainer = std::make_unique(); - commandContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); commandContainer->setDirtyStateForAllHeaps(false); commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData; diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp index 89975e5abf..bbe5f1d618 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp @@ -485,7 +485,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenForceBtpPrefetchModeDebugFlagWhenDispatc { debugManager.flags.ForceBtpPrefetchMode.set(-1); cmdContainer.reset(new MyMockCommandContainer()); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; @@ -519,7 +519,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenForceBtpPrefetchModeDebugFlagWhenDispatc { debugManager.flags.ForceBtpPrefetchMode.set(0); cmdContainer.reset(new MyMockCommandContainer()); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; @@ -544,7 +544,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenForceBtpPrefetchModeDebugFlagWhenDispatc { debugManager.flags.ForceBtpPrefetchMode.set(1); cmdContainer.reset(new MyMockCommandContainer()); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData; bool requiresUncachedMocs = false; diff --git a/shared/test/unit_test/encoders/test_encode_math.cpp b/shared/test/unit_test/encoders/test_encode_math.cpp index dc8066a4c5..366a1250ea 100644 --- a/shared/test/unit_test/encoders/test_encode_math.cpp +++ b/shared/test/unit_test/encoders/test_encode_math.cpp @@ -150,7 +150,7 @@ HWTEST_F(CommandEncoderMathTest, WhenReservingCommandThenBitfieldSetCorrectly) { GenCmdList commands; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EncodeMath::commandReserve(cmdContainer); @@ -180,7 +180,7 @@ HWTEST_F(CommandEncoderMathTest, givenOffsetAndValueWhenEncodeBitwiseAndValIsCal GenCmdList commands; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); constexpr uint32_t regOffset = 0x2000u; constexpr uint32_t immVal = 0xbaau; constexpr uint64_t dstAddress = 0xDEADCAF0u; @@ -227,7 +227,7 @@ HWTEST_F(CommandEncoderMathTest, WhenSettingGroupSizeIndirectThenCommandsAreCorr using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)}; uint32_t crossThreadAddress[3] = {}; @@ -251,7 +251,7 @@ HWTEST_F(CommandEncoderMathTest, WhenSettingGroupCountIndirectThenCommandsAreCor using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)}; uint32_t crossThreadAddress[3] = {}; @@ -280,7 +280,7 @@ HWTEST_F(CommandEncoderMathTest, givenPayloadArgumentStoredInInlineDataWhenSetti using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)}; uint64_t crossThreadGpuVa = 0xBADF000; @@ -324,7 +324,7 @@ HWTEST_F(CommandEncoderMathTest, givenPayloadArgumentStoredInInlineDataWhenSetti using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)}; uint64_t crossThreadGpuVa = 0xBADF000; @@ -370,7 +370,7 @@ HWTEST_F(CommandEncoderMathTest, givenPayloadArgumentStoredInInlineDataWhenSetti using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); CrossThreadDataOffset offset = sizeof(uint32_t); uint64_t crossThreadGpuVa = 0xBADF000; @@ -406,7 +406,7 @@ HWTEST_F(CommandEncoderMathTest, givenPayloadArgumentStoredInInlineDataWhenEncod for (auto workDimInInlineData : ::testing::Bool()) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); uint64_t crossThreadGpuVa = 0xBADF000; @@ -494,10 +494,10 @@ HWTEST_F(CommandEncoderMathTest, givenPayloadArgumentStoredInInlineDataWhenEncod using MI_ARB_CHECK = typename FamilyType::MI_ARB_CHECK; using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; CommandContainer cmdContainer0; - cmdContainer0.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer0.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); CommandContainer cmdContainer1; - cmdContainer1.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer1.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); uint64_t crossThreadGpuVa = 0xBADF000; diff --git a/shared/test/unit_test/encoders/test_encode_math_xehp_and_later.cpp b/shared/test/unit_test/encoders/test_encode_math_xehp_and_later.cpp index dfe43b5bef..597307e65c 100644 --- a/shared/test/unit_test/encoders/test_encode_math_xehp_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_math_xehp_and_later.cpp @@ -25,7 +25,7 @@ HWTEST2_F(XeHPAndLaterCommandEncoderMathTest, WhenAppendsAGreaterThanThenPredica using MI_MATH_ALU_INST_INLINE = typename FamilyType::MI_MATH_ALU_INST_INLINE; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EncodeMathMMIO::encodeGreaterThanPredicate(cmdContainer, 0xDEADBEEFCAF0u, 17u, false); diff --git a/shared/test/unit_test/encoders/test_encode_set_mmio.cpp b/shared/test/unit_test/encoders/test_encode_set_mmio.cpp index 0a85450d06..a4e1cf2668 100644 --- a/shared/test/unit_test/encoders/test_encode_set_mmio.cpp +++ b/shared/test/unit_test/encoders/test_encode_set_mmio.cpp @@ -19,7 +19,7 @@ class CommandSetMMIOFixture : public DeviceFixture { void setUp() { DeviceFixture::setUp(); cmdContainer = std::make_unique(); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); } void tearDown() { cmdContainer.reset(); diff --git a/shared/test/unit_test/fixtures/command_container_fixture.cpp b/shared/test/unit_test/fixtures/command_container_fixture.cpp index 900696fa35..acf794bac7 100644 --- a/shared/test/unit_test/fixtures/command_container_fixture.cpp +++ b/shared/test/unit_test/fixtures/command_container_fixture.cpp @@ -18,7 +18,7 @@ namespace NEO { void CommandEncodeStatesFixture::setUp() { DeviceFixture::setUp(); cmdContainer = std::make_unique(); - cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); cmdContainer->setDirtyStateForAllHeaps(false); const auto &hwInfo = pDevice->getHardwareInfo(); auto &productHelper = pDevice->getProductHelper(); diff --git a/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp b/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp index a5b6891be2..f0578652fd 100644 --- a/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp +++ b/shared/test/unit_test/gen12lp/test_command_encoder_gen12lp.cpp @@ -32,7 +32,7 @@ GEN12LPTEST_F(CommandEncoderTest, WhenAdjustComputeModeIsCalledThenStateComputeM CommandContainer cmdContainer; - auto ret = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto ret = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); ASSERT_EQ(CommandContainer::ErrorCode::success, ret); auto usedSpaceBefore = cmdContainer.getCommandStream()->getUsed(); @@ -62,7 +62,7 @@ GEN12LPTEST_F(CommandEncoderTest, WhenAdjustComputeModeIsCalledThenStateComputeM GEN12LPTEST_F(CommandEncoderTest, givenCommandContainerWhenEncodeL3StateThenDoNotDispatchMMIOCommand) { CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EncodeL3State::encode(cmdContainer, false); GenCmdList commands; @@ -83,7 +83,7 @@ GEN12LPTEST_F(CommandEncodeStatesTest, givenVariousEngineTypesWhenEncodeSbaThenA CommandContainer cmdContainer; - auto ret = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + auto ret = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); ASSERT_EQ(CommandContainer::ErrorCode::success, ret); auto gmmHelper = cmdContainer.getDevice()->getRootDeviceEnvironment().getGmmHelper(); @@ -126,7 +126,7 @@ GEN12LPTEST_F(CommandEncoderTest, GivenGen12LpWhenProgrammingL3StateOnThenExpect using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EncodeL3State::encode(cmdContainer, true); @@ -140,7 +140,7 @@ GEN12LPTEST_F(CommandEncoderTest, GivenGen12LpWhenProgrammingL3StateOnThenExpect GEN12LPTEST_F(CommandEncoderTest, GivenGen12LpWhenProgrammingL3StateOffThenExpectNoCommandsDispatched) { using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EncodeL3State::encode(cmdContainer, false); diff --git a/shared/test/unit_test/gen12lp/test_encode_math_gen12lp.cpp b/shared/test/unit_test/gen12lp/test_encode_math_gen12lp.cpp index 31b962871f..9d03bd83c9 100644 --- a/shared/test/unit_test/gen12lp/test_encode_math_gen12lp.cpp +++ b/shared/test/unit_test/gen12lp/test_encode_math_gen12lp.cpp @@ -25,7 +25,7 @@ GEN12LPTEST_F(CommandEncoderMathTestGen12Lp, WhenAppendsAGreaterThanThenPredicat using MI_MATH_ALU_INST_INLINE = typename FamilyType::MI_MATH_ALU_INST_INLINE; CommandContainer cmdContainer; - cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false); EncodeMathMMIO::encodeGreaterThanPredicate(cmdContainer, 0xDEADBEEFCAF0u, 17u, false); diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp index 3b9d77fc7b..d467c7ddff 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp @@ -4871,7 +4871,7 @@ TEST(DrmMemoryManager, givenEnabledResourceRegistrationWhenSshIsAllocatedThenItI auto device = std::unique_ptr(MockDevice::create(executionEnvironment, 0)); CommandContainer cmdContainer; - cmdContainer.initialize(device.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false); + cmdContainer.initialize(device.get(), nullptr, HeapSize::defaultHeapSize, true, false); auto *ssh = cmdContainer.getIndirectHeap(NEO::HeapType::surfaceState); auto bo = static_cast(ssh->getGraphicsAllocation())->getBO();