From b25422deb12305208cbbac44d17b7dfa5a21dd8b Mon Sep 17 00:00:00 2001 From: "Jobczyk, Lukasz" Date: Wed, 4 Sep 2019 15:04:46 +0200 Subject: [PATCH] Refactor a createUnifiedMemoryAllocation method Related-To: NEO-3330 Change-Id: I3703d2474b7b3c91d584c165952d2762c7423bab Signed-off-by: Jobczyk, Lukasz --- runtime/api/api.cpp | 6 +-- .../memory_manager/unified_memory_manager.cpp | 43 ++++++++++--------- .../memory_manager/unified_memory_manager.h | 3 +- .../command_queue/enqueue_svm_tests.cpp | 2 +- unit_tests/kernel/kernel_tests.cpp | 24 +++++------ .../unified_memory_manager_tests.cpp | 12 +++--- 6 files changed, 47 insertions(+), 43 deletions(-) diff --git a/runtime/api/api.cpp b/runtime/api/api.cpp index 1fb356f943..5d6af5001e 100644 --- a/runtime/api/api.cpp +++ b/runtime/api/api.cpp @@ -3407,7 +3407,7 @@ void *clHostMemAllocINTEL( return nullptr; } - return neoContext->getSVMAllocsManager()->createUnifiedMemoryAllocation(size, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY), neoContext->getSpecialQueue()); + return neoContext->getSVMAllocsManager()->createUnifiedMemoryAllocation(size, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY)); } void *clDeviceMemAllocINTEL( @@ -3428,7 +3428,7 @@ void *clDeviceMemAllocINTEL( return nullptr; } - return neoContext->getSVMAllocsManager()->createUnifiedMemoryAllocation(size, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY), neoContext->getSpecialQueue()); + return neoContext->getSVMAllocsManager()->createUnifiedMemoryAllocation(size, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY)); } void *clSharedMemAllocINTEL( @@ -3449,7 +3449,7 @@ void *clSharedMemAllocINTEL( return nullptr; } - return neoContext->getSVMAllocsManager()->createUnifiedMemoryAllocation(size, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY), neoContext->getSpecialQueue()); + return neoContext->getSVMAllocsManager()->createSharedUnifiedMemoryAllocation(size, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY), neoContext->getSpecialQueue()); } cl_int clMemFreeINTEL( diff --git a/runtime/memory_manager/unified_memory_manager.cpp b/runtime/memory_manager/unified_memory_manager.cpp index 6517ce03c5..7d44907c8f 100644 --- a/runtime/memory_manager/unified_memory_manager.cpp +++ b/runtime/memory_manager/unified_memory_manager.cpp @@ -92,26 +92,7 @@ void *SVMAllocsManager::createSVMAlloc(size_t size, const SvmAllocationPropertie } } -void *SVMAllocsManager::createUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties memoryProperties, void *cmdQ) { - auto supportDualStorageSharedMemory = memoryManager->isLocalMemorySupported(); - - if (DebugManager.flags.AllocateSharedAllocationsWithCpuAndGpuStorage.get() != -1) { - supportDualStorageSharedMemory = !!DebugManager.flags.AllocateSharedAllocationsWithCpuAndGpuStorage.get(); - } - - if (memoryProperties.memoryType == InternalMemoryType::SHARED_UNIFIED_MEMORY && supportDualStorageSharedMemory) { - auto unifiedMemoryPointer = createUnifiedAllocationWithDeviceStorage(size, {}); - UNRECOVERABLE_IF(unifiedMemoryPointer == nullptr); - auto unifiedMemoryAllocation = this->getSVMAlloc(unifiedMemoryPointer); - unifiedMemoryAllocation->memoryType = memoryProperties.memoryType; - - UNRECOVERABLE_IF(cmdQ == nullptr); - auto pageFaultManager = this->memoryManager->getPageFaultManager(); - pageFaultManager->insertAllocation(unifiedMemoryPointer, size, this, cmdQ); - - return unifiedMemoryPointer; - } - +void *SVMAllocsManager::createUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties memoryProperties) { size_t alignedSize = alignUp(size, MemoryConstants::pageSize64k); AllocationProperties unifiedMemoryProperties{true, @@ -132,6 +113,28 @@ void *SVMAllocsManager::createUnifiedMemoryAllocation(size_t size, const Unified return reinterpret_cast(unifiedMemoryAllocation->getGpuAddress()); } +void *SVMAllocsManager::createSharedUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties memoryProperties, void *cmdQ) { + auto supportDualStorageSharedMemory = memoryManager->isLocalMemorySupported(); + + if (DebugManager.flags.AllocateSharedAllocationsWithCpuAndGpuStorage.get() != -1) { + supportDualStorageSharedMemory = !!DebugManager.flags.AllocateSharedAllocationsWithCpuAndGpuStorage.get(); + } + + if (supportDualStorageSharedMemory) { + auto unifiedMemoryPointer = createUnifiedAllocationWithDeviceStorage(size, {}); + UNRECOVERABLE_IF(unifiedMemoryPointer == nullptr); + auto unifiedMemoryAllocation = this->getSVMAlloc(unifiedMemoryPointer); + unifiedMemoryAllocation->memoryType = memoryProperties.memoryType; + + UNRECOVERABLE_IF(cmdQ == nullptr); + auto pageFaultManager = this->memoryManager->getPageFaultManager(); + pageFaultManager->insertAllocation(unifiedMemoryPointer, size, this, cmdQ); + + return unifiedMemoryPointer; + } + return createUnifiedMemoryAllocation(size, memoryProperties); +} + SvmAllocationData *SVMAllocsManager::getSVMAlloc(const void *ptr) { std::unique_lock lock(mtx); return SVMAllocs.get(ptr); diff --git a/runtime/memory_manager/unified_memory_manager.h b/runtime/memory_manager/unified_memory_manager.h index f818ecd650..2c24efeaf7 100644 --- a/runtime/memory_manager/unified_memory_manager.h +++ b/runtime/memory_manager/unified_memory_manager.h @@ -75,7 +75,8 @@ class SVMAllocsManager { SVMAllocsManager(MemoryManager *memoryManager); void *createSVMAlloc(size_t size, const SvmAllocationProperties svmProperties); - void *createUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties svmProperties, void *cmdQ); + void *createUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties svmProperties); + void *createSharedUnifiedMemoryAllocation(size_t size, const UnifiedMemoryProperties svmProperties, void *cmdQ); SvmAllocationData *getSVMAlloc(const void *ptr); bool freeSVMAlloc(void *ptr); size_t getNumAllocs() const { return SVMAllocs.getNumAllocs(); } diff --git a/unit_tests/command_queue/enqueue_svm_tests.cpp b/unit_tests/command_queue/enqueue_svm_tests.cpp index 8583853c9b..c424030eb7 100644 --- a/unit_tests/command_queue/enqueue_svm_tests.cpp +++ b/unit_tests/command_queue/enqueue_svm_tests.cpp @@ -1263,7 +1263,7 @@ HWTEST_F(EnqueueSvmTest, whenInternalAllocationsAreMadeResidentThenOnlyNonSvmAll auto allocationSize = 4096u; auto svmManager = this->context->getSVMAllocsManager(); EXPECT_NE(0u, svmManager->getNumAllocs()); - auto unifiedMemoryPtr = svmManager->createUnifiedMemoryAllocation(allocationSize, unifiedMemoryProperties, this->context->getSpecialQueue()); + auto unifiedMemoryPtr = svmManager->createUnifiedMemoryAllocation(allocationSize, unifiedMemoryProperties); EXPECT_NE(nullptr, unifiedMemoryPtr); EXPECT_EQ(2u, svmManager->getNumAllocs()); diff --git a/unit_tests/kernel/kernel_tests.cpp b/unit_tests/kernel/kernel_tests.cpp index ae1e34f95d..ee315b2943 100644 --- a/unit_tests/kernel/kernel_tests.cpp +++ b/unit_tests/kernel/kernel_tests.cpp @@ -1724,7 +1724,7 @@ HWTEST_F(KernelResidencyTest, givenKernelWhenItUsesIndirectUnifiedMemoryDeviceAl auto &commandStreamReceiver = this->pDevice->getUltCommandStreamReceiver(); auto svmAllocationsManager = mockKernel.mockContext->getSVMAllocsManager(); - auto unifiedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY), nullptr); + auto unifiedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY)); mockKernel.mockKernel->makeResident(this->pDevice->getGpgpuCommandStreamReceiver()); @@ -1748,8 +1748,8 @@ HWTEST_F(KernelResidencyTest, givenKernelUsingIndirectHostMemoryWhenMakeResident auto &commandStreamReceiver = this->pDevice->getUltCommandStreamReceiver(); auto svmAllocationsManager = mockKernel.mockContext->getSVMAllocsManager(); - auto unifiedDeviceMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY), nullptr); - auto unifiedHostMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY), nullptr); + auto unifiedDeviceMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY)); + auto unifiedHostMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY)); mockKernel.mockKernel->makeResident(this->pDevice->getGpgpuCommandStreamReceiver()); EXPECT_EQ(0u, commandStreamReceiver.getResidencyAllocations().size()); @@ -1768,8 +1768,8 @@ HWTEST_F(KernelResidencyTest, givenKernelUsingIndirectSharedMemoryWhenMakeReside auto &commandStreamReceiver = this->pDevice->getUltCommandStreamReceiver(); auto svmAllocationsManager = mockKernel.mockContext->getSVMAllocsManager(); - auto unifiedSharedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY), mockKernel.mockContext->getSpecialQueue()); - auto unifiedHostMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY), nullptr); + auto unifiedSharedMemoryAllocation = svmAllocationsManager->createSharedUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY), mockKernel.mockContext->getSpecialQueue()); + auto unifiedHostMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY)); mockKernel.mockKernel->makeResident(this->pDevice->getGpgpuCommandStreamReceiver()); EXPECT_EQ(0u, commandStreamReceiver.getResidencyAllocations().size()); @@ -1792,7 +1792,7 @@ HWTEST_F(KernelResidencyTest, givenDeviceUnifiedMemoryAndPageFaultManagerWhenMak auto &commandStreamReceiver = this->pDevice->getUltCommandStreamReceiver(); auto svmAllocationsManager = mockKernel.mockContext->getSVMAllocsManager(); - auto unifiedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY), nullptr); + auto unifiedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY)); auto unifiedMemoryGraphicsAllocation = svmAllocationsManager->getSVMAlloc(unifiedMemoryAllocation); EXPECT_EQ(0u, mockKernel.mockKernel->kernelUnifiedMemoryGfxAllocations.size()); @@ -1822,7 +1822,7 @@ HWTEST_F(KernelResidencyTest, givenSharedUnifiedMemoryAndPageFaultManagerWhenMak auto &commandStreamReceiver = this->pDevice->getUltCommandStreamReceiver(); auto svmAllocationsManager = mockKernel.mockContext->getSVMAllocsManager(); - auto unifiedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY), mockKernel.mockContext->getSpecialQueue()); + auto unifiedMemoryAllocation = svmAllocationsManager->createSharedUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY), mockKernel.mockContext->getSpecialQueue()); auto unifiedMemoryGraphicsAllocation = svmAllocationsManager->getSVMAlloc(unifiedMemoryAllocation); mockMemoryManager->pageFaultManager->insertAllocation(unifiedMemoryAllocation, 4096u, svmAllocationsManager, mockKernel.mockContext->getSpecialQueue()); @@ -1859,7 +1859,7 @@ HWTEST_F(KernelResidencyTest, givenSharedUnifiedMemoryAndNotRequiredMemSyncWhenM auto &commandStreamReceiver = this->pDevice->getUltCommandStreamReceiver(); auto svmAllocationsManager = mockKernel.mockContext->getSVMAllocsManager(); - auto unifiedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY), mockKernel.mockContext->getSpecialQueue()); + auto unifiedMemoryAllocation = svmAllocationsManager->createSharedUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY), mockKernel.mockContext->getSpecialQueue()); auto unifiedMemoryGraphicsAllocation = svmAllocationsManager->getSVMAlloc(unifiedMemoryAllocation); mockMemoryManager->pageFaultManager->insertAllocation(unifiedMemoryAllocation, 4096u, svmAllocationsManager, mockKernel.mockContext->getSpecialQueue()); @@ -1889,7 +1889,7 @@ HWTEST_F(KernelResidencyTest, givenSharedUnifiedMemoryAllocPageFaultManagerAndIn auto &commandStreamReceiver = this->pDevice->getUltCommandStreamReceiver(); auto svmAllocationsManager = mockKernel.mockContext->getSVMAllocsManager(); - auto unifiedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY), mockKernel.mockContext->getSpecialQueue()); + auto unifiedMemoryAllocation = svmAllocationsManager->createSharedUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::SHARED_UNIFIED_MEMORY), mockKernel.mockContext->getSpecialQueue()); mockMemoryManager->pageFaultManager->insertAllocation(unifiedMemoryAllocation, 4096u, svmAllocationsManager, mockKernel.mockContext->getSpecialQueue()); auto mockPageFaultManager = static_cast(mockMemoryManager->pageFaultManager.get()); @@ -1918,7 +1918,7 @@ HWTEST_F(KernelResidencyTest, givenKernelWhenSetKernelExecInfoWithUnifiedMemoryI auto &commandStreamReceiver = this->pDevice->getUltCommandStreamReceiver(); auto svmAllocationsManager = mockKernel.mockContext->getSVMAllocsManager(); - auto unifiedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY), nullptr); + auto unifiedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY)); auto unifiedMemoryGraphicsAllocation = svmAllocationsManager->getSVMAlloc(unifiedMemoryAllocation); EXPECT_EQ(0u, mockKernel.mockKernel->kernelUnifiedMemoryGfxAllocations.size()); @@ -1941,9 +1941,9 @@ HWTEST_F(KernelResidencyTest, givenKernelWhenclSetKernelExecInfoWithUnifiedMemor MockKernelWithInternals mockKernel(*this->pDevice); auto svmAllocationsManager = mockKernel.mockContext->getSVMAllocsManager(); - auto unifiedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY), nullptr); + auto unifiedMemoryAllocation = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY)); - auto unifiedMemoryAllocation2 = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY), nullptr); + auto unifiedMemoryAllocation2 = svmAllocationsManager->createUnifiedMemoryAllocation(4096u, SVMAllocsManager::UnifiedMemoryProperties(InternalMemoryType::DEVICE_UNIFIED_MEMORY)); auto status = clSetKernelExecInfo(mockKernel.mockKernel, CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL, sizeof(unifiedMemoryAllocation), &unifiedMemoryAllocation); EXPECT_EQ(CL_SUCCESS, status); diff --git a/unit_tests/memory_manager/unified_memory_manager_tests.cpp b/unit_tests/memory_manager/unified_memory_manager_tests.cpp index f1e864aed5..2533f35f2a 100644 --- a/unit_tests/memory_manager/unified_memory_manager_tests.cpp +++ b/unit_tests/memory_manager/unified_memory_manager_tests.cpp @@ -157,7 +157,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenDeviceAllocationIsCreatedThenItIsStoredW SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties; unifiedMemoryProperties.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY; auto allocationSize = 4096u; - auto ptr = svmManager->createUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, nullptr); + auto ptr = svmManager->createUnifiedMemoryAllocation(4096u, unifiedMemoryProperties); EXPECT_NE(nullptr, ptr); auto allocation = svmManager->getSVMAlloc(ptr); EXPECT_EQ(nullptr, allocation->cpuAllocation); @@ -176,7 +176,7 @@ TEST_F(SVMMemoryAllocatorTest, whenHostAllocationIsCreatedThenItIsStoredWithProp SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties; unifiedMemoryProperties.memoryType = InternalMemoryType::HOST_UNIFIED_MEMORY; auto allocationSize = 4096u; - auto ptr = svmManager->createUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, nullptr); + auto ptr = svmManager->createUnifiedMemoryAllocation(4096u, unifiedMemoryProperties); EXPECT_NE(nullptr, ptr); auto allocation = svmManager->getSVMAlloc(ptr); EXPECT_EQ(nullptr, allocation->cpuAllocation); @@ -196,7 +196,7 @@ TEST_F(SVMMemoryAllocatorTest, whenSharedAllocationIsCreatedThenItIsStoredWithPr SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties; unifiedMemoryProperties.memoryType = InternalMemoryType::SHARED_UNIFIED_MEMORY; auto allocationSize = 4096u; - auto ptr = svmManager->createUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, &cmdQ); + auto ptr = svmManager->createSharedUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, &cmdQ); EXPECT_NE(nullptr, ptr); auto allocation = svmManager->getSVMAlloc(ptr); EXPECT_EQ(nullptr, allocation->cpuAllocation); @@ -219,7 +219,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenSharedAllocationIsCreatedWithDebugFlagSe SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties; unifiedMemoryProperties.memoryType = InternalMemoryType::SHARED_UNIFIED_MEMORY; auto allocationSize = 4096u; - auto ptr = svmManager->createUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, &cmdQ); + auto ptr = svmManager->createSharedUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, &cmdQ); EXPECT_NE(nullptr, ptr); auto allocation = svmManager->getSVMAlloc(ptr); EXPECT_NE(nullptr, allocation->cpuAllocation); @@ -248,7 +248,7 @@ TEST_F(SVMLocalMemoryAllocatorTest, whenSharedAllocationIsCreatedWithLocalMemory SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties; unifiedMemoryProperties.memoryType = InternalMemoryType::SHARED_UNIFIED_MEMORY; auto allocationSize = 4096u; - auto ptr = svmManager->createUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, &cmdQ); + auto ptr = svmManager->createSharedUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, &cmdQ); EXPECT_NE(nullptr, ptr); auto allocation = svmManager->getSVMAlloc(ptr); EXPECT_NE(nullptr, allocation->cpuAllocation); @@ -276,7 +276,7 @@ TEST_F(SVMMemoryAllocatorTest, givenSharedAllocationsDebugFlagWhenDeviceMemoryIs SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties; unifiedMemoryProperties.memoryType = InternalMemoryType::DEVICE_UNIFIED_MEMORY; auto allocationSize = 4096u; - auto ptr = svmManager->createUnifiedMemoryAllocation(4096u, unifiedMemoryProperties, nullptr); + auto ptr = svmManager->createUnifiedMemoryAllocation(4096u, unifiedMemoryProperties); EXPECT_NE(nullptr, ptr); auto allocation = svmManager->getSVMAlloc(ptr); EXPECT_EQ(nullptr, allocation->cpuAllocation);