From d78aef7f66e7ffc289062c2e04e2dccf7f02a30a Mon Sep 17 00:00:00 2001 From: sdashmiz Date: Wed, 2 Aug 2023 15:46:58 -0400 Subject: [PATCH] SWDEV-371332 - [ABI Break] Return success for unregistered ptr Signed-off-by: sdashmiz Change-Id: Ie58d16420578e7118997eb40a9fd6a6641b666f3 --- hipamd/src/hip_memory.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hipamd/src/hip_memory.cpp b/hipamd/src/hip_memory.cpp index 71445219c4..0d7af8267e 100644 --- a/hipamd/src/hip_memory.cpp +++ b/hipamd/src/hip_memory.cpp @@ -3411,10 +3411,16 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void attributes->type = hipMemoryTypeManaged; } HIP_RETURN(hipSuccess); + } else { + attributes->type = hipMemoryTypeUnregistered; + attributes->devicePointer = nullptr; + attributes->hostPointer = nullptr; + attributes->isManaged = false; + attributes->allocationFlags = 0; + attributes->device = hipInvalidDeviceId; + LogPrintfError("Cannot get amd_mem_obj for ptr: 0x%x \n", ptr); } - - LogPrintfError("Cannot get amd_mem_obj for ptr: %p \n", ptr); - HIP_RETURN(hipErrorInvalidValue); + HIP_RETURN(hipSuccess); } // ================================================================================================