mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Add new functions reserving address range to Memory Manager
Change-Id: I947203c24495c9e5a206b95bb0c69440824586b6 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
669d19297c
commit
cdb52400c4
@@ -1758,3 +1758,15 @@ TEST(MemoryManagerCopyMemoryTest, givenValidAllocationAndMemoryWhenCopyMemoryToA
|
||||
EXPECT_TRUE(memoryManager.copyMemoryToAllocation(&allocation, &memory, sizeof(memory)));
|
||||
EXPECT_EQ(memory, allocationStorage[0]);
|
||||
}
|
||||
|
||||
TEST_F(MemoryAllocatorTest, whenReservingAddressRangeThenExpectProperAddressAndReleaseWhenFreeing) {
|
||||
size_t size = 0x1000;
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{size});
|
||||
ASSERT_NE(nullptr, allocation);
|
||||
void *reserve = memoryManager->reserveCpuAddressRange(size);
|
||||
EXPECT_NE(nullptr, reserve);
|
||||
allocation->setReservedAddressRange(reserve, size);
|
||||
EXPECT_EQ(reserve, allocation->getReservedAddressPtr());
|
||||
EXPECT_EQ(size, allocation->getReservedAddressSize());
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user