mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +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) {
|
TEST_F(MemoryManagerGetAlloctionDataTests, givenForceSystemMemoryFlagWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsSet) {
|
||||||
AllocationData allocData;
|
auto firstAllocationIdx = static_cast<int>(GraphicsAllocation::AllocationType::UNKNOWN);
|
||||||
AllocationProperties properties(mockRootDeviceIndex, true, 10, GraphicsAllocation::AllocationType::BUFFER, false, mockDeviceBitfield);
|
auto lastAllocationIdx = static_cast<int>(GraphicsAllocation::AllocationType::COUNT);
|
||||||
properties.flags.forceSystemMemory = true;
|
|
||||||
MockMemoryManager mockMemoryManager;
|
|
||||||
mockMemoryManager.getAllocationData(allocData, properties, nullptr, mockMemoryManager.createStorageInfoFromProperties(properties));
|
|
||||||
|
|
||||||
EXPECT_TRUE(allocData.flags.useSystemMemory);
|
for (int allocationIdx = firstAllocationIdx + 1; allocationIdx != lastAllocationIdx; allocationIdx++) {
|
||||||
EXPECT_EQ(10u, allocData.size);
|
AllocationData allocData;
|
||||||
EXPECT_EQ(nullptr, allocData.hostPtr);
|
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) {
|
TEST_F(MemoryManagerGetAlloctionDataTests, givenMultiRootDeviceIndexAllocationPropertiesWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsSet) {
|
||||||
|
|||||||
@@ -436,9 +436,9 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
|
|||||||
|
|
||||||
allocationData.flags.crossRootDeviceAccess = properties.flags.crossRootDeviceAccess;
|
allocationData.flags.crossRootDeviceAccess = properties.flags.crossRootDeviceAccess;
|
||||||
allocationData.flags.useSystemMemory |= properties.flags.crossRootDeviceAccess;
|
allocationData.flags.useSystemMemory |= properties.flags.crossRootDeviceAccess;
|
||||||
allocationData.flags.useSystemMemory |= properties.flags.forceSystemMemory;
|
|
||||||
|
|
||||||
hwHelper.setExtraAllocationData(allocationData, properties, *hwInfo);
|
hwHelper.setExtraAllocationData(allocationData, properties, *hwInfo);
|
||||||
|
allocationData.flags.useSystemMemory |= properties.flags.forceSystemMemory;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user