From b2e264b2c190843680d8ded595b0308763997141 Mon Sep 17 00:00:00 2001 From: Jason Tang Date: Fri, 19 Jun 2020 10:32:42 -0400 Subject: [PATCH] For apu: call commitSvmMemory() from Device::svmAlloc() Change-Id: Ic6e9b2ad4624e7e1c50835d3825254c76e764bf0 [ROCm/clr commit: 532083f87cb50847c1f5ab814f8b381706f4d8c3] --- projects/clr/rocclr/device/pal/paldevice.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/clr/rocclr/device/pal/paldevice.cpp b/projects/clr/rocclr/device/pal/paldevice.cpp index 035b5ad0f2..44e7a4c679 100755 --- a/projects/clr/rocclr/device/pal/paldevice.cpp +++ b/projects/clr/rocclr/device/pal/paldevice.cpp @@ -2237,6 +2237,10 @@ void* Device::svmAlloc(amd::Context& context, size_t size, size_t alignment, cl_ // add the information to context so that we can use it later. amd::MemObjMap::AddMemObj(mem->getSvmPtr(), mem); svmPtr = mem->getSvmPtr(); + + if (settings().apuSystem_ && gpuMem->isHostMemDirectAccess()) { + mem->commitSvmMemory(); + } } else { // find the existing amd::mem object mem = amd::MemObjMap::FindMemObj(svmPtr);