mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 17:00:59 +08:00
Respect forceSystemMemory flag at the end of getAllocationData method
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e53202e96b
commit
a304e609fe
@@ -51,15 +51,18 @@ TEST_F(MemoryManagerGetAlloctionDataTests, givenNonHostMemoryAllocatoinTypeWhenA
|
||||
}
|
||||
|
||||
TEST_F(MemoryManagerGetAlloctionDataTests, givenForceSystemMemoryFlagWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsSet) {
|
||||
AllocationData allocData;
|
||||
AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::BUFFER, false, mockDeviceBitfield);
|
||||
properties.flags.forceSystemMemory = true;
|
||||
MockMemoryManager mockMemoryManager;
|
||||
mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties));
|
||||
auto firstAllocationIdx = static_cast<int>(GraphicsAllocation::AllocationType::UNKNOWN);
|
||||
auto lastAllocationIdx = static_cast<int>(GraphicsAllocation::AllocationType::COUNT);
|
||||
|
||||
EXPECT_TRUE(allocData.flags.useSystemMemory);
|
||||
EXPECT_EQ(10u, allocData.size);
|
||||
EXPECT_EQ(nullptr, allocData.hostPtr);
|
||||
for (int allocationIdx = firstAllocationIdx + 1; allocationIdx != lastAllocationIdx; allocationIdx++) {
|
||||
AllocationData allocData;
|
||||
AllocationProperties properties(mockRootDeviceIndex, true, 10, static_cast<GraphicsAllocation::AllocationType>(allocationIdx), false, mockDeviceBitfield);
|
||||
properties.flags.forceSystemMemory = true;
|
||||
MockMemoryManager mockMemoryManager;
|
||||
mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties));
|
||||
|
||||
EXPECT_TRUE(allocData.flags.useSystemMemory);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(MemoryManagerGetAlloctionDataTests, givenMultiRootDeviceIndexAllocationPropertiesWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsSet) {
|
||||
|
||||
@@ -436,9 +436,9 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
|
||||
|
||||
allocationData.flags.crossRootDeviceAccess = properties.flags.crossRootDeviceAccess;
|
||||
allocationData.flags.useSystemMemory |= properties.flags.crossRootDeviceAccess;
|
||||
allocationData.flags.useSystemMemory |= properties.flags.forceSystemMemory;
|
||||
|
||||
hwHelper.setExtraAllocationData(allocationData, properties, *hwInfo);
|
||||
allocationData.flags.useSystemMemory |= properties.flags.forceSystemMemory;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user