mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Add debug flag for EOT WA
EOT WA requires allocating last 64KB of kernel heap and putting EOT signature at the last 16 bytes of kernel heap Related-To: NEO-7099 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9a667308b9
commit
cf3817e058
@@ -1512,6 +1512,20 @@ TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmMemoryManagerWithLocalMemory
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, whenAllocatingKernelIsaWithSpecificGpuAddressThenThisAddressIsUsed) {
|
||||
uint64_t expectedGpuAddress = 0xDEADBEEFu;
|
||||
size_t size = 4096u;
|
||||
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::KERNEL_ISA, false, device->getDeviceBitfield());
|
||||
properties.gpuAddress = expectedGpuAddress;
|
||||
DebugManager.flags.EnableLocalMemory.set(true);
|
||||
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
|
||||
ASSERT_NE(nullptr, graphicsAllocation);
|
||||
|
||||
EXPECT_EQ(expectedGpuAddress, graphicsAllocation->getGpuAddress());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, graphicsAllocation->getMemoryPool());
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledAndRootDeviceIndexIsSpecifiedThenGraphicsAllocationIsReturnedWithCorrectRootDeviceIndex) {
|
||||
mock->ioctl_expected.primeFdToHandle = 1;
|
||||
mock->ioctl_expected.gemWait = 1;
|
||||
|
||||
@@ -23,6 +23,7 @@ set(NEO_CORE_OS_INTERFACE_TESTS_WINDOWS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_address_space_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_command_stream_l0_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_mapper_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_memory_manager_with_localmem_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_preemption_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_shared_allocations_test.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_special_heap_test.cpp
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/ult_hw_config.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(WddmMemoryManagerWithLocalMemoryTest, whenAllocatingKernelIsaWithSpecificGpuAddressThenThisAddressIsUsed) {
|
||||
if (is32bit) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||
ultHwConfig.forceOsAgnosticMemoryManager = false;
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableLocalMemory.set(true);
|
||||
|
||||
auto executionEnvironment = new MockExecutionEnvironment(defaultHwInfo.get(), true, 1);
|
||||
auto devices = DeviceFactory::createDevices(*executionEnvironment);
|
||||
auto memoryManager = executionEnvironment->memoryManager.get();
|
||||
auto &device = devices.front();
|
||||
|
||||
uint64_t expectedGpuAddress = memoryManager->getInternalHeapBaseAddress(device->getRootDeviceIndex(), true) + MemoryConstants::gigaByte;
|
||||
size_t size = 4096u;
|
||||
|
||||
AllocationProperties properties(device->getRootDeviceIndex(), true, size, AllocationType::KERNEL_ISA, false, device->getDeviceBitfield());
|
||||
properties.gpuAddress = expectedGpuAddress;
|
||||
|
||||
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
|
||||
ASSERT_NE(nullptr, graphicsAllocation);
|
||||
|
||||
EXPECT_EQ(device->getGmmHelper()->canonize(expectedGpuAddress), graphicsAllocation->getGpuAddress());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, graphicsAllocation->getMemoryPool());
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
Reference in New Issue
Block a user