Move residency and eviction allocations from MemoryManager to CSR

Change-Id: I44185b35375f4cc9d58cac14cac1edefaacde652
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2018-09-13 15:49:38 +02:00
committed by sys_ocldev
parent fa30e0dc1f
commit 8df30ceac1
6 changed files with 50 additions and 88 deletions

View File

@@ -1072,56 +1072,6 @@ TEST(OsAgnosticMemoryManager, pleaseDetectLeak) {
MemoryManagement::fastLeaksDetectionMode = MemoryManagement::LeakDetectionMode::EXPECT_TO_LEAK;
}
TEST(OsAgnosticMemoryManager, pushAllocationForResidency) {
OsAgnosticMemoryManager memoryManager;
auto graphicsAllocation = memoryManager.allocateGraphicsMemory(4096u);
EXPECT_EQ(0u, memoryManager.getResidencyAllocations().size());
memoryManager.pushAllocationForResidency(graphicsAllocation);
EXPECT_EQ(1u, memoryManager.getResidencyAllocations().size());
memoryManager.freeGraphicsMemory(graphicsAllocation);
}
TEST(OsAgnosticMemoryManager, clearResidencyAllocations) {
OsAgnosticMemoryManager memoryManager;
auto graphicsAllocation = memoryManager.allocateGraphicsMemory(4096u);
memoryManager.pushAllocationForResidency(graphicsAllocation);
EXPECT_EQ(1u, memoryManager.getResidencyAllocations().size());
memoryManager.clearResidencyAllocations();
EXPECT_EQ(0u, memoryManager.getResidencyAllocations().size());
memoryManager.freeGraphicsMemory(graphicsAllocation);
}
TEST(OsAgnosticMemoryManager, pushAllocationForEviction) {
OsAgnosticMemoryManager memoryManager;
auto graphicsAllocation = memoryManager.allocateGraphicsMemory(4096u);
EXPECT_EQ(0u, memoryManager.getEvictionAllocations().size());
memoryManager.pushAllocationForEviction(graphicsAllocation);
EXPECT_EQ(1u, memoryManager.getEvictionAllocations().size());
memoryManager.freeGraphicsMemory(graphicsAllocation);
}
TEST(OsAgnosticMemoryManager, clearEvictionAllocations) {
OsAgnosticMemoryManager memoryManager;
auto graphicsAllocation = memoryManager.allocateGraphicsMemory(4096u);
memoryManager.pushAllocationForEviction(graphicsAllocation);
EXPECT_EQ(1u, memoryManager.getEvictionAllocations().size());
memoryManager.clearEvictionAllocations();
EXPECT_EQ(0u, memoryManager.getEvictionAllocations().size());
memoryManager.freeGraphicsMemory(graphicsAllocation);
}
TEST(OsAgnosticMemoryManager, alignmentIsCorrect) {
OsAgnosticMemoryManager memoryManager;
const size_t alignment = 0;