mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Code cleanup for reduced GPU address space
Change-Id: Ibce79ddbe1f03dac1813b5dc2356a9db86b60200 Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
@@ -1319,6 +1319,28 @@ TEST(OsAgnosticMemoryManager, givenOsAgnosticMemoryManagerWhenAllocateGraphicsMe
|
||||
memoryManager.freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST(OsAgnosticMemoryManager, givenReducedGpuAddressSpaceWhenAllocateGraphicsMemoryForHostPtrIsCalledThenAllocationWithoutFragmentsIsCreated) {
|
||||
OsAgnosticMemoryManager memoryManager;
|
||||
auto hostPtr = reinterpret_cast<void *>(0x5001);
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryForHostPtr(13, hostPtr, false);
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
EXPECT_EQ(0u, allocation->fragmentsStorage.fragmentCount);
|
||||
|
||||
memoryManager.freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST(OsAgnosticMemoryManager, givenFullGpuAddressSpaceWhenAllocateGraphicsMemoryForHostPtrIsCalledThenAllocationWithFragmentsIsCreated) {
|
||||
OsAgnosticMemoryManager memoryManager;
|
||||
auto hostPtr = reinterpret_cast<void *>(0x5001);
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryForHostPtr(13, hostPtr, true);
|
||||
EXPECT_NE(nullptr, allocation);
|
||||
EXPECT_EQ(1u, allocation->fragmentsStorage.fragmentCount);
|
||||
|
||||
memoryManager.freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST_F(MemoryAllocatorTest, GivenSizeWhenGmmIsCreatedThenSuccess) {
|
||||
Gmm *gmm = new Gmm(nullptr, 65536, false);
|
||||
EXPECT_NE(nullptr, gmm);
|
||||
|
||||
Reference in New Issue
Block a user