From 77fd517e09a62f51f6ab1ab9de156409da384b85 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Sat, 8 Dec 2018 01:42:08 +0530 Subject: [PATCH] Fixed hipPointerGetAttributes for hostmalloced ptr --- hipamd/src/hip_memory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hipamd/src/hip_memory.cpp b/hipamd/src/hip_memory.cpp index 88bed0fb5c..56f64f35c6 100644 --- a/hipamd/src/hip_memory.cpp +++ b/hipamd/src/hip_memory.cpp @@ -187,14 +187,14 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void attributes->allocationFlags = amPointerInfo._appAllocationFlags; attributes->device = amPointerInfo._appId; - if (attributes->device < 0) { + if (attributes->device < -1) { e = hipErrorInvalidDevice; } } else { attributes->memoryType = hipMemoryTypeDevice; attributes->hostPointer = 0; attributes->devicePointer = 0; - attributes->device = -1; + attributes->device = -2; attributes->isManaged = 0; attributes->allocationFlags = 0;