Ensure that SVM allocations are zero-copy.

Change-Id: I20a20af33f95014d74e8101789de2581259c62fa
This commit is contained in:
Mrozek, Michal
2018-12-13 10:18:34 +01:00
committed by sys_ocldev
parent 6face330fd
commit b4256453ed
2 changed files with 10 additions and 0 deletions

View File

@@ -345,3 +345,12 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenBufferTypeIsPassedAndAllocateInDev
memoryManager.freeGraphicsMemory(allocation);
}
TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThenZeroCopyIsRequested) {
MockMemoryManager memoryManager(false);
AllocationData allocData;
AllocationProperties properties(true, 1);
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr, GraphicsAllocation::AllocationType::SVM);
EXPECT_TRUE(allocData.flags.mustBeZeroCopy);
EXPECT_TRUE(allocData.flags.allocateMemory);
}