diff --git a/hipamd/api/hip/hip_memory.cpp b/hipamd/api/hip/hip_memory.cpp index 5190bd4fdb..f34b9e99c0 100644 --- a/hipamd/api/hip/hip_memory.cpp +++ b/hipamd/api/hip/hip_memory.cpp @@ -1489,8 +1489,10 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void attributes->allocationFlags = memObj->getMemFlags() >> 16; amd::Context &memObjCtx = memObj->getContext(); - if (*hip::host_context == memObjCtx) + if (*hip::host_context == memObjCtx) { + attributes->device = ihipGetDevice(); HIP_RETURN(hipSuccess); + } for (auto& ctx : g_devices) { if (*ctx == memObjCtx) { attributes->device = device; diff --git a/hipamd/api/hip/hip_peer.cpp b/hipamd/api/hip/hip_peer.cpp index 9c2da315ca..14a41f9953 100644 --- a/hipamd/api/hip/hip_peer.cpp +++ b/hipamd/api/hip/hip_peer.cpp @@ -55,7 +55,7 @@ hipError_t hipDeviceCanAccessPeer(int* canAccessPeer, int deviceId, int peerDevi *canAccessPeer = 0; - return hipErrorInvalidDevice; + return HIP_RETURN(hipSuccess); } hipError_t hipDeviceDisablePeerAccess(int peerDeviceId) { @@ -106,4 +106,4 @@ hipError_t hipCtxDisablePeerAccess(hipCtx_t peerCtx) { assert(0 && "Unimplemented"); HIP_RETURN(hipErrorUnknown); -} \ No newline at end of file +}