From 4bb97d3f6afb68f9a06ef2c79c015872816554e2 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Wed, 23 Sep 2020 21:26:07 +0000 Subject: [PATCH] Return hipMemoryTypeHost as memory type for hipHostRegistered pointer Fixes SWDEV-253741 Change-Id: I42c2c9df00862157314d5767b6f175a0d2f28b47 [ROCm/hip commit: a3e5e6360ff3c055f6a57aaf0740a056b781f691] --- projects/hip/rocclr/hip_memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/hip/rocclr/hip_memory.cpp b/projects/hip/rocclr/hip_memory.cpp index 63685f275b..54ac5bb1d4 100755 --- a/projects/hip/rocclr/hip_memory.cpp +++ b/projects/hip/rocclr/hip_memory.cpp @@ -2038,7 +2038,7 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void memset(attributes, 0, sizeof(hipPointerAttribute_t)); if (memObj != nullptr) { - attributes->memoryType = (CL_MEM_SVM_FINE_GRAIN_BUFFER & memObj->getMemFlags())? hipMemoryTypeHost : hipMemoryTypeDevice; + attributes->memoryType = ((CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_USE_HOST_PTR) & memObj->getMemFlags())? hipMemoryTypeHost : hipMemoryTypeDevice; if (attributes->memoryType == hipMemoryTypeHost) { attributes->hostPointer = static_cast(memObj->getSvmPtr()) + offset; }