From 40726aa9a1699a5d804696b0495b5c7efc7bd9c0 Mon Sep 17 00:00:00 2001 From: Aditya Avinash Atluri Date: Fri, 26 Feb 2016 18:50:40 -0600 Subject: [PATCH] Corrected hipPointerGetAttribute Made hipPointerGetAttribute work same as cudaPointerGetAttribute for HCC [ROCm/clr commit: 2ca6162593287ee191244412d453970185ddf442] --- projects/clr/hipamd/src/hip_hcc.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_hcc.cpp b/projects/clr/hipamd/src/hip_hcc.cpp index e3770b7001..aa2cae652e 100644 --- a/projects/clr/hipamd/src/hip_hcc.cpp +++ b/projects/clr/hipamd/src/hip_hcc.cpp @@ -1732,7 +1732,12 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t *attributes, void* ptr) attributes->hostPointer = amPointerInfo._hostPointer; attributes->devicePointer = amPointerInfo._devicePointer; attributes->isManaged = 0; - + if(attributes->memoryType == hipMemoryTypeHost){ + attributes->hostPointer = ptr; + } + if(attributes->memoryType == hipMemoryTypeDevice){ + attributes->devicePointer = ptr; + } attributes->allocationFlags = amPointerInfo._appAllocationFlags; attributes->device = amPointerInfo._appId;