mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:56:36 +08:00
fix: set properly resource params when setAllocationType
gmm params: usage, cachable and resource info should be set properly when override allocation type Resolves: HSD-22020344331 Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
71c6731287
commit
2e0884a301
@@ -75,7 +75,8 @@ TEST_F(AubMemoryOperationsHandlerTests, givenAubManagerWhenCallingLockThenTrueRe
|
||||
|
||||
TEST_F(AubMemoryOperationsHandlerTests, givenAubManagerAndAllocationOfOneTimeAubWritableAllocationTypeWhenMakeResidentCalledTwoTimesThenWriteMemoryOnce) {
|
||||
ASSERT_TRUE(AubHelper::isOneTimeAubWritableAllocationType(AllocationType::buffer));
|
||||
allocPtr->setAllocationType(AllocationType::buffer);
|
||||
auto &productHelper = device->getProductHelper();
|
||||
allocPtr->setAllocationType(AllocationType::buffer, productHelper);
|
||||
|
||||
MockAubManager aubManager;
|
||||
getMemoryOperationsHandler()->setAubManager(&aubManager);
|
||||
|
||||
@@ -524,7 +524,7 @@ HWTEST_F(ProductHelperTest, givenLockableAllocationWhenGettingIsBlitCopyRequired
|
||||
pInHwInfo.capabilityTable.blitterOperationsSupported = true;
|
||||
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
graphicsAllocation.setAllocationType(AllocationType::bufferHostMemory);
|
||||
graphicsAllocation.setAllocationType(AllocationType::bufferHostMemory, *productHelper);
|
||||
EXPECT_TRUE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType()));
|
||||
graphicsAllocation.overrideMemoryPool(MemoryPool::localMemory);
|
||||
|
||||
@@ -556,7 +556,7 @@ HWTEST_F(ProductHelperTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequi
|
||||
hwInfo.capabilityTable.blitterOperationsSupported = true;
|
||||
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
graphicsAllocation.setAllocationType(AllocationType::svmGpu);
|
||||
graphicsAllocation.setAllocationType(AllocationType::svmGpu, *productHelper);
|
||||
EXPECT_FALSE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType()));
|
||||
graphicsAllocation.overrideMemoryPool(MemoryPool::localMemory);
|
||||
|
||||
@@ -596,7 +596,7 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenGettingIsBlitCopyRequiredForL
|
||||
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
graphicsAllocation.overrideMemoryPool(MemoryPool::localMemory);
|
||||
graphicsAllocation.setAllocationType(AllocationType::bufferHostMemory);
|
||||
graphicsAllocation.setAllocationType(AllocationType::bufferHostMemory, *productHelper);
|
||||
|
||||
EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 Intel Corporation
|
||||
* Copyright (C) 2019-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -22,6 +22,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) {
|
||||
DebugVariables flags;
|
||||
flags.LogAllocationMemoryPool.set(true);
|
||||
FullyEnabledFileLogger fileLogger(testFile, flags);
|
||||
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getProductHelper();
|
||||
|
||||
// Log file not created
|
||||
bool logFileCreated = fileExists(fileLogger.getLogFileName());
|
||||
@@ -29,7 +30,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagThenLogsCorrectInfo) {
|
||||
|
||||
MockWddmAllocation allocation(getGmmHelper());
|
||||
allocation.handle = 4;
|
||||
allocation.setAllocationType(AllocationType::buffer);
|
||||
allocation.setAllocationType(AllocationType::buffer, productHelper);
|
||||
allocation.memoryPool = MemoryPool::system64KBPages;
|
||||
allocation.getDefaultGmm()->resourceParams.Flags.Info.NonLocalOnly = 0;
|
||||
allocation.setGpuAddress(0x12345);
|
||||
@@ -66,6 +67,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagSetFalseThenAllocationIs
|
||||
DebugVariables flags;
|
||||
flags.LogAllocationMemoryPool.set(false);
|
||||
FullyEnabledFileLogger fileLogger(testFile, flags);
|
||||
auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getProductHelper();
|
||||
|
||||
// Log file not created
|
||||
bool logFileCreated = fileExists(fileLogger.getLogFileName());
|
||||
@@ -75,7 +77,7 @@ TEST_F(FileLoggerTests, GivenLogAllocationMemoryPoolFlagSetFalseThenAllocationIs
|
||||
executionEnvironment->rootDeviceEnvironments[0]->initGmm();
|
||||
MockWddmAllocation allocation(executionEnvironment->rootDeviceEnvironments[0]->getGmmHelper());
|
||||
allocation.handle = 4;
|
||||
allocation.setAllocationType(AllocationType::buffer);
|
||||
allocation.setAllocationType(AllocationType::buffer, productHelper);
|
||||
allocation.memoryPool = MemoryPool::system64KBPages;
|
||||
allocation.getDefaultGmm()->resourceParams.Flags.Info.NonLocalOnly = 0;
|
||||
|
||||
|
||||
@@ -1415,7 +1415,7 @@ TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingAllocationWithReservedGpuVirtu
|
||||
|
||||
TEST_F(WddmMemoryManagerSimpleTest, givenAllocationWithReservedGpuVirtualAddressWhenMapCallFailsDuringCreateWddmAllocationThenReleasePreferredAddress) {
|
||||
MockWddmAllocation allocation(rootDeviceEnvironment->getGmmHelper(), 1);
|
||||
allocation.setAllocationType(AllocationType::kernelIsa);
|
||||
allocation.setAllocationType(AllocationType::kernelIsa, csr->getProductHelper());
|
||||
uint64_t gpuAddress = 0x123;
|
||||
uint64_t sizeForFree = 0x1234;
|
||||
allocation.setReservedGpuVirtualAddress(gpuAddress);
|
||||
@@ -1437,7 +1437,8 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMultiHandleAllocationAndPreferredGpuVaI
|
||||
|
||||
uint32_t numGmms = 10;
|
||||
MockWddmAllocation allocation(rootDeviceEnvironment->getGmmHelper(), numGmms);
|
||||
allocation.setAllocationType(AllocationType::buffer);
|
||||
|
||||
allocation.setAllocationType(AllocationType::buffer, csr->getProductHelper());
|
||||
allocation.storageInfo.multiStorage = true;
|
||||
|
||||
wddm->callBaseMapGpuVa = true;
|
||||
@@ -1464,7 +1465,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMultiHandleAllocationWhenCreatePhysical
|
||||
|
||||
uint32_t numGmms = 10;
|
||||
MockWddmAllocation allocation(rootDeviceEnvironment->getGmmHelper(), numGmms);
|
||||
allocation.setAllocationType(AllocationType::buffer);
|
||||
allocation.setAllocationType(AllocationType::buffer, csr->getProductHelper());
|
||||
allocation.storageInfo.multiStorage = true;
|
||||
|
||||
wddm->callBaseMapGpuVa = true;
|
||||
@@ -1482,7 +1483,7 @@ TEST_F(WddmMemoryManagerSimpleTest, givenMultiHandleAllocationWhenCreatePhysical
|
||||
|
||||
uint32_t numGmms = 10;
|
||||
MockWddmAllocation allocation(rootDeviceEnvironment->getGmmHelper(), numGmms);
|
||||
allocation.setAllocationType(AllocationType::buffer);
|
||||
allocation.setAllocationType(AllocationType::buffer, csr->getProductHelper());
|
||||
allocation.storageInfo.multiStorage = true;
|
||||
|
||||
wddm->callBaseMapGpuVa = true;
|
||||
|
||||
Reference in New Issue
Block a user