mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
OsAgnosticMemoryManager to call freeMemory on AubManager
Resolves: NEO-3231 Change-Id: I89a3cc9f2a63931c6c87ec70bbedc19716a885c1 Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
@ -1166,6 +1166,20 @@ TEST(OsAgnosticMemoryManager, givenLocalMemorySupportedAndAubUsageWhenMemoryMana
|
||||
EXPECT_EQ(heap32Base, memoryManager.getExternalHeapBaseAddress());
|
||||
}
|
||||
|
||||
TEST(OsAgnosticMemoryManager, givenOsAgnosticMemoryManagerWhenGraphicsAllocationIsDestroyedThenFreeMemoryOnAubManagerShouldBeCalled) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
OsAgnosticMemoryManager memoryManager(executionEnvironment);
|
||||
MockAubManager *mockManager = new MockAubManager();
|
||||
MockAubCenter *mockAubCenter = new MockAubCenter(platformDevices[0], false, "file_name.aub", CommandStreamReceiverType::CSR_AUB);
|
||||
mockAubCenter->aubManager = std::unique_ptr<MockAubManager>(mockManager);
|
||||
executionEnvironment.aubCenter.reset(mockAubCenter);
|
||||
|
||||
auto gfxAllocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||
EXPECT_FALSE(mockManager->freeMemoryCalled);
|
||||
memoryManager.freeGraphicsMemory(gfxAllocation);
|
||||
EXPECT_TRUE(mockManager->freeMemoryCalled);
|
||||
}
|
||||
|
||||
TEST(MemoryManager, givenSharedResourceCopyWhenAllocatingGraphicsMemoryThenAllocateGraphicsMemoryForImageIsCalled) {
|
||||
ExecutionEnvironment *executionEnvironment = platformImpl->peekExecutionEnvironment();
|
||||
MockMemoryManager memoryManager(false, true, *executionEnvironment);
|
||||
|
Reference in New Issue
Block a user