mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-23 11:03:02 +08:00
performance: increase heap size to 4MB
Related-To: NEO-16348 Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d6ea88f266
commit
f41bb3517a
@@ -715,7 +715,7 @@ HWTEST_P(CommandQueueIndirectHeapTest, givenCommandStreamReceiverWithReusableAll
|
|||||||
|
|
||||||
auto memoryManager = pDevice->getMemoryManager();
|
auto memoryManager = pDevice->getMemoryManager();
|
||||||
|
|
||||||
auto allocationSize = NEO::HeapSize::defaultHeapSize * 2;
|
auto allocationSize = NEO::HeapSize::getDefaultHeapSize(this->GetParam()) * 2;
|
||||||
|
|
||||||
GraphicsAllocation *allocation = nullptr;
|
GraphicsAllocation *allocation = nullptr;
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ add_executable(igdrcl_${target_name}
|
|||||||
${NEO_SHARED_DIRECTORY}/dll/direct_submission_controller_enabled.cpp
|
${NEO_SHARED_DIRECTORY}/dll/direct_submission_controller_enabled.cpp
|
||||||
${NEO_SHARED_DIRECTORY}/dll/unified_memory_reuse_cleaner_enabled.cpp
|
${NEO_SHARED_DIRECTORY}/dll/unified_memory_reuse_cleaner_enabled.cpp
|
||||||
${NEO_SHARED_DIRECTORY}/dll/usm_pool_size.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/drm_neo_create.cpp
|
||||||
${NEO_SHARED_DIRECTORY}/dll/linux${BRANCH_DIR_SUFFIX}/options_linux.cpp
|
${NEO_SHARED_DIRECTORY}/dll/linux${BRANCH_DIR_SUFFIX}/options_linux.cpp
|
||||||
${NEO_SHARED_DIRECTORY}/dll/linux/options_linux.inl
|
${NEO_SHARED_DIRECTORY}/dll/linux/options_linux.inl
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "shared/source/helpers/aligned_memory.h"
|
#include "shared/source/helpers/aligned_memory.h"
|
||||||
#include "shared/source/helpers/basic_math.h"
|
#include "shared/source/helpers/basic_math.h"
|
||||||
#include "shared/source/helpers/gfx_core_helper.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/memory_manager.h"
|
||||||
#include "shared/source/memory_manager/usm_pool_params.h"
|
#include "shared/source/memory_manager/usm_pool_params.h"
|
||||||
#include "shared/source/os_interface/driver_info.h"
|
#include "shared/source/os_interface/driver_info.h"
|
||||||
@@ -649,6 +650,12 @@ TEST(UsmPoolTest, whenGetUsmPoolSizeCalledThenReturnCorrectSize) {
|
|||||||
EXPECT_EQ(usmPoolSize, NEO::UsmPoolParams::getUsmPoolSize(gfxCoreHelper));
|
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) {
|
TEST(DrmMemoryManagerCreate, whenCallCreateMemoryManagerThenDrmMemoryManagerIsCreated) {
|
||||||
DebugManagerStateRestore restorer;
|
DebugManagerStateRestore restorer;
|
||||||
debugManager.flags.OverridePatIndex.set(0);
|
debugManager.flags.OverridePatIndex.set(0);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if(WIN32)
|
|||||||
|
|
||||||
add_executable(igdrcl_windows_dll_tests
|
add_executable(igdrcl_windows_dll_tests
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}get_devices_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}get_devices_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_create_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/main_windows_dll.cpp
|
||||||
${NEO_IGDRCL_WINDOWS_DLL_TESTS_TARGET_OBJECTS}
|
${NEO_IGDRCL_WINDOWS_DLL_TESTS_TARGET_OBJECTS}
|
||||||
${NEO_SHARED_DIRECTORY}/dll/device_dll.cpp
|
${NEO_SHARED_DIRECTORY}/dll/device_dll.cpp
|
||||||
${NEO_SHARED_DIRECTORY}/dll/direct_submission_controller_enabled.cpp
|
${NEO_SHARED_DIRECTORY}/dll/direct_submission_controller_enabled.cpp
|
||||||
@@ -27,6 +27,7 @@ if(WIN32)
|
|||||||
${NEO_SHARED_DIRECTORY}/dll/unified_memory_reuse_cleaner_enabled.cpp
|
${NEO_SHARED_DIRECTORY}/dll/unified_memory_reuse_cleaner_enabled.cpp
|
||||||
${NEO_SHARED_DIRECTORY}/dll/create_command_stream.cpp
|
${NEO_SHARED_DIRECTORY}/dll/create_command_stream.cpp
|
||||||
${NEO_SHARED_DIRECTORY}/dll/wddm/wddm_create.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/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/create_wddm_memory_manager.cpp
|
||||||
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows${BRANCH_DIR_SUFFIX}/options.cpp
|
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows${BRANCH_DIR_SUFFIX}/options.cpp
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2023 Intel Corporation
|
* Copyright (C) 2018-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "shared/source/execution_environment/root_device_environment.h"
|
#include "shared/source/execution_environment/root_device_environment.h"
|
||||||
#include "shared/source/helpers/hw_info.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/os_interface.h"
|
||||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||||
@@ -24,3 +25,9 @@ TEST(wddmCreateTests, givenInputVersionWhenCreatingThenCreateRequestedObject) {
|
|||||||
std::unique_ptr<Wddm> wddm(Wddm::createWddm(std::unique_ptr<HwDeviceIdWddm>(hwDeviceIds[0].release()->as<HwDeviceIdWddm>()), rootDeviceEnvironment));
|
std::unique_ptr<Wddm> wddm(Wddm::createWddm(std::unique_ptr<HwDeviceIdWddm>(hwDeviceIds[0].release()->as<HwDeviceIdWddm>()), rootDeviceEnvironment));
|
||||||
EXPECT_NE(nullptr, wddm);
|
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));
|
||||||
|
}
|
||||||
@@ -597,11 +597,11 @@ bool CommandContainer::skipHeapAllocationCreation(HeapType heapType) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t CommandContainer::getHeapSize(HeapType heapType) {
|
size_t CommandContainer::getHeapSize(HeapType heapType) {
|
||||||
size_t defaultHeapSize = HeapSize::defaultHeapSize;
|
size_t defaultHeapSize = HeapSize::getDefaultHeapSize(heapType);
|
||||||
if (HeapType::surfaceState == heapType) {
|
if (HeapType::surfaceState == heapType) {
|
||||||
defaultHeapSize = this->defaultSshSize;
|
defaultHeapSize = this->defaultSshSize;
|
||||||
}
|
}
|
||||||
return HeapSize::getDefaultHeapSize(defaultHeapSize);
|
return HeapSize::getHeapSize(defaultHeapSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *CommandContainer::findCpuBaseForCmdBufferAddress(void *cmdBufferAddress) {
|
void *CommandContainer::findCpuBaseForCmdBufferAddress(void *cmdBufferAddress) {
|
||||||
|
|||||||
@@ -764,7 +764,7 @@ IndirectHeap &CommandStreamReceiver::getIndirectHeap(IndirectHeap::Type heapType
|
|||||||
void CommandStreamReceiver::allocateHeapMemory(IndirectHeap::Type heapType,
|
void CommandStreamReceiver::allocateHeapMemory(IndirectHeap::Type heapType,
|
||||||
size_t minRequiredSize, IndirectHeap *&indirectHeap) {
|
size_t minRequiredSize, IndirectHeap *&indirectHeap) {
|
||||||
size_t reservedSize = 0;
|
size_t reservedSize = 0;
|
||||||
auto finalHeapSize = HeapSize::getDefaultHeapSize(HeapSize::defaultHeapSize);
|
auto finalHeapSize = HeapSize::getHeapSize(HeapSize::getDefaultHeapSize(heapType));
|
||||||
if (IndirectHeap::Type::surfaceState == heapType) {
|
if (IndirectHeap::Type::surfaceState == heapType) {
|
||||||
finalHeapSize = defaultSshSize;
|
finalHeapSize = defaultSshSize;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiverHw(ExecutionEnvironment
|
|||||||
if (debugManager.flags.FlattenBatchBufferForAUBDump.get() || debugManager.flags.AddPatchInfoCommentsForAUBDump.get()) {
|
if (debugManager.flags.FlattenBatchBufferForAUBDump.get() || debugManager.flags.AddPatchInfoCommentsForAUBDump.get()) {
|
||||||
flatBatchBufferHelper.reset(new FlatBatchBufferHelperHw<GfxFamily>(executionEnvironment));
|
flatBatchBufferHelper.reset(new FlatBatchBufferHelperHw<GfxFamily>(executionEnvironment));
|
||||||
}
|
}
|
||||||
defaultSshSize = HeapSize::getDefaultHeapSize(EncodeStates<GfxFamily>::getSshHeapSize());
|
defaultSshSize = HeapSize::getHeapSize(EncodeStates<GfxFamily>::getSshHeapSize());
|
||||||
this->use4GbHeaps = are4GbHeapsAvailable();
|
this->use4GbHeaps = are4GbHeapsAvailable();
|
||||||
|
|
||||||
timestampPacketWriteEnabled = gfxCoreHelper.timestampPacketWriteSupported();
|
timestampPacketWriteEnabled = gfxCoreHelper.timestampPacketWriteSupported();
|
||||||
|
|||||||
@@ -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, 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, 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, ForceIOHAlignment, -1, "-1: no force, >0: n byte alignment")
|
||||||
DECLARE_DEBUG_VARIABLE(int32_t, ForceDefaultHeapSize, -1, "-1: no force (64kb), >0: n kb size")
|
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, PreferCopyEngineForCopyBufferToBuffer, -1, "-1: default, 0: prefer EUs, 1: prefer blitter")
|
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, 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")
|
DECLARE_DEBUG_VARIABLE(int64_t, ForceNonSystemMemoryPlacement, 0, "0: default, >0: (bitmask) for given Graphics Allocation Type, force non-system memory placement")
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ set(NEO_SHARED_DLLS
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/options_dll.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/options_dll.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/get_staging_buffer_size.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/get_staging_buffer_size.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/usm_pool_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})
|
add_library(neo_shared_dlls_precompiled_objects OBJECT ${NEO_SHARED_DLLS})
|
||||||
|
|||||||
22
shared/source/dll/default_heap_size.cpp
Normal file
22
shared/source/dll/default_heap_size.cpp
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* 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
|
||||||
@@ -205,7 +205,7 @@ class GfxCoreHelper {
|
|||||||
uint32_t &requiredWalkOrder,
|
uint32_t &requiredWalkOrder,
|
||||||
uint32_t simd) const = 0;
|
uint32_t simd) const = 0;
|
||||||
virtual uint32_t getMaxPtssIndex(const ProductHelper &productHelper) const = 0;
|
virtual uint32_t getMaxPtssIndex(const ProductHelper &productHelper) const = 0;
|
||||||
virtual uint32_t getDefaultSshSize(const ProductHelper &productHelper) const = 0;
|
virtual size_t getDefaultSshSize(const ProductHelper &productHelper) const = 0;
|
||||||
|
|
||||||
virtual bool usmCompressionSupported(const NEO::HardwareInfo &hwInfo) const = 0;
|
virtual bool usmCompressionSupported(const NEO::HardwareInfo &hwInfo) const = 0;
|
||||||
|
|
||||||
@@ -477,7 +477,7 @@ class GfxCoreHelperHw : public GfxCoreHelper {
|
|||||||
uint32_t &requiredWalkOrder,
|
uint32_t &requiredWalkOrder,
|
||||||
uint32_t simd) const override;
|
uint32_t simd) const override;
|
||||||
uint32_t getMaxPtssIndex(const ProductHelper &productHelper) const override;
|
uint32_t getMaxPtssIndex(const ProductHelper &productHelper) const override;
|
||||||
uint32_t getDefaultSshSize(const ProductHelper &productHelper) const override;
|
size_t getDefaultSshSize(const ProductHelper &productHelper) const override;
|
||||||
|
|
||||||
bool usmCompressionSupported(const NEO::HardwareInfo &hwInfo) const override;
|
bool usmCompressionSupported(const NEO::HardwareInfo &hwInfo) const override;
|
||||||
|
|
||||||
|
|||||||
@@ -857,8 +857,8 @@ uint32_t GfxCoreHelperHw<GfxFamily>::getMaxPtssIndex(const ProductHelper &produc
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename GfxFamily>
|
template <typename GfxFamily>
|
||||||
uint32_t GfxCoreHelperHw<GfxFamily>::getDefaultSshSize(const ProductHelper &productHelper) const {
|
size_t GfxCoreHelperHw<GfxFamily>::getDefaultSshSize(const ProductHelper &productHelper) const {
|
||||||
return HeapSize::defaultHeapSize;
|
return HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename GfxFamily>
|
template <typename GfxFamily>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2023 Intel Corporation
|
* Copyright (C) 2023-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
namespace NEO {
|
namespace NEO {
|
||||||
namespace HeapSize {
|
namespace HeapSize {
|
||||||
|
|
||||||
size_t getDefaultHeapSize(size_t defaultValue) {
|
size_t getHeapSize(size_t defaultValue) {
|
||||||
auto defaultSize = defaultValue;
|
auto defaultSize = defaultValue;
|
||||||
if (debugManager.flags.ForceDefaultHeapSize.get() != -1) {
|
if (debugManager.flags.ForceDefaultHeapSize.get() != -1) {
|
||||||
defaultSize = debugManager.flags.ForceDefaultHeapSize.get() * MemoryConstants::kiloByte;
|
defaultSize = debugManager.flags.ForceDefaultHeapSize.get() * MemoryConstants::kiloByte;
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2023 Intel Corporation
|
* Copyright (C) 2023-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "shared/source/helpers/constants.h"
|
|
||||||
|
#include "shared/source/indirect_heap/indirect_heap_type.h"
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
namespace HeapSize {
|
namespace HeapSize {
|
||||||
|
|
||||||
inline constexpr size_t defaultHeapSize = 64 * MemoryConstants::kiloByte;
|
size_t getDefaultHeapSize(IndirectHeapType heapType);
|
||||||
|
size_t getHeapSize(size_t defaultValue);
|
||||||
size_t getDefaultHeapSize(size_t defaultValue);
|
|
||||||
|
|
||||||
} // namespace HeapSize
|
} // namespace HeapSize
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ set(neo_libult_SRCS_LINUX
|
|||||||
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/linux/sys_calls_linux_ult.cpp
|
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/linux/sys_calls_linux_ult.cpp
|
||||||
${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_get_staging_buffer_size.cpp
|
${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_get_staging_buffer_size.cpp
|
||||||
${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_usm_pool_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})
|
set_property(GLOBAL APPEND PROPERTY neo_libult_SRCS_LINUX ${neo_libult_SRCS_LINUX})
|
||||||
@@ -228,6 +229,7 @@ set(neo_libult_SRCS_WINDOWS
|
|||||||
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/wddm_calls.cpp
|
${NEO_SHARED_TEST_DIRECTORY}/common/os_interface/windows/wddm_calls.cpp
|
||||||
${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_get_staging_buffer_size.cpp
|
${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_get_staging_buffer_size.cpp
|
||||||
${NEO_SHARED_TEST_DIRECTORY}/common/mocks/mock_usm_pool_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})
|
set_property(GLOBAL APPEND PROPERTY neo_libult_SRCS_WINDOWS ${neo_libult_SRCS_WINDOWS})
|
||||||
|
|||||||
18
shared/test/common/mocks/mock_default_heap_size.cpp
Normal file
18
shared/test/common/mocks/mock_default_heap_size.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* 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
|
||||||
@@ -100,7 +100,7 @@ TEST_F(CommandContainerHeapStateTests, givenDirtyHeapsWhenSettingStateForSingleH
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenCreatingCommandBufferThenCorrectAllocationTypeIsSet) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenCreatingCommandBufferThenCorrectAllocationTypeIsSet) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
ASSERT_NE(0u, cmdContainer.getCmdBufferAllocations().size());
|
ASSERT_NE(0u, cmdContainer.getCmdBufferAllocations().size());
|
||||||
EXPECT_EQ(AllocationType::commandBuffer, cmdContainer.getCmdBufferAllocations()[0]->getAllocationType());
|
EXPECT_EQ(AllocationType::commandBuffer, cmdContainer.getCmdBufferAllocations()[0]->getAllocationType());
|
||||||
@@ -113,7 +113,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenCreatingCommandBufferThenCorre
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenInitializeThenCreateAdditionalLinearStream) {
|
TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenInitializeThenCreateAdditionalLinearStream) {
|
||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, true);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true);
|
||||||
|
|
||||||
EXPECT_NE(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), nullptr);
|
EXPECT_NE(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), nullptr);
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenInitializ
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, whenInitializeThenNotCreateAdditionalLinearStream) {
|
TEST_F(CommandContainerTest, whenInitializeThenNotCreateAdditionalLinearStream) {
|
||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
EXPECT_EQ(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), nullptr);
|
EXPECT_EQ(cmdContainer.secondaryCommandStreamForImmediateCmdList.get(), nullptr);
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ TEST_F(CommandContainerTest, whenInitializeThenNotCreateAdditionalLinearStream)
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectAllocationTypes) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectAllocationTypes) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < HeapType::numTypes; i++) {
|
for (uint32_t i = 0; i < HeapType::numTypes; i++) {
|
||||||
HeapType heapType = static_cast<HeapType>(i);
|
HeapType heapType = static_cast<HeapType>(i);
|
||||||
@@ -162,7 +162,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectA
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIsInitialized) {
|
TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIsInitialized) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||||
|
|
||||||
EXPECT_EQ(pDevice, cmdContainer.getDevice());
|
EXPECT_EQ(pDevice, cmdContainer.getDevice());
|
||||||
@@ -193,7 +193,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIs
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCommandContainerWhenHeapNotRequiredThenHeapIsNotInitialized) {
|
TEST_F(CommandContainerTest, givenCommandContainerWhenHeapNotRequiredThenHeapIsNotInitialized) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false);
|
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||||
|
|
||||||
EXPECT_EQ(pDevice, cmdContainer.getDevice());
|
EXPECT_EQ(pDevice, cmdContainer.getDevice());
|
||||||
@@ -230,7 +230,7 @@ TEST_F(CommandContainerTest, givenEnabledLocalMemoryAndIsaInSystemMemoryWhenCmdC
|
|||||||
auto instructionHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(0, false);
|
auto instructionHeapBaseAddress = device->getMemoryManager()->getInternalHeapBaseAddress(0, false);
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
auto status = cmdContainer.initialize(device.get(), nullptr, HeapSize::defaultHeapSize, true, false);
|
auto status = cmdContainer.initialize(device.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||||
|
|
||||||
EXPECT_EQ(instructionHeapBaseAddress, cmdContainer.getInstructionHeapBaseAddress());
|
EXPECT_EQ(instructionHeapBaseAddress, cmdContainer.getInstructionHeapBaseAddress());
|
||||||
@@ -249,7 +249,7 @@ TEST_F(CommandContainerTest, givenForceDefaultHeapSizeWhenCmdContainerIsInitiali
|
|||||||
auto device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
|
auto device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
auto status = cmdContainer.initialize(device.get(), nullptr, HeapSize::defaultHeapSize, true, false);
|
auto status = cmdContainer.initialize(device.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||||
|
|
||||||
auto indirectHeap = cmdContainer.getIndirectHeap(IndirectHeap::Type::indirectObject);
|
auto indirectHeap = cmdContainer.getIndirectHeap(IndirectHeap::Type::indirectObject);
|
||||||
@@ -259,21 +259,21 @@ TEST_F(CommandContainerTest, givenForceDefaultHeapSizeWhenCmdContainerIsInitiali
|
|||||||
TEST_F(CommandContainerTest, givenCommandContainerDuringInitWhenAllocateGfxMemoryFailsThenErrorIsReturned) {
|
TEST_F(CommandContainerTest, givenCommandContainerDuringInitWhenAllocateGfxMemoryFailsThenErrorIsReturned) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(0, *pDevice->executionEnvironment));
|
pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(0, *pDevice->executionEnvironment));
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenAllocateSecondaryCmdStreamFailsDuringInitializeThenErrorIsReturned) {
|
TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenAllocateSecondaryCmdStreamFailsDuringInitializeThenErrorIsReturned) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
static_cast<MockMemoryManager *>(pDevice->getMemoryManager())->maxSuccessAllocatedGraphicsMemoryIndex = 7;
|
static_cast<MockMemoryManager *>(pDevice->getMemoryManager())->maxSuccessAllocatedGraphicsMemoryIndex = 7;
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, true);
|
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerWithAllocsListWhenAllocateAndResetThenCmdBufferAllocIsReused) {
|
TEST_F(CommandContainerTest, givenCmdContainerWithAllocsListWhenAllocateAndResetThenCmdBufferAllocIsReused) {
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
auto cmdContainer = std::make_unique<CommandContainer>();
|
auto cmdContainer = std::make_unique<CommandContainer>();
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto &cmdBufferAllocs = cmdContainer->getCmdBufferAllocations();
|
auto &cmdBufferAllocs = cmdContainer->getCmdBufferAllocations();
|
||||||
auto memoryManager = static_cast<MockMemoryManager *>(pDevice->getMemoryManager());
|
auto memoryManager = static_cast<MockMemoryManager *>(pDevice->getMemoryManager());
|
||||||
EXPECT_EQ(memoryManager->handleFenceCompletionCalled, 0u);
|
EXPECT_EQ(memoryManager->handleFenceCompletionCalled, 0u);
|
||||||
@@ -310,7 +310,7 @@ TEST_F(CommandContainerTest, givenReusableAllocationsAndRemoveUserFenceInCmdlist
|
|||||||
|
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
auto cmdContainer = std::make_unique<CommandContainer>();
|
auto cmdContainer = std::make_unique<CommandContainer>();
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto &cmdBufferAllocs = cmdContainer->getCmdBufferAllocations();
|
auto &cmdBufferAllocs = cmdContainer->getCmdBufferAllocations();
|
||||||
auto memoryManager = static_cast<MockMemoryManager *>(pDevice->getMemoryManager());
|
auto memoryManager = static_cast<MockMemoryManager *>(pDevice->getMemoryManager());
|
||||||
EXPECT_EQ(0u, memoryManager->handleFenceCompletionCalled);
|
EXPECT_EQ(0u, memoryManager->handleFenceCompletionCalled);
|
||||||
@@ -336,7 +336,7 @@ TEST_F(CommandContainerTest, givenReusableAllocationsAndRemoveUserFenceInCmdlist
|
|||||||
|
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
auto cmdContainer = std::make_unique<CommandContainer>();
|
auto cmdContainer = std::make_unique<CommandContainer>();
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto &cmdBufferAllocs = cmdContainer->getCmdBufferAllocations();
|
auto &cmdBufferAllocs = cmdContainer->getCmdBufferAllocations();
|
||||||
auto memoryManager = static_cast<MockMemoryManager *>(pDevice->getMemoryManager());
|
auto memoryManager = static_cast<MockMemoryManager *>(pDevice->getMemoryManager());
|
||||||
EXPECT_EQ(0u, memoryManager->handleFenceCompletionCalled);
|
EXPECT_EQ(0u, memoryManager->handleFenceCompletionCalled);
|
||||||
@@ -360,7 +360,7 @@ TEST_F(CommandContainerTest, givenCommandContainerDuringInitWhenAllocateHeapMemo
|
|||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
auto tempMemoryManager = pDevice->executionEnvironment->memoryManager.release();
|
auto tempMemoryManager = pDevice->executionEnvironment->memoryManager.release();
|
||||||
pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(1, *pDevice->executionEnvironment));
|
pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(1, *pDevice->executionEnvironment));
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::outOfDeviceMemory, status);
|
||||||
delete tempMemoryManager;
|
delete tempMemoryManager;
|
||||||
}
|
}
|
||||||
@@ -375,10 +375,10 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenSettingIndirectHeapAllocat
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenHeapAllocationsWhenDestroyCommandContainerThenHeapAllocationsAreReused) {
|
TEST_F(CommandContainerTest, givenHeapAllocationsWhenDestroyCommandContainerThenHeapAllocationsAreReused) {
|
||||||
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto heapAllocationsAddress = cmdContainer->getIndirectHeapAllocation(HeapType::surfaceState)->getUnderlyingBuffer();
|
auto heapAllocationsAddress = cmdContainer->getIndirectHeapAllocation(HeapType::surfaceState)->getUnderlyingBuffer();
|
||||||
cmdContainer.reset(new CommandContainer);
|
cmdContainer.reset(new CommandContainer);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
bool status = true;
|
bool status = true;
|
||||||
for (uint32_t i = 0; i < HeapType::numTypes && !status; i++) {
|
for (uint32_t i = 0; i < HeapType::numTypes && !status; i++) {
|
||||||
auto heapType = static_cast<HeapType>(i);
|
auto heapType = static_cast<HeapType>(i);
|
||||||
@@ -393,7 +393,7 @@ TEST_F(CommandContainerTest, givenHeapAllocationsWhenDestroyCommandContainerThen
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCommandContainerWhenResetThenStateIsReset) {
|
TEST_F(CommandContainerTest, givenCommandContainerWhenResetThenStateIsReset) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
LinearStream stream;
|
LinearStream stream;
|
||||||
uint32_t usedSize = 1;
|
uint32_t usedSize = 1;
|
||||||
cmdContainer.getCommandStream()->getSpace(usedSize);
|
cmdContainer.getCommandStream()->getSpace(usedSize);
|
||||||
@@ -407,7 +407,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenResetThenStateIsReset) {
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddNullPtrToResidencyContainerThenNothingIsAdded) {
|
TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddNullPtrToResidencyContainerThenNothingIsAdded) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto size = cmdContainer.getResidencyContainer().size();
|
auto size = cmdContainer.getResidencyContainer().size();
|
||||||
cmdContainer.addToResidencyContainer(nullptr);
|
cmdContainer.addToResidencyContainer(nullptr);
|
||||||
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), size);
|
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), size);
|
||||||
@@ -416,14 +416,14 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddNullPtrToResidenc
|
|||||||
TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenCmdBuffersAreAddedToResidencyContainer) {
|
TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenCmdBuffersAreAddedToResidencyContainer) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), 0u);
|
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), 0u);
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, true);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, true);
|
||||||
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), 2u);
|
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), 2u);
|
||||||
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), cmdContainer.getCmdBufferAllocations().size());
|
EXPECT_EQ(cmdContainer.getResidencyContainer().size(), cmdContainer.getCmdBufferAllocations().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddAlreadyAddedAllocationAndDuplicatesRemovedThenExpectedSizeIsReturned) {
|
TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddAlreadyAddedAllocationAndDuplicatesRemovedThenExpectedSizeIsReturned) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
MockGraphicsAllocation mockAllocation;
|
MockGraphicsAllocation mockAllocation;
|
||||||
|
|
||||||
auto sizeBefore = cmdContainer.getResidencyContainer().size();
|
auto sizeBefore = cmdContainer.getResidencyContainer().size();
|
||||||
@@ -447,7 +447,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenWantToAddAlreadyAddedAlloc
|
|||||||
HWTEST_F(CommandContainerTest, givenCmdContainerWhenInitializeCalledThenSSHHeapHasBindlessOffsetReserved) {
|
HWTEST_F(CommandContainerTest, givenCmdContainerWhenInitializeCalledThenSSHHeapHasBindlessOffsetReserved) {
|
||||||
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
||||||
cmdContainer->setReservedSshSize(4 * MemoryConstants::pageSize);
|
cmdContainer->setReservedSshSize(4 * MemoryConstants::pageSize);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setDirtyStateForAllHeaps(false);
|
cmdContainer->setDirtyStateForAllHeaps(false);
|
||||||
|
|
||||||
auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState);
|
auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState);
|
||||||
@@ -460,7 +460,7 @@ HWTEST_F(CommandContainerTest, givenNotEnoughSpaceInSSHWhenGettingHeapWithRequir
|
|||||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||||
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
||||||
cmdContainer->setReservedSshSize(4 * MemoryConstants::pageSize);
|
cmdContainer->setReservedSshSize(4 * MemoryConstants::pageSize);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setDirtyStateForAllHeaps(false);
|
cmdContainer->setDirtyStateForAllHeaps(false);
|
||||||
|
|
||||||
auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState);
|
auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState);
|
||||||
@@ -475,7 +475,7 @@ HWTEST_F(CommandContainerTest, givenNotEnoughSpaceInSSHWhenGettingHeapWithRequir
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenExistingAllocationIsReturned) {
|
TEST_F(CommandContainerTest, givenAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenExistingAllocationIsReturned) {
|
||||||
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setDirtyStateForAllHeaps(false);
|
cmdContainer->setDirtyStateForAllHeaps(false);
|
||||||
HeapType heapTypes[] = {HeapType::surfaceState,
|
HeapType heapTypes[] = {HeapType::surfaceState,
|
||||||
HeapType::dynamicState};
|
HeapType::dynamicState};
|
||||||
@@ -510,7 +510,7 @@ TEST_F(CommandContainerTest, givenAvailableSpaceWhenGetHeapWithRequiredSizeAndAl
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenUnalignedAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenHeapReturnedIsCorrectlyAligned) {
|
TEST_F(CommandContainerTest, givenUnalignedAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenHeapReturnedIsCorrectlyAligned) {
|
||||||
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setDirtyStateForAllHeaps(false);
|
cmdContainer->setDirtyStateForAllHeaps(false);
|
||||||
auto heapAllocation = cmdContainer->getIndirectHeapAllocation(HeapType::surfaceState);
|
auto heapAllocation = cmdContainer->getIndirectHeapAllocation(HeapType::surfaceState);
|
||||||
auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState);
|
auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState);
|
||||||
@@ -534,7 +534,7 @@ TEST_F(CommandContainerTest, givenUnalignedAvailableSpaceWhenGetHeapWithRequired
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenNoAlignmentAndAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenHeapReturnedIsNotAligned) {
|
TEST_F(CommandContainerTest, givenNoAlignmentAndAvailableSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenHeapReturnedIsNotAligned) {
|
||||||
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setDirtyStateForAllHeaps(false);
|
cmdContainer->setDirtyStateForAllHeaps(false);
|
||||||
auto heapAllocation = cmdContainer->getIndirectHeapAllocation(HeapType::surfaceState);
|
auto heapAllocation = cmdContainer->getIndirectHeapAllocation(HeapType::surfaceState);
|
||||||
auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState);
|
auto heap = cmdContainer->getIndirectHeap(HeapType::surfaceState);
|
||||||
@@ -558,7 +558,7 @@ TEST_F(CommandContainerTest, givenNoAlignmentAndAvailableSpaceWhenGetHeapWithReq
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenNotEnoughSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenNewAllocationIsReturned) {
|
TEST_F(CommandContainerTest, givenNotEnoughSpaceWhenGetHeapWithRequiredSizeAndAlignmentCalledThenNewAllocationIsReturned) {
|
||||||
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setDirtyStateForAllHeaps(false);
|
cmdContainer->setDirtyStateForAllHeaps(false);
|
||||||
HeapType heapTypes[] = {HeapType::surfaceState,
|
HeapType heapTypes[] = {HeapType::surfaceState,
|
||||||
HeapType::dynamicState};
|
HeapType::dynamicState};
|
||||||
@@ -596,7 +596,7 @@ TEST_F(CommandContainerTest, givenNotEnoughSpaceWhenGetHeapWithRequiredSizeAndAl
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenNotEnoughSpaceWhenCreatedAllocationHaveDifferentBaseThenHeapIsDirty) {
|
TEST_F(CommandContainerTest, givenNotEnoughSpaceWhenCreatedAllocationHaveDifferentBaseThenHeapIsDirty) {
|
||||||
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setDirtyStateForAllHeaps(false);
|
cmdContainer->setDirtyStateForAllHeaps(false);
|
||||||
HeapType type = HeapType::indirectObject;
|
HeapType type = HeapType::indirectObject;
|
||||||
|
|
||||||
@@ -628,7 +628,7 @@ TEST_F(CommandContainerTest, givenNotEnoughSpaceWhenCreatedAllocationHaveDiffere
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, whenAllocateNextCmdBufferIsCalledThenNewAllocationIsCreatedAndCommandStreamReplaced) {
|
TEST_F(CommandContainerTest, whenAllocateNextCmdBufferIsCalledThenNewAllocationIsCreatedAndCommandStreamReplaced) {
|
||||||
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto stream = cmdContainer->getCommandStream();
|
auto stream = cmdContainer->getCommandStream();
|
||||||
ASSERT_NE(nullptr, stream);
|
ASSERT_NE(nullptr, stream);
|
||||||
|
|
||||||
@@ -656,7 +656,7 @@ TEST_F(CommandContainerTest, whenAllocateNextCmdBufferIsCalledThenNewAllocationI
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, whenResettingCommandContainerThenStoredCmdBuffersAreFreedAndStreamIsReplacedWithInitialBuffer) {
|
TEST_F(CommandContainerTest, whenResettingCommandContainerThenStoredCmdBuffersAreFreedAndStreamIsReplacedWithInitialBuffer) {
|
||||||
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
std::unique_ptr<CommandContainer> cmdContainer(new CommandContainer);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
cmdContainer->allocateNextCommandBuffer();
|
cmdContainer->allocateNextCommandBuffer();
|
||||||
cmdContainer->allocateNextCommandBuffer();
|
cmdContainer->allocateNextCommandBuffer();
|
||||||
@@ -702,7 +702,7 @@ TEST_P(CommandContainerHeaps, givenCommandContainerWhenGetAllowHeapGrowCalledThe
|
|||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
|
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::dynamicState == heapType) {
|
if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::dynamicState == heapType) {
|
||||||
EXPECT_EQ(cmdContainer.getIndirectHeap(heapType), nullptr);
|
EXPECT_EQ(cmdContainer.getIndirectHeap(heapType), nullptr);
|
||||||
} else {
|
} else {
|
||||||
@@ -720,7 +720,7 @@ TEST_P(CommandContainerHeaps, givenCommandContainerWhenGetingMoreThanAvailableSi
|
|||||||
HeapType heapType = GetParam();
|
HeapType heapType = GetParam();
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer.setDirtyStateForAllHeaps(false);
|
cmdContainer.setDirtyStateForAllHeaps(false);
|
||||||
auto heap = cmdContainer.getIndirectHeap(heapType);
|
auto heap = cmdContainer.getIndirectHeap(heapType);
|
||||||
if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::dynamicState == heapType) {
|
if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::dynamicState == heapType) {
|
||||||
@@ -755,10 +755,10 @@ TEST_P(CommandContainerHeaps, givenCommandContainerForDifferentRootDevicesThenHe
|
|||||||
auto device1 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 1u));
|
auto device1 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 1u));
|
||||||
|
|
||||||
CommandContainer cmdContainer0;
|
CommandContainer cmdContainer0;
|
||||||
cmdContainer0.initialize(device0.get(), nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer0.initialize(device0.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
CommandContainer cmdContainer1;
|
CommandContainer cmdContainer1;
|
||||||
cmdContainer1.initialize(device1.get(), nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer1.initialize(device1.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::dynamicState == heapType) {
|
if (!pDevice->getHardwareInfo().capabilityTable.supportsImages && HeapType::dynamicState == heapType) {
|
||||||
EXPECT_EQ(cmdContainer0.getIndirectHeap(heapType), nullptr);
|
EXPECT_EQ(cmdContainer0.getIndirectHeap(heapType), nullptr);
|
||||||
EXPECT_EQ(cmdContainer1.getIndirectHeap(heapType), nullptr);
|
EXPECT_EQ(cmdContainer1.getIndirectHeap(heapType), nullptr);
|
||||||
@@ -785,13 +785,13 @@ TEST_F(CommandContainerHeaps, givenCommandContainerForDifferentRootDevicesThenCm
|
|||||||
auto device1 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 1u));
|
auto device1 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 1u));
|
||||||
|
|
||||||
CommandContainer cmdContainer0;
|
CommandContainer cmdContainer0;
|
||||||
cmdContainer0.initialize(device0.get(), nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer0.initialize(device0.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(1u, cmdContainer0.getCmdBufferAllocations().size());
|
EXPECT_EQ(1u, cmdContainer0.getCmdBufferAllocations().size());
|
||||||
uint32_t cmdBufferAllocationIndex0 = cmdContainer0.getCmdBufferAllocations().front()->getRootDeviceIndex();
|
uint32_t cmdBufferAllocationIndex0 = cmdContainer0.getCmdBufferAllocations().front()->getRootDeviceIndex();
|
||||||
EXPECT_EQ(device0->getRootDeviceIndex(), cmdBufferAllocationIndex0);
|
EXPECT_EQ(device0->getRootDeviceIndex(), cmdBufferAllocationIndex0);
|
||||||
|
|
||||||
CommandContainer cmdContainer1;
|
CommandContainer cmdContainer1;
|
||||||
cmdContainer1.initialize(device1.get(), nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer1.initialize(device1.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(1u, cmdContainer1.getCmdBufferAllocations().size());
|
EXPECT_EQ(1u, cmdContainer1.getCmdBufferAllocations().size());
|
||||||
uint32_t cmdBufferAllocationIndex1 = cmdContainer1.getCmdBufferAllocations().front()->getRootDeviceIndex();
|
uint32_t cmdBufferAllocationIndex1 = cmdContainer1.getCmdBufferAllocations().front()->getRootDeviceIndex();
|
||||||
EXPECT_EQ(device1->getRootDeviceIndex(), cmdBufferAllocationIndex1);
|
EXPECT_EQ(device1->getRootDeviceIndex(), cmdBufferAllocationIndex1);
|
||||||
@@ -813,13 +813,13 @@ TEST_F(CommandContainerHeaps, givenCommandContainerForDifferentRootDevicesThenIn
|
|||||||
auto &gfxCoreHelper1 = device1->getGfxCoreHelper();
|
auto &gfxCoreHelper1 = device1->getGfxCoreHelper();
|
||||||
|
|
||||||
CommandContainer cmdContainer0;
|
CommandContainer cmdContainer0;
|
||||||
cmdContainer0.initialize(device0.get(), nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer0.initialize(device0.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
bool useLocalMemory0 = !gfxCoreHelper0.useSystemMemoryPlacementForISA(device0->getHardwareInfo());
|
bool useLocalMemory0 = !gfxCoreHelper0.useSystemMemoryPlacementForISA(device0->getHardwareInfo());
|
||||||
uint64_t baseAddressHeapDevice0 = device0->getMemoryManager()->getInternalHeapBaseAddress(device0->getRootDeviceIndex(), useLocalMemory0);
|
uint64_t baseAddressHeapDevice0 = device0->getMemoryManager()->getInternalHeapBaseAddress(device0->getRootDeviceIndex(), useLocalMemory0);
|
||||||
EXPECT_EQ(cmdContainer0.getInstructionHeapBaseAddress(), baseAddressHeapDevice0);
|
EXPECT_EQ(cmdContainer0.getInstructionHeapBaseAddress(), baseAddressHeapDevice0);
|
||||||
|
|
||||||
CommandContainer cmdContainer1;
|
CommandContainer cmdContainer1;
|
||||||
cmdContainer1.initialize(device1.get(), nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer1.initialize(device1.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
bool useLocalMemory1 = !gfxCoreHelper1.useSystemMemoryPlacementForISA(device0->getHardwareInfo());
|
bool useLocalMemory1 = !gfxCoreHelper1.useSystemMemoryPlacementForISA(device0->getHardwareInfo());
|
||||||
uint64_t baseAddressHeapDevice1 = device1->getMemoryManager()->getInternalHeapBaseAddress(device1->getRootDeviceIndex(), useLocalMemory1);
|
uint64_t baseAddressHeapDevice1 = device1->getMemoryManager()->getInternalHeapBaseAddress(device1->getRootDeviceIndex(), useLocalMemory1);
|
||||||
EXPECT_EQ(cmdContainer1.getInstructionHeapBaseAddress(), baseAddressHeapDevice1);
|
EXPECT_EQ(cmdContainer1.getInstructionHeapBaseAddress(), baseAddressHeapDevice1);
|
||||||
@@ -830,7 +830,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenDestructionThenNonHeapAllo
|
|||||||
MockGraphicsAllocation alloc;
|
MockGraphicsAllocation alloc;
|
||||||
size_t size = 0x1000;
|
size_t size = 0x1000;
|
||||||
alloc.setSize(size);
|
alloc.setSize(size);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->getDeallocationContainer().push_back(&alloc);
|
cmdContainer->getDeallocationContainer().push_back(&alloc);
|
||||||
cmdContainer.reset();
|
cmdContainer.reset();
|
||||||
EXPECT_EQ(alloc.getUnderlyingBufferSize(), size);
|
EXPECT_EQ(alloc.getUnderlyingBufferSize(), size);
|
||||||
@@ -838,7 +838,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenDestructionThenNonHeapAllo
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenContainerAllocatesNextCommandBufferWhenResettingContainerThenExpectFirstCommandBufferAllocationIsReused) {
|
TEST_F(CommandContainerTest, givenContainerAllocatesNextCommandBufferWhenResettingContainerThenExpectFirstCommandBufferAllocationIsReused) {
|
||||||
auto cmdContainer = std::make_unique<CommandContainer>();
|
auto cmdContainer = std::make_unique<CommandContainer>();
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
auto stream = cmdContainer->getCommandStream();
|
auto stream = cmdContainer->getCommandStream();
|
||||||
ASSERT_NE(nullptr, stream);
|
ASSERT_NE(nullptr, stream);
|
||||||
@@ -883,14 +883,14 @@ class MyLinearStreamMock : public LinearStream {
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenContainerIsInitializedThenStreamContainsContainerPtr) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenContainerIsInitializedThenStreamContainsContainerPtr) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
EXPECT_EQ(reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream())->cmdContainer, &cmdContainer);
|
EXPECT_EQ(reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream())->cmdContainer, &cmdContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenContainerIsInitializedThenStreamSizeEqualAlignedTotalCmdBuffSizeDecreasedOfReservedSize) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenContainerIsInitializedThenStreamSizeEqualAlignedTotalCmdBuffSizeDecreasedOfReservedSize) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
size_t alignedSize = alignUp<size_t>(CommandContainer::totalCmdBufferSize, MemoryConstants::pageSize64k);
|
size_t alignedSize = alignUp<size_t>(CommandContainer::totalCmdBufferSize, MemoryConstants::pageSize64k);
|
||||||
EXPECT_EQ(cmdContainer.getCommandStream()->getMaxAvailableSpace(), alignedSize - CommandContainer::cmdBufferReservedSize);
|
EXPECT_EQ(cmdContainer.getCommandStream()->getMaxAvailableSpace(), alignedSize - CommandContainer::cmdBufferReservedSize);
|
||||||
}
|
}
|
||||||
@@ -900,21 +900,21 @@ TEST_F(CommandContainerTest, GivenCmdContainerAndDebugFlagWhenContainerIsInitial
|
|||||||
|
|
||||||
debugManager.flags.OverrideCmdListCmdBufferSizeInKb.set(0);
|
debugManager.flags.OverrideCmdListCmdBufferSizeInKb.set(0);
|
||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
size_t alignedSize = alignUp<size_t>(cmdContainer.getAlignedCmdBufferSize(), MemoryConstants::pageSize64k);
|
size_t alignedSize = alignUp<size_t>(cmdContainer.getAlignedCmdBufferSize(), MemoryConstants::pageSize64k);
|
||||||
EXPECT_EQ(cmdContainer.getCommandStream()->getMaxAvailableSpace(), alignedSize - MyMockCommandContainer::cmdBufferReservedSize);
|
EXPECT_EQ(cmdContainer.getCommandStream()->getMaxAvailableSpace(), alignedSize - MyMockCommandContainer::cmdBufferReservedSize);
|
||||||
|
|
||||||
auto newSizeInKB = 512;
|
auto newSizeInKB = 512;
|
||||||
debugManager.flags.OverrideCmdListCmdBufferSizeInKb.set(newSizeInKB);
|
debugManager.flags.OverrideCmdListCmdBufferSizeInKb.set(newSizeInKB);
|
||||||
MyMockCommandContainer cmdContainer2;
|
MyMockCommandContainer cmdContainer2;
|
||||||
cmdContainer2.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer2.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
alignedSize = alignUp<size_t>(cmdContainer.getAlignedCmdBufferSize(), MemoryConstants::pageSize64k);
|
alignedSize = alignUp<size_t>(cmdContainer.getAlignedCmdBufferSize(), MemoryConstants::pageSize64k);
|
||||||
EXPECT_EQ(cmdContainer2.getCommandStream()->getMaxAvailableSpace(), alignedSize - MyMockCommandContainer::cmdBufferReservedSize);
|
EXPECT_EQ(cmdContainer2.getCommandStream()->getMaxAvailableSpace(), alignedSize - MyMockCommandContainer::cmdBufferReservedSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingNextCmdBufferThenStreamSizeEqualAlignedTotalCmdBuffSizeDecreasedOfReservedSize) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingNextCmdBufferThenStreamSizeEqualAlignedTotalCmdBuffSizeDecreasedOfReservedSize) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer.allocateNextCommandBuffer();
|
cmdContainer.allocateNextCommandBuffer();
|
||||||
size_t alignedSize = alignUp<size_t>(CommandContainer::totalCmdBufferSize, MemoryConstants::pageSize64k);
|
size_t alignedSize = alignUp<size_t>(CommandContainer::totalCmdBufferSize, MemoryConstants::pageSize64k);
|
||||||
EXPECT_EQ(cmdContainer.getCommandStream()->getMaxAvailableSpace(), alignedSize - CommandContainer::cmdBufferReservedSize);
|
EXPECT_EQ(cmdContainer.getCommandStream()->getMaxAvailableSpace(), alignedSize - CommandContainer::cmdBufferReservedSize);
|
||||||
@@ -922,7 +922,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingNextCmdBufferThenStr
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenCloseAndAllocateNextCommandBufferCalledThenBBEndPlacedAtEndOfLinearStream) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenCloseAndAllocateNextCommandBufferCalledThenBBEndPlacedAtEndOfLinearStream) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
||||||
auto ptr = cmdContainer.getCommandStream()->getSpace(0u);
|
auto ptr = cmdContainer.getCommandStream()->getSpace(0u);
|
||||||
cmdContainer.closeAndAllocateNextCommandBuffer();
|
cmdContainer.closeAndAllocateNextCommandBuffer();
|
||||||
@@ -931,7 +931,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenCloseAndAllocateNextCommandBuf
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenCloseAndAllocateNextCommandBufferCalledThenNewCmdBufferAllocationCreated) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenCloseAndAllocateNextCommandBufferCalledThenNewCmdBufferAllocationCreated) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u);
|
EXPECT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u);
|
||||||
cmdContainer.closeAndAllocateNextCommandBuffer();
|
cmdContainer.closeAndAllocateNextCommandBuffer();
|
||||||
EXPECT_EQ(cmdContainer.getCmdBufferAllocations().size(), 2u);
|
EXPECT_EQ(cmdContainer.getCmdBufferAllocations().size(), 2u);
|
||||||
@@ -939,7 +939,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenCloseAndAllocateNextCommandBuf
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenSetCmdBufferThenCmdBufferSetCorrectly) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenSetCmdBufferThenCmdBufferSetCorrectly) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
AllocationProperties properties{pDevice->getRootDeviceIndex(),
|
AllocationProperties properties{pDevice->getRootDeviceIndex(),
|
||||||
true /* allocateMemory*/,
|
true /* allocateMemory*/,
|
||||||
@@ -958,7 +958,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenSetCmdBufferThenCmdBufferSetCo
|
|||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithoutAnyAllocationInListThenReturnNullptr) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithoutAnyAllocationInListThenReturnNullptr) {
|
||||||
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
||||||
cmdContainer->setImmediateCmdListCsr(csr);
|
cmdContainer->setImmediateCmdListCsr(csr);
|
||||||
cmdContainer->immediateReusableAllocationList = std::make_unique<NEO::AllocationsList>();
|
cmdContainer->immediateReusableAllocationList = std::make_unique<NEO::AllocationsList>();
|
||||||
@@ -975,7 +975,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithAl
|
|||||||
*csr.tagAddress = 0u;
|
*csr.tagAddress = 0u;
|
||||||
|
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
cmdContainer->setImmediateCmdListCsr(&csr);
|
cmdContainer->setImmediateCmdListCsr(&csr);
|
||||||
cmdContainer->immediateReusableAllocationList = std::make_unique<NEO::AllocationsList>();
|
cmdContainer->immediateReusableAllocationList = std::make_unique<NEO::AllocationsList>();
|
||||||
|
|
||||||
@@ -996,7 +996,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithAl
|
|||||||
*csr.tagAddress = 10u;
|
*csr.tagAddress = 10u;
|
||||||
|
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
cmdContainer->setImmediateCmdListCsr(&csr);
|
cmdContainer->setImmediateCmdListCsr(&csr);
|
||||||
cmdContainer->immediateReusableAllocationList = std::make_unique<NEO::AllocationsList>();
|
cmdContainer->immediateReusableAllocationList = std::make_unique<NEO::AllocationsList>();
|
||||||
|
|
||||||
@@ -1013,7 +1013,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerWhenReuseExistingCmdBufferWithAl
|
|||||||
|
|
||||||
HWTEST_F(CommandContainerTest, GivenCmdContainerWhenContainerIsInitializedThenSurfaceStateIndirectHeapSizeIsCorrect) {
|
HWTEST_F(CommandContainerTest, GivenCmdContainerWhenContainerIsInitializedThenSurfaceStateIndirectHeapSizeIsCorrect) {
|
||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto size = cmdContainer.allocationIndirectHeaps[IndirectHeap::Type::surfaceState]->getUnderlyingBufferSize();
|
auto size = cmdContainer.allocationIndirectHeaps[IndirectHeap::Type::surfaceState]->getUnderlyingBufferSize();
|
||||||
constexpr size_t expectedHeapSize = MemoryConstants::pageSize64k;
|
constexpr size_t expectedHeapSize = MemoryConstants::pageSize64k;
|
||||||
EXPECT_EQ(expectedHeapSize, size);
|
EXPECT_EQ(expectedHeapSize, size);
|
||||||
@@ -1050,7 +1050,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerHasImmediateCsrWhenGettingHeapWi
|
|||||||
cmdContainer.immediateReusableAllocationList = std::make_unique<NEO::AllocationsList>();
|
cmdContainer.immediateReusableAllocationList = std::make_unique<NEO::AllocationsList>();
|
||||||
|
|
||||||
cmdContainer.setNumIddPerBlock(1);
|
cmdContainer.setNumIddPerBlock(1);
|
||||||
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
||||||
|
|
||||||
EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(HeapType::dynamicState));
|
EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(HeapType::dynamicState));
|
||||||
@@ -1226,7 +1226,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerUsedInRegularCmdListWhenGettingH
|
|||||||
HeapReserveArguments sshReserveArgs = {sshHeapPtr, 0, sshAlign};
|
HeapReserveArguments sshReserveArgs = {sshHeapPtr, 0, sshAlign};
|
||||||
HeapReserveArguments dshReserveArgs = {dshHeapPtr, 0, dshAlign};
|
HeapReserveArguments dshReserveArgs = {dshHeapPtr, 0, dshAlign};
|
||||||
|
|
||||||
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
||||||
|
|
||||||
cmdContainer.reserveSpaceForDispatch(sshReserveArgs, dshReserveArgs, true);
|
cmdContainer.reserveSpaceForDispatch(sshReserveArgs, dshReserveArgs, true);
|
||||||
@@ -1274,7 +1274,7 @@ HWTEST_F(CommandContainerTest, givenCmdContainerUsingPrivateHeapsWhenGettingRese
|
|||||||
HeapReserveArguments sshReserveArgs = {sshHeapPtr, 0, sshAlign};
|
HeapReserveArguments sshReserveArgs = {sshHeapPtr, 0, sshAlign};
|
||||||
HeapReserveArguments dshReserveArgs = {dshHeapPtr, 0, dshAlign};
|
HeapReserveArguments dshReserveArgs = {dshHeapPtr, 0, dshAlign};
|
||||||
|
|
||||||
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
||||||
|
|
||||||
constexpr size_t nonZeroSshSize = 4 * MemoryConstants::kiloByte;
|
constexpr size_t nonZeroSshSize = 4 * MemoryConstants::kiloByte;
|
||||||
@@ -1317,7 +1317,7 @@ HWTEST_F(CommandContainerTest,
|
|||||||
|
|
||||||
cmdContainer.setNumIddPerBlock(1);
|
cmdContainer.setNumIddPerBlock(1);
|
||||||
|
|
||||||
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
auto code = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, code);
|
||||||
|
|
||||||
constexpr size_t misalignedSize = 11;
|
constexpr size_t misalignedSize = 11;
|
||||||
@@ -1427,7 +1427,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsThe
|
|||||||
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
||||||
|
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setImmediateCmdListCsr(csr);
|
cmdContainer->setImmediateCmdListCsr(csr);
|
||||||
|
|
||||||
auto heapHelper = reinterpret_cast<MockHeapHelper *>(cmdContainer->getHeapHelper());
|
auto heapHelper = reinterpret_cast<MockHeapHelper *>(cmdContainer->getHeapHelper());
|
||||||
@@ -1462,7 +1462,7 @@ TEST_F(CommandContainerTest, givenCreateSecondaryCmdBufferInHostMemWhenFillReusa
|
|||||||
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
||||||
|
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, true);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true);
|
||||||
cmdContainer->setImmediateCmdListCsr(csr);
|
cmdContainer->setImmediateCmdListCsr(csr);
|
||||||
|
|
||||||
auto actualResidencyContainerSize = cmdContainer->getResidencyContainer().size();
|
auto actualResidencyContainerSize = cmdContainer->getResidencyContainer().size();
|
||||||
@@ -1491,7 +1491,7 @@ TEST_F(CommandContainerTest, givenSecondCmdContainerCreatedAfterFirstCmdContaine
|
|||||||
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
|
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, true);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true);
|
||||||
|
|
||||||
EXPECT_EQ(1u, cmdContainer->allocateCommandBufferCalled[0]); // forceHostMemory = 0
|
EXPECT_EQ(1u, cmdContainer->allocateCommandBufferCalled[0]); // forceHostMemory = 0
|
||||||
EXPECT_EQ(1u, cmdContainer->allocateCommandBufferCalled[1]); // forceHostMemory = 1
|
EXPECT_EQ(1u, cmdContainer->allocateCommandBufferCalled[1]); // forceHostMemory = 1
|
||||||
@@ -1501,7 +1501,7 @@ TEST_F(CommandContainerTest, givenSecondCmdContainerCreatedAfterFirstCmdContaine
|
|||||||
EXPECT_FALSE(allocList.peekIsEmpty());
|
EXPECT_FALSE(allocList.peekIsEmpty());
|
||||||
|
|
||||||
cmdContainer = std::make_unique<MyMockCommandContainer>();
|
cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, true);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true);
|
||||||
|
|
||||||
EXPECT_EQ(0u, cmdContainer->allocateCommandBufferCalled[0]); // forceHostMemory = 0
|
EXPECT_EQ(0u, cmdContainer->allocateCommandBufferCalled[0]); // forceHostMemory = 0
|
||||||
EXPECT_EQ(0u, cmdContainer->allocateCommandBufferCalled[1]); // forceHostMemory = 1
|
EXPECT_EQ(0u, cmdContainer->allocateCommandBufferCalled[1]); // forceHostMemory = 1
|
||||||
@@ -1512,7 +1512,7 @@ TEST_F(CommandContainerTest, givenSecondCmdContainerCreatedAfterFirstCmdContaine
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenAllocateCommandBufferInHostMemoryCalledThenForceSystemMemoryFlagSetInAllocationStorageInfo) {
|
TEST_F(CommandContainerTest, givenAllocateCommandBufferInHostMemoryCalledThenForceSystemMemoryFlagSetInAllocationStorageInfo) {
|
||||||
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, true);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, true);
|
||||||
|
|
||||||
auto commandBufferAllocation = cmdContainer->allocateCommandBuffer(true /*forceHostMemory*/);
|
auto commandBufferAllocation = cmdContainer->allocateCommandBuffer(true /*forceHostMemory*/);
|
||||||
EXPECT_TRUE(commandBufferAllocation->storageInfo.systemMemoryForced);
|
EXPECT_TRUE(commandBufferAllocation->storageInfo.systemMemoryForced);
|
||||||
@@ -1528,7 +1528,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsWit
|
|||||||
|
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->enableHeapSharing();
|
cmdContainer->enableHeapSharing();
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setImmediateCmdListCsr(csr);
|
cmdContainer->setImmediateCmdListCsr(csr);
|
||||||
|
|
||||||
auto &reusableHeapsList = reinterpret_cast<MockHeapHelper *>(cmdContainer->getHeapHelper())->storageForReuse->getAllocationsForReuse();
|
auto &reusableHeapsList = reinterpret_cast<MockHeapHelper *>(cmdContainer->getHeapHelper())->storageForReuse->getAllocationsForReuse();
|
||||||
@@ -1555,7 +1555,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsWit
|
|||||||
|
|
||||||
auto cmdContainer = std::make_unique<CommandContainer>();
|
auto cmdContainer = std::make_unique<CommandContainer>();
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setImmediateCmdListCsr(csr);
|
cmdContainer->setImmediateCmdListCsr(csr);
|
||||||
|
|
||||||
auto &reusableHeapsList = reinterpret_cast<MockHeapHelper *>(cmdContainer->getHeapHelper())->storageForReuse->getAllocationsForReuse();
|
auto &reusableHeapsList = reinterpret_cast<MockHeapHelper *>(cmdContainer->getHeapHelper())->storageForReuse->getAllocationsForReuse();
|
||||||
@@ -1576,7 +1576,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsWit
|
|||||||
debugManager.flags.SetAmountOfReusableAllocations.set(1);
|
debugManager.flags.SetAmountOfReusableAllocations.set(1);
|
||||||
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
|
|
||||||
EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr);
|
EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr);
|
||||||
cmdContainer->fillReusableAllocationLists();
|
cmdContainer->fillReusableAllocationLists();
|
||||||
@@ -1591,7 +1591,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsAnd
|
|||||||
debugManager.flags.SetAmountOfReusableAllocations.set(1);
|
debugManager.flags.SetAmountOfReusableAllocations.set(1);
|
||||||
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
|
|
||||||
EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr);
|
EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr);
|
||||||
EXPECT_TRUE(allocList.peekIsEmpty());
|
EXPECT_TRUE(allocList.peekIsEmpty());
|
||||||
@@ -1612,7 +1612,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWithoutGlobalListWhenFillReusableA
|
|||||||
DebugManagerStateRestore dbgRestore;
|
DebugManagerStateRestore dbgRestore;
|
||||||
debugManager.flags.SetAmountOfReusableAllocations.set(1);
|
debugManager.flags.SetAmountOfReusableAllocations.set(1);
|
||||||
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
|
|
||||||
EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr);
|
EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr);
|
||||||
cmdContainer->fillReusableAllocationLists();
|
cmdContainer->fillReusableAllocationLists();
|
||||||
@@ -1630,7 +1630,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsWit
|
|||||||
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
cmdContainer->setImmediateCmdListCsr(csr);
|
cmdContainer->setImmediateCmdListCsr(csr);
|
||||||
|
|
||||||
EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr);
|
EXPECT_EQ(cmdContainer->immediateReusableAllocationList, nullptr);
|
||||||
@@ -1647,7 +1647,7 @@ TEST_F(CommandContainerTest, givenCmdContainerAndCsrWhenGetHeapWithRequiredSizeA
|
|||||||
auto cmdContainer = std::make_unique<CommandContainer>();
|
auto cmdContainer = std::make_unique<CommandContainer>();
|
||||||
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setImmediateCmdListCsr(csr);
|
cmdContainer->setImmediateCmdListCsr(csr);
|
||||||
|
|
||||||
cmdContainer->fillReusableAllocationLists();
|
cmdContainer->fillReusableAllocationLists();
|
||||||
@@ -1671,7 +1671,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenFillReusableAllocationListsAnd
|
|||||||
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
auto csr = pDevice->getDefaultEngine().commandStreamReceiver;
|
||||||
AllocationsList allocList;
|
AllocationsList allocList;
|
||||||
cmdContainer->initialize(pDevice, &allocList, HeapSize::defaultHeapSize, false, false);
|
cmdContainer->initialize(pDevice, &allocList, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
cmdContainer->setImmediateCmdListCsr(csr);
|
cmdContainer->setImmediateCmdListCsr(csr);
|
||||||
|
|
||||||
cmdContainer->fillReusableAllocationLists();
|
cmdContainer->fillReusableAllocationLists();
|
||||||
@@ -1695,7 +1695,7 @@ TEST_F(CommandContainerHeapStateTests, givenCmdContainerWhenSettingHeapAddressMo
|
|||||||
TEST_F(CommandContainerTest, givenGlobalHeapModelSelectedWhenCmdContainerIsInitializedThenNoSurfaceAndDynamicHeapCreated) {
|
TEST_F(CommandContainerTest, givenGlobalHeapModelSelectedWhenCmdContainerIsInitializedThenNoSurfaceAndDynamicHeapCreated) {
|
||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
cmdContainer.setHeapAddressModel(HeapAddressModel::globalStateless);
|
cmdContainer.setHeapAddressModel(HeapAddressModel::globalStateless);
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(NEO::HeapType::surfaceState));
|
EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(NEO::HeapType::surfaceState));
|
||||||
EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(NEO::HeapType::dynamicState));
|
EXPECT_EQ(nullptr, cmdContainer.getIndirectHeap(NEO::HeapType::dynamicState));
|
||||||
@@ -1703,7 +1703,7 @@ TEST_F(CommandContainerTest, givenGlobalHeapModelSelectedWhenCmdContainerIsIniti
|
|||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerAllocatesIndirectHeapWhenGettingMemoryPlacementThenFlagMatchesGraphicsAllocationPlacement) {
|
TEST_F(CommandContainerTest, givenCmdContainerAllocatesIndirectHeapWhenGettingMemoryPlacementThenFlagMatchesGraphicsAllocationPlacement) {
|
||||||
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
EXPECT_EQ(cmdContainer->isIndirectHeapInLocalMemory(), cmdContainer->getIndirectHeap(NEO::HeapType::indirectObject)->getGraphicsAllocation()->isAllocatedInLocalMemoryPool());
|
EXPECT_EQ(cmdContainer->isIndirectHeapInLocalMemory(), cmdContainer->getIndirectHeap(NEO::HeapType::indirectObject)->getGraphicsAllocation()->isAllocatedInLocalMemoryPool());
|
||||||
}
|
}
|
||||||
@@ -1713,7 +1713,7 @@ TEST_F(CommandContainerTest, givenCmdContainerSetToSbaTrackingWhenStateHeapsCons
|
|||||||
|
|
||||||
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
auto cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
cmdContainer->setStateBaseAddressTracking(true);
|
cmdContainer->setStateBaseAddressTracking(true);
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
NEO::IndirectHeap *ioh = cmdContainer->getIndirectHeap(NEO::HeapType::indirectObject);
|
NEO::IndirectHeap *ioh = cmdContainer->getIndirectHeap(NEO::HeapType::indirectObject);
|
||||||
ioh->getSpace(64);
|
ioh->getSpace(64);
|
||||||
@@ -1739,7 +1739,7 @@ TEST_F(CommandContainerTest, givenCmdContainerSetToSbaTrackingWhenStateHeapsCons
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerSetToSbaTrackingWhenContainerIsInitializedThenSurfaceHeapDefaultValueIsUsed) {
|
TEST_F(CommandContainerTest, givenCmdContainerSetToSbaTrackingWhenContainerIsInitializedThenSurfaceHeapDefaultValueIsUsed) {
|
||||||
constexpr size_t sshDefaultSize = 2 * HeapSize::defaultHeapSize;
|
const size_t sshDefaultSize = 2 * HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState);
|
||||||
auto &productHelper = pDevice->getProductHelper();
|
auto &productHelper = pDevice->getProductHelper();
|
||||||
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
||||||
auto expectedSshSize = gfxCoreHelper.getDefaultSshSize(productHelper);
|
auto expectedSshSize = gfxCoreHelper.getDefaultSshSize(productHelper);
|
||||||
@@ -1751,7 +1751,7 @@ TEST_F(CommandContainerTest, givenCmdContainerSetToSbaTrackingWhenContainerIsIni
|
|||||||
cmdContainer = std::make_unique<MyMockCommandContainer>();
|
cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
cmdContainer->setStateBaseAddressTracking(true);
|
cmdContainer->setStateBaseAddressTracking(true);
|
||||||
cmdContainer->initialize(pDevice, nullptr, sshDefaultSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, sshDefaultSize, true, false);
|
||||||
EXPECT_EQ(2 * HeapSize::defaultHeapSize, cmdContainer->defaultSshSize);
|
EXPECT_EQ(2 * HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), cmdContainer->defaultSshSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST_F(CommandContainerTest,
|
HWTEST_F(CommandContainerTest,
|
||||||
@@ -1761,7 +1761,7 @@ HWTEST_F(CommandContainerTest,
|
|||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.setUsingPrimaryBuffer(true);
|
cmdContainer.setUsingPrimaryBuffer(true);
|
||||||
EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer());
|
EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer());
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u);
|
ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u);
|
||||||
auto firstCmdBufferAllocation = cmdContainer.getCmdBufferAllocations()[0];
|
auto firstCmdBufferAllocation = cmdContainer.getCmdBufferAllocations()[0];
|
||||||
@@ -1796,7 +1796,7 @@ HWTEST_F(CommandContainerTest,
|
|||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.setUsingPrimaryBuffer(true);
|
cmdContainer.setUsingPrimaryBuffer(true);
|
||||||
EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer());
|
EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer());
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u);
|
ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u);
|
||||||
auto firstCmdBufferAllocation = cmdContainer.getCmdBufferAllocations()[0];
|
auto firstCmdBufferAllocation = cmdContainer.getCmdBufferAllocations()[0];
|
||||||
@@ -1851,7 +1851,7 @@ HWTEST_F(CommandContainerTest,
|
|||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.setUsingPrimaryBuffer(true);
|
cmdContainer.setUsingPrimaryBuffer(true);
|
||||||
EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer());
|
EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer());
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u);
|
ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u);
|
||||||
auto firstCmdBufferAllocation = cmdContainer.getCmdBufferAllocations()[0];
|
auto firstCmdBufferAllocation = cmdContainer.getCmdBufferAllocations()[0];
|
||||||
@@ -1886,7 +1886,7 @@ HWTEST_F(CommandContainerTest,
|
|||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.setUsingPrimaryBuffer(true);
|
cmdContainer.setUsingPrimaryBuffer(true);
|
||||||
EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer());
|
EXPECT_TRUE(cmdContainer.isUsingPrimaryBuffer());
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u);
|
ASSERT_EQ(cmdContainer.getCmdBufferAllocations().size(), 1u);
|
||||||
|
|
||||||
size_t consumedSize = 28;
|
size_t consumedSize = 28;
|
||||||
@@ -1927,7 +1927,7 @@ HWTEST_F(CommandContainerTest,
|
|||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenImmediateCmdListCsrIsSetThenCommandStreamHasCmdContainerSetToNullptr) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenImmediateCmdListCsrIsSetThenCommandStreamHasCmdContainerSetToNullptr) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.setImmediateCmdListCsr(pDevice->getDefaultEngine().commandStreamReceiver);
|
cmdContainer.setImmediateCmdListCsr(pDevice->getDefaultEngine().commandStreamReceiver);
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
EXPECT_EQ(cmdContainer.getCommandStream()->getCmdContainer(), nullptr);
|
EXPECT_EQ(cmdContainer.getCommandStream()->getCmdContainer(), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1935,7 +1935,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWithImmediateCsrWhenCreatingSecond
|
|||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
cmdContainer.setImmediateCmdListCsr(pDevice->getDefaultEngine().commandStreamReceiver);
|
cmdContainer.setImmediateCmdListCsr(pDevice->getDefaultEngine().commandStreamReceiver);
|
||||||
constexpr bool createSecondary = true;
|
constexpr bool createSecondary = true;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, createSecondary);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, createSecondary);
|
||||||
ASSERT_NE(nullptr, cmdContainer.secondaryCommandStreamForImmediateCmdList.get());
|
ASSERT_NE(nullptr, cmdContainer.secondaryCommandStreamForImmediateCmdList.get());
|
||||||
EXPECT_EQ(cmdContainer.secondaryCommandStreamForImmediateCmdList->getCmdContainer(), nullptr);
|
EXPECT_EQ(cmdContainer.secondaryCommandStreamForImmediateCmdList->getCmdContainer(), nullptr);
|
||||||
}
|
}
|
||||||
@@ -1943,7 +1943,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWithImmediateCsrWhenCreatingSecond
|
|||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenOldHeapIsStoredAndResetContainerThenUseStorageForReuseForStoredHeap) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenOldHeapIsStoredAndResetContainerThenUseStorageForReuseForStoredHeap) {
|
||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
|
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||||
auto &deallocationList = cmdContainer.getDeallocationContainer();
|
auto &deallocationList = cmdContainer.getDeallocationContainer();
|
||||||
|
|
||||||
@@ -1994,7 +1994,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenOldHeapIsStoredAndResetContain
|
|||||||
TEST_F(CommandContainerTest, givenCmdContainerWhenNonHeapIsStoredAndResetContainerThenNonHeapAllocationIsNotStoredForReuse) {
|
TEST_F(CommandContainerTest, givenCmdContainerWhenNonHeapIsStoredAndResetContainerThenNonHeapAllocationIsNotStoredForReuse) {
|
||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
|
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||||
auto &deallocationList = cmdContainer.getDeallocationContainer();
|
auto &deallocationList = cmdContainer.getDeallocationContainer();
|
||||||
EXPECT_EQ(0u, deallocationList.size());
|
EXPECT_EQ(0u, deallocationList.size());
|
||||||
@@ -2017,7 +2017,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenNonHeapIsStoredAndResetContain
|
|||||||
TEST_F(CommandContainerTest, givenHeaplessCmdContainerWhenResetContainerThenNoHeapInStorageForReuse) {
|
TEST_F(CommandContainerTest, givenHeaplessCmdContainerWhenResetContainerThenNoHeapInStorageForReuse) {
|
||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
|
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false);
|
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||||
auto &deallocationList = cmdContainer.getDeallocationContainer();
|
auto &deallocationList = cmdContainer.getDeallocationContainer();
|
||||||
|
|
||||||
@@ -2030,7 +2030,7 @@ TEST_F(CommandContainerTest, givenHeaplessCmdContainerWhenResetContainerThenNoHe
|
|||||||
TEST_F(CommandContainerTest, givenInitializedContainerWhenSearchedAddressIsWithinCommandStreamThenReturnCommandStreamCpuBase) {
|
TEST_F(CommandContainerTest, givenInitializedContainerWhenSearchedAddressIsWithinCommandStreamThenReturnCommandStreamCpuBase) {
|
||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
|
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false);
|
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||||
|
|
||||||
void *cmdBuffer = ptrOffset(cmdContainer.getCommandStream()->getCpuBase(), 0x100);
|
void *cmdBuffer = ptrOffset(cmdContainer.getCommandStream()->getCpuBase(), 0x100);
|
||||||
@@ -2041,7 +2041,7 @@ TEST_F(CommandContainerTest, givenInitializedContainerWhenSearchedAddressIsWithi
|
|||||||
TEST_F(CommandContainerTest, givenInitializedContainerWithTwoCommandBuffersWhenSearchedAddressIsWithinOldCommandBufferThenReturnOldCommandBufferCpuBase) {
|
TEST_F(CommandContainerTest, givenInitializedContainerWithTwoCommandBuffersWhenSearchedAddressIsWithinOldCommandBufferThenReturnOldCommandBufferCpuBase) {
|
||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
|
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false);
|
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||||
|
|
||||||
void *expectedCpuBase = cmdContainer.getCommandStream()->getCpuBase();
|
void *expectedCpuBase = cmdContainer.getCommandStream()->getCpuBase();
|
||||||
@@ -2056,7 +2056,7 @@ TEST_F(CommandContainerTest, givenInitializedContainerWithTwoCommandBuffersWhenS
|
|||||||
TEST_F(CommandContainerTest, givenInitializedContainerWhenSearchedAddressIsOutsideCommandStreamThenReturnNullptr) {
|
TEST_F(CommandContainerTest, givenInitializedContainerWhenSearchedAddressIsOutsideCommandStreamThenReturnNullptr) {
|
||||||
MyMockCommandContainer cmdContainer;
|
MyMockCommandContainer cmdContainer;
|
||||||
|
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, false, false);
|
auto status = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), false, false);
|
||||||
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::success, status);
|
||||||
cmdContainer.allocateNextCommandBuffer();
|
cmdContainer.allocateNextCommandBuffer();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2023 Intel Corporation
|
* Copyright (C) 2018-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -162,7 +162,7 @@ TEST_F(LinearStreamTest, givenLinearStreamWithoutCmdContainerWhenOneByteLeftInSt
|
|||||||
using CommandContainerLinearStreamTest = Test<DeviceFixture>;
|
using CommandContainerLinearStreamTest = Test<DeviceFixture>;
|
||||||
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenOneByteLeftInStreamThenGetSpaceThrowAbort) {
|
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenOneByteLeftInStreamThenGetSpaceThrowAbort) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
||||||
stream->sizeUsed = stream->getMaxAvailableSpace() - 1;
|
stream->sizeUsed = stream->getMaxAvailableSpace() - 1;
|
||||||
EXPECT_THROW(stream->getSpace(1), std::exception);
|
EXPECT_THROW(stream->getSpace(1), std::exception);
|
||||||
@@ -170,7 +170,7 @@ TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenOn
|
|||||||
|
|
||||||
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenNewCmdBufferAllocated) {
|
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenNewCmdBufferAllocated) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
||||||
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
||||||
size_t dummyCommandSize = 2;
|
size_t dummyCommandSize = 2;
|
||||||
@@ -182,7 +182,7 @@ TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenTh
|
|||||||
|
|
||||||
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenLinearStreamHasNewAllocation) {
|
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenLinearStreamHasNewAllocation) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
||||||
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
||||||
size_t dummyCommandSize = 2;
|
size_t dummyCommandSize = 2;
|
||||||
@@ -195,7 +195,7 @@ TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenTh
|
|||||||
|
|
||||||
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenGetSpaceReturnPtrFromNewAllocation) {
|
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenGetSpaceReturnPtrFromNewAllocation) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
||||||
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
||||||
size_t dummyCommandSize = 2;
|
size_t dummyCommandSize = 2;
|
||||||
@@ -207,7 +207,7 @@ TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenTh
|
|||||||
|
|
||||||
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsSpaceForCommandAndBBEndThenNewCmdBufferIsNotAllocated) {
|
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsSpaceForCommandAndBBEndThenNewCmdBufferIsNotAllocated) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
||||||
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
||||||
size_t dummyCommandSize = 2;
|
size_t dummyCommandSize = 2;
|
||||||
@@ -219,7 +219,7 @@ TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenTh
|
|||||||
|
|
||||||
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenBBEndAddedAtEndOfStream) {
|
TEST_F(CommandContainerLinearStreamTest, givenLinearStreamWithCmdContainerWhenThereIsNoSpaceForCommandAndBBEndThenBBEndAddedAtEndOfStream) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
|
||||||
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
auto stream = reinterpret_cast<MyLinearStreamMock *>(cmdContainer.getCommandStream());
|
||||||
size_t dummyCommandSize = 2;
|
size_t dummyCommandSize = 2;
|
||||||
|
|||||||
@@ -605,7 +605,7 @@ HWTEST2_P(L0DebuggerSimpleParameterizedTest, givenNotChangedSurfaceStateWhenCapt
|
|||||||
debugger->sbaTrackingGpuVa.address = 0x45670000;
|
debugger->sbaTrackingGpuVa.address = 0x45670000;
|
||||||
|
|
||||||
NEO::CommandContainer container;
|
NEO::CommandContainer container;
|
||||||
container.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
container.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
NEO::Debugger::SbaAddresses sba = {};
|
NEO::Debugger::SbaAddresses sba = {};
|
||||||
sba.surfaceStateBaseAddress = 0x123456000;
|
sba.surfaceStateBaseAddress = 0x123456000;
|
||||||
@@ -629,7 +629,7 @@ HWTEST2_P(L0DebuggerSimpleParameterizedTest, givenChangedBaseAddressesWhenCaptur
|
|||||||
debugger->sbaTrackingGpuVa.address = 0x45670000;
|
debugger->sbaTrackingGpuVa.address = 0x45670000;
|
||||||
{
|
{
|
||||||
NEO::CommandContainer container;
|
NEO::CommandContainer container;
|
||||||
container.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
container.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
NEO::Debugger::SbaAddresses sba = {};
|
NEO::Debugger::SbaAddresses sba = {};
|
||||||
sba.surfaceStateBaseAddress = 0x123456000;
|
sba.surfaceStateBaseAddress = 0x123456000;
|
||||||
@@ -642,7 +642,7 @@ HWTEST2_P(L0DebuggerSimpleParameterizedTest, givenChangedBaseAddressesWhenCaptur
|
|||||||
|
|
||||||
{
|
{
|
||||||
NEO::CommandContainer container;
|
NEO::CommandContainer container;
|
||||||
container.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
container.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
NEO::Debugger::SbaAddresses sba = {};
|
NEO::Debugger::SbaAddresses sba = {};
|
||||||
sba.generalStateBaseAddress = 0x123456000;
|
sba.generalStateBaseAddress = 0x123456000;
|
||||||
@@ -655,7 +655,7 @@ HWTEST2_P(L0DebuggerSimpleParameterizedTest, givenChangedBaseAddressesWhenCaptur
|
|||||||
|
|
||||||
{
|
{
|
||||||
NEO::CommandContainer container;
|
NEO::CommandContainer container;
|
||||||
container.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
container.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
NEO::Debugger::SbaAddresses sba = {};
|
NEO::Debugger::SbaAddresses sba = {};
|
||||||
sba.bindlessSurfaceStateBaseAddress = 0x123456000;
|
sba.bindlessSurfaceStateBaseAddress = 0x123456000;
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterCommandEncoderTest, givenOffsetAndValue
|
|||||||
|
|
||||||
GenCmdList commands;
|
GenCmdList commands;
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
constexpr uint32_t regOffset = 0x2000u;
|
constexpr uint32_t regOffset = 0x2000u;
|
||||||
constexpr uint32_t immVal = 0xbaau;
|
constexpr uint32_t immVal = 0xbaau;
|
||||||
constexpr uint64_t dstAddress = 0xDEADCAF0u;
|
constexpr uint64_t dstAddress = 0xDEADCAF0u;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2020-2023 Intel Corporation
|
* Copyright (C) 2020-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -19,7 +19,7 @@ using EncodeBatchBufferStartOrEndTest = Test<DeviceFixture>;
|
|||||||
|
|
||||||
HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBEndThenCommandIsAdded) {
|
HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBEndThenCommandIsAdded) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EncodeBatchBufferStartOrEnd<FamilyType>::programBatchBufferEnd(cmdContainer);
|
EncodeBatchBufferStartOrEnd<FamilyType>::programBatchBufferEnd(cmdContainer);
|
||||||
|
|
||||||
GenCmdList commands;
|
GenCmdList commands;
|
||||||
@@ -32,7 +32,7 @@ HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBEndTh
|
|||||||
|
|
||||||
HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStartThenCommandIsAdded) {
|
HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStartThenCommandIsAdded) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EncodeBatchBufferStartOrEnd<FamilyType>::programBatchBufferStart(cmdContainer.getCommandStream(), 0, true, false, false);
|
EncodeBatchBufferStartOrEnd<FamilyType>::programBatchBufferStart(cmdContainer.getCommandStream(), 0, true, false, false);
|
||||||
|
|
||||||
GenCmdList commands;
|
GenCmdList commands;
|
||||||
@@ -45,7 +45,7 @@ HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStart
|
|||||||
|
|
||||||
HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStartWithSecondLevelParameterThenCommandIsProgrammedCorrectly) {
|
HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStartWithSecondLevelParameterThenCommandIsProgrammedCorrectly) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EncodeBatchBufferStartOrEnd<FamilyType>::programBatchBufferStart(cmdContainer.getCommandStream(), 0, true, false, false);
|
EncodeBatchBufferStartOrEnd<FamilyType>::programBatchBufferStart(cmdContainer.getCommandStream(), 0, true, false, false);
|
||||||
|
|
||||||
GenCmdList commands;
|
GenCmdList commands;
|
||||||
@@ -62,7 +62,7 @@ HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStart
|
|||||||
|
|
||||||
HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStartWithFirstLevelParameterThenCommandIsProgrammedCorrectly) {
|
HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStartWithFirstLevelParameterThenCommandIsProgrammedCorrectly) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EncodeBatchBufferStartOrEnd<FamilyType>::programBatchBufferStart(cmdContainer.getCommandStream(), 0, false, false, false);
|
EncodeBatchBufferStartOrEnd<FamilyType>::programBatchBufferStart(cmdContainer.getCommandStream(), 0, false, false, false);
|
||||||
|
|
||||||
GenCmdList commands;
|
GenCmdList commands;
|
||||||
@@ -79,7 +79,7 @@ HWTEST_F(EncodeBatchBufferStartOrEndTest, givenCommandContainerWhenEncodeBBStart
|
|||||||
|
|
||||||
HWTEST_F(EncodeBatchBufferStartOrEndTest, givenGpuAddressWhenEncodeBBStartThenAddressIsProgrammedCorrectly) {
|
HWTEST_F(EncodeBatchBufferStartOrEndTest, givenGpuAddressWhenEncodeBBStartThenAddressIsProgrammedCorrectly) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
uint64_t gpuAddress = 12 * MemoryConstants::pageSize;
|
uint64_t gpuAddress = 12 * MemoryConstants::pageSize;
|
||||||
EncodeBatchBufferStartOrEnd<FamilyType>::programBatchBufferStart(cmdContainer.getCommandStream(), gpuAddress, false, false, false);
|
EncodeBatchBufferStartOrEnd<FamilyType>::programBatchBufferStart(cmdContainer.getCommandStream(), gpuAddress, false, false, false);
|
||||||
@@ -100,7 +100,7 @@ using EncodeNoopTest = Test<DeviceFixture>;
|
|||||||
|
|
||||||
HWTEST_F(EncodeNoopTest, WhenAligningLinearStreamToCacheLineSizeThenItIsAlignedCorrectly) {
|
HWTEST_F(EncodeNoopTest, WhenAligningLinearStreamToCacheLineSizeThenItIsAlignedCorrectly) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto commandStream = cmdContainer.getCommandStream();
|
auto commandStream = cmdContainer.getCommandStream();
|
||||||
|
|
||||||
EncodeNoop<FamilyType>::alignToCacheLine(*commandStream);
|
EncodeNoop<FamilyType>::alignToCacheLine(*commandStream);
|
||||||
@@ -113,7 +113,7 @@ HWTEST_F(EncodeNoopTest, WhenAligningLinearStreamToCacheLineSizeThenItIsAlignedC
|
|||||||
|
|
||||||
HWTEST_F(EncodeNoopTest, WhenEmittingNoopsThenExpectCorrectNumberOfBytesNooped) {
|
HWTEST_F(EncodeNoopTest, WhenEmittingNoopsThenExpectCorrectNumberOfBytesNooped) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
auto commandStream = cmdContainer.getCommandStream();
|
auto commandStream = cmdContainer.getCommandStream();
|
||||||
|
|
||||||
size_t usedBefore = commandStream->getUsed();
|
size_t usedBefore = commandStream->getUsed();
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchMod
|
|||||||
{
|
{
|
||||||
debugManager.flags.ForceBtpPrefetchMode.set(-1);
|
debugManager.flags.ForceBtpPrefetchMode.set(-1);
|
||||||
cmdContainer.reset(new MyMockCommandContainer());
|
cmdContainer.reset(new MyMockCommandContainer());
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
||||||
|
|
||||||
bool requiresUncachedMocs = false;
|
bool requiresUncachedMocs = false;
|
||||||
@@ -576,7 +576,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchMod
|
|||||||
{
|
{
|
||||||
debugManager.flags.ForceBtpPrefetchMode.set(0);
|
debugManager.flags.ForceBtpPrefetchMode.set(0);
|
||||||
cmdContainer.reset(new MyMockCommandContainer());
|
cmdContainer.reset(new MyMockCommandContainer());
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
||||||
|
|
||||||
bool requiresUncachedMocs = false;
|
bool requiresUncachedMocs = false;
|
||||||
@@ -604,7 +604,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchMod
|
|||||||
{
|
{
|
||||||
debugManager.flags.ForceBtpPrefetchMode.set(1);
|
debugManager.flags.ForceBtpPrefetchMode.set(1);
|
||||||
cmdContainer.reset(new MyMockCommandContainer());
|
cmdContainer.reset(new MyMockCommandContainer());
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
||||||
|
|
||||||
bool requiresUncachedMocs = false;
|
bool requiresUncachedMocs = false;
|
||||||
@@ -1428,7 +1428,7 @@ HWTEST_F(BindlessCommandEncodeStatesContainerTest, givenBindlessKernelAndBindles
|
|||||||
pDevice->getNumGenericSubDevices() > 1);
|
pDevice->getNumGenericSubDevices() > 1);
|
||||||
|
|
||||||
auto commandContainer = std::make_unique<CommandContainer>();
|
auto commandContainer = std::make_unique<CommandContainer>();
|
||||||
commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
commandContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
commandContainer->setDirtyStateForAllHeaps(false);
|
commandContainer->setDirtyStateForAllHeaps(false);
|
||||||
commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
||||||
|
|
||||||
@@ -1455,7 +1455,7 @@ HWTEST2_F(BindlessCommandEncodeStatesContainerTest, givenBindfulKernelWhenBindle
|
|||||||
DebugManagerStateRestore dbgRestorer;
|
DebugManagerStateRestore dbgRestorer;
|
||||||
debugManager.flags.UseBindlessMode.set(1);
|
debugManager.flags.UseBindlessMode.set(1);
|
||||||
auto commandContainer = std::make_unique<CommandContainer>();
|
auto commandContainer = std::make_unique<CommandContainer>();
|
||||||
commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
commandContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
commandContainer->setDirtyStateForAllHeaps(false);
|
commandContainer->setDirtyStateForAllHeaps(false);
|
||||||
commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
||||||
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice,
|
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(pDevice,
|
||||||
@@ -1490,7 +1490,7 @@ HWTEST2_F(NgenGeneratorDispatchKernelEncodeTest, givenBindfulKernelAndIsNotGener
|
|||||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||||
for (auto isGeneratedByIgc : {false, true}) {
|
for (auto isGeneratedByIgc : {false, true}) {
|
||||||
auto commandContainer = std::make_unique<MyMockCommandContainer>();
|
auto commandContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
commandContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
commandContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
commandContainer->setDirtyStateForAllHeaps(false);
|
commandContainer->setDirtyStateForAllHeaps(false);
|
||||||
commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
commandContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
||||||
|
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenForceBtpPrefetchModeDebugFlagWhenDispatc
|
|||||||
{
|
{
|
||||||
debugManager.flags.ForceBtpPrefetchMode.set(-1);
|
debugManager.flags.ForceBtpPrefetchMode.set(-1);
|
||||||
cmdContainer.reset(new MyMockCommandContainer());
|
cmdContainer.reset(new MyMockCommandContainer());
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
||||||
|
|
||||||
bool requiresUncachedMocs = false;
|
bool requiresUncachedMocs = false;
|
||||||
@@ -519,7 +519,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenForceBtpPrefetchModeDebugFlagWhenDispatc
|
|||||||
{
|
{
|
||||||
debugManager.flags.ForceBtpPrefetchMode.set(0);
|
debugManager.flags.ForceBtpPrefetchMode.set(0);
|
||||||
cmdContainer.reset(new MyMockCommandContainer());
|
cmdContainer.reset(new MyMockCommandContainer());
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
||||||
|
|
||||||
bool requiresUncachedMocs = false;
|
bool requiresUncachedMocs = false;
|
||||||
@@ -544,7 +544,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenForceBtpPrefetchModeDebugFlagWhenDispatc
|
|||||||
{
|
{
|
||||||
debugManager.flags.ForceBtpPrefetchMode.set(1);
|
debugManager.flags.ForceBtpPrefetchMode.set(1);
|
||||||
cmdContainer.reset(new MyMockCommandContainer());
|
cmdContainer.reset(new MyMockCommandContainer());
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
cmdContainer->l1CachePolicyDataRef() = &l1CachePolicyData;
|
||||||
|
|
||||||
bool requiresUncachedMocs = false;
|
bool requiresUncachedMocs = false;
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ HWTEST_F(CommandEncoderMathTest, WhenReservingCommandThenBitfieldSetCorrectly) {
|
|||||||
GenCmdList commands;
|
GenCmdList commands;
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
|
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
EncodeMath<FamilyType>::commandReserve(cmdContainer);
|
EncodeMath<FamilyType>::commandReserve(cmdContainer);
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ HWTEST_F(CommandEncoderMathTest, givenOffsetAndValueWhenEncodeBitwiseAndValIsCal
|
|||||||
|
|
||||||
GenCmdList commands;
|
GenCmdList commands;
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
constexpr uint32_t regOffset = 0x2000u;
|
constexpr uint32_t regOffset = 0x2000u;
|
||||||
constexpr uint32_t immVal = 0xbaau;
|
constexpr uint32_t immVal = 0xbaau;
|
||||||
constexpr uint64_t dstAddress = 0xDEADCAF0u;
|
constexpr uint64_t dstAddress = 0xDEADCAF0u;
|
||||||
@@ -227,7 +227,7 @@ HWTEST_F(CommandEncoderMathTest, WhenSettingGroupSizeIndirectThenCommandsAreCorr
|
|||||||
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)};
|
CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)};
|
||||||
uint32_t crossThreadAddress[3] = {};
|
uint32_t crossThreadAddress[3] = {};
|
||||||
@@ -251,7 +251,7 @@ HWTEST_F(CommandEncoderMathTest, WhenSettingGroupCountIndirectThenCommandsAreCor
|
|||||||
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)};
|
CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)};
|
||||||
uint32_t crossThreadAddress[3] = {};
|
uint32_t crossThreadAddress[3] = {};
|
||||||
@@ -280,7 +280,7 @@ HWTEST_F(CommandEncoderMathTest, givenPayloadArgumentStoredInInlineDataWhenSetti
|
|||||||
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)};
|
CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)};
|
||||||
uint64_t crossThreadGpuVa = 0xBADF000;
|
uint64_t crossThreadGpuVa = 0xBADF000;
|
||||||
@@ -324,7 +324,7 @@ HWTEST_F(CommandEncoderMathTest, givenPayloadArgumentStoredInInlineDataWhenSetti
|
|||||||
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)};
|
CrossThreadDataOffset offsets[3] = {0, sizeof(uint32_t), 2 * sizeof(uint32_t)};
|
||||||
uint64_t crossThreadGpuVa = 0xBADF000;
|
uint64_t crossThreadGpuVa = 0xBADF000;
|
||||||
@@ -370,7 +370,7 @@ HWTEST_F(CommandEncoderMathTest, givenPayloadArgumentStoredInInlineDataWhenSetti
|
|||||||
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
CrossThreadDataOffset offset = sizeof(uint32_t);
|
CrossThreadDataOffset offset = sizeof(uint32_t);
|
||||||
uint64_t crossThreadGpuVa = 0xBADF000;
|
uint64_t crossThreadGpuVa = 0xBADF000;
|
||||||
@@ -406,7 +406,7 @@ HWTEST_F(CommandEncoderMathTest, givenPayloadArgumentStoredInInlineDataWhenEncod
|
|||||||
|
|
||||||
for (auto workDimInInlineData : ::testing::Bool()) {
|
for (auto workDimInInlineData : ::testing::Bool()) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
uint64_t crossThreadGpuVa = 0xBADF000;
|
uint64_t crossThreadGpuVa = 0xBADF000;
|
||||||
|
|
||||||
@@ -494,10 +494,10 @@ HWTEST_F(CommandEncoderMathTest, givenPayloadArgumentStoredInInlineDataWhenEncod
|
|||||||
using MI_ARB_CHECK = typename FamilyType::MI_ARB_CHECK;
|
using MI_ARB_CHECK = typename FamilyType::MI_ARB_CHECK;
|
||||||
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
|
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
|
||||||
CommandContainer cmdContainer0;
|
CommandContainer cmdContainer0;
|
||||||
cmdContainer0.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer0.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
CommandContainer cmdContainer1;
|
CommandContainer cmdContainer1;
|
||||||
cmdContainer1.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer1.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
uint64_t crossThreadGpuVa = 0xBADF000;
|
uint64_t crossThreadGpuVa = 0xBADF000;
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ HWTEST2_F(XeHPAndLaterCommandEncoderMathTest, WhenAppendsAGreaterThanThenPredica
|
|||||||
using MI_MATH_ALU_INST_INLINE = typename FamilyType::MI_MATH_ALU_INST_INLINE;
|
using MI_MATH_ALU_INST_INLINE = typename FamilyType::MI_MATH_ALU_INST_INLINE;
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
EncodeMathMMIO<FamilyType>::encodeGreaterThanPredicate(cmdContainer, 0xDEADBEEFCAF0u, 17u, false);
|
EncodeMathMMIO<FamilyType>::encodeGreaterThanPredicate(cmdContainer, 0xDEADBEEFCAF0u, 17u, false);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2020-2024 Intel Corporation
|
* Copyright (C) 2020-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -19,7 +19,7 @@ class CommandSetMMIOFixture : public DeviceFixture {
|
|||||||
void setUp() {
|
void setUp() {
|
||||||
DeviceFixture::setUp();
|
DeviceFixture::setUp();
|
||||||
cmdContainer = std::make_unique<CommandContainer>();
|
cmdContainer = std::make_unique<CommandContainer>();
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
}
|
}
|
||||||
void tearDown() {
|
void tearDown() {
|
||||||
cmdContainer.reset();
|
cmdContainer.reset();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace NEO {
|
|||||||
void CommandEncodeStatesFixture::setUp() {
|
void CommandEncodeStatesFixture::setUp() {
|
||||||
DeviceFixture::setUp();
|
DeviceFixture::setUp();
|
||||||
cmdContainer = std::make_unique<MyMockCommandContainer>();
|
cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||||
cmdContainer->initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer->initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
cmdContainer->setDirtyStateForAllHeaps(false);
|
cmdContainer->setDirtyStateForAllHeaps(false);
|
||||||
const auto &hwInfo = pDevice->getHardwareInfo();
|
const auto &hwInfo = pDevice->getHardwareInfo();
|
||||||
auto &productHelper = pDevice->getProductHelper();
|
auto &productHelper = pDevice->getProductHelper();
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ GEN12LPTEST_F(CommandEncoderTest, WhenAdjustComputeModeIsCalledThenStateComputeM
|
|||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
|
|
||||||
auto ret = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
auto ret = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
ASSERT_EQ(CommandContainer::ErrorCode::success, ret);
|
ASSERT_EQ(CommandContainer::ErrorCode::success, ret);
|
||||||
|
|
||||||
auto usedSpaceBefore = cmdContainer.getCommandStream()->getUsed();
|
auto usedSpaceBefore = cmdContainer.getCommandStream()->getUsed();
|
||||||
@@ -62,7 +62,7 @@ GEN12LPTEST_F(CommandEncoderTest, WhenAdjustComputeModeIsCalledThenStateComputeM
|
|||||||
|
|
||||||
GEN12LPTEST_F(CommandEncoderTest, givenCommandContainerWhenEncodeL3StateThenDoNotDispatchMMIOCommand) {
|
GEN12LPTEST_F(CommandEncoderTest, givenCommandContainerWhenEncodeL3StateThenDoNotDispatchMMIOCommand) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
EncodeL3State<FamilyType>::encode(cmdContainer, false);
|
EncodeL3State<FamilyType>::encode(cmdContainer, false);
|
||||||
|
|
||||||
GenCmdList commands;
|
GenCmdList commands;
|
||||||
@@ -83,7 +83,7 @@ GEN12LPTEST_F(CommandEncodeStatesTest, givenVariousEngineTypesWhenEncodeSbaThenA
|
|||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
|
|
||||||
auto ret = cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
auto ret = cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
ASSERT_EQ(CommandContainer::ErrorCode::success, ret);
|
ASSERT_EQ(CommandContainer::ErrorCode::success, ret);
|
||||||
|
|
||||||
auto gmmHelper = cmdContainer.getDevice()->getRootDeviceEnvironment().getGmmHelper();
|
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;
|
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
EncodeL3State<FamilyType>::encode(cmdContainer, true);
|
EncodeL3State<FamilyType>::encode(cmdContainer, true);
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ GEN12LPTEST_F(CommandEncoderTest, GivenGen12LpWhenProgrammingL3StateOnThenExpect
|
|||||||
GEN12LPTEST_F(CommandEncoderTest, GivenGen12LpWhenProgrammingL3StateOffThenExpectNoCommandsDispatched) {
|
GEN12LPTEST_F(CommandEncoderTest, GivenGen12LpWhenProgrammingL3StateOffThenExpectNoCommandsDispatched) {
|
||||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
EncodeL3State<FamilyType>::encode(cmdContainer, false);
|
EncodeL3State<FamilyType>::encode(cmdContainer, false);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2020-2024 Intel Corporation
|
* Copyright (C) 2020-2025 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -25,7 +25,7 @@ GEN12LPTEST_F(CommandEncoderMathTestGen12Lp, WhenAppendsAGreaterThanThenPredicat
|
|||||||
using MI_MATH_ALU_INST_INLINE = typename FamilyType::MI_MATH_ALU_INST_INLINE;
|
using MI_MATH_ALU_INST_INLINE = typename FamilyType::MI_MATH_ALU_INST_INLINE;
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(pDevice, nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(pDevice, nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
EncodeMathMMIO<FamilyType>::encodeGreaterThanPredicate(cmdContainer, 0xDEADBEEFCAF0u, 17u, false);
|
EncodeMathMMIO<FamilyType>::encodeGreaterThanPredicate(cmdContainer, 0xDEADBEEFCAF0u, 17u, false);
|
||||||
|
|
||||||
|
|||||||
@@ -4871,7 +4871,7 @@ TEST(DrmMemoryManager, givenEnabledResourceRegistrationWhenSshIsAllocatedThenItI
|
|||||||
auto device = std::unique_ptr<MockDevice>(MockDevice::create<MockDevice>(executionEnvironment, 0));
|
auto device = std::unique_ptr<MockDevice>(MockDevice::create<MockDevice>(executionEnvironment, 0));
|
||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
cmdContainer.initialize(device.get(), nullptr, HeapSize::defaultHeapSize, true, false);
|
cmdContainer.initialize(device.get(), nullptr, HeapSize::getDefaultHeapSize(IndirectHeapType::surfaceState), true, false);
|
||||||
|
|
||||||
auto *ssh = cmdContainer.getIndirectHeap(NEO::HeapType::surfaceState);
|
auto *ssh = cmdContainer.getIndirectHeap(NEO::HeapType::surfaceState);
|
||||||
auto bo = static_cast<DrmAllocation *>(ssh->getGraphicsAllocation())->getBO();
|
auto bo = static_cast<DrmAllocation *>(ssh->getGraphicsAllocation())->getBO();
|
||||||
|
|||||||
Reference in New Issue
Block a user