diff --git a/projects/clr/hipamd/src/hip_memory.cpp b/projects/clr/hipamd/src/hip_memory.cpp index 6ff0939b2c..a0b6bcf6b7 100644 --- a/projects/clr/hipamd/src/hip_memory.cpp +++ b/projects/clr/hipamd/src/hip_memory.cpp @@ -3454,7 +3454,17 @@ hipError_t ihipPointerGetAttributes(void* data, hipPointer_attribute attribute, switch (attribute) { case HIP_POINTER_ATTRIBUTE_CONTEXT : { - status = hipErrorNotSupported; + if (memObj) { + amd::Context& context = memObj->getContext(); + int devId = getDeviceID(context); + if (devId >= 0) { + *reinterpret_cast(data) = reinterpret_cast(g_devices[devId]); + } else { + return hipErrorInvalidValue; + } + } else { + return hipErrorInvalidValue; + } break; } case HIP_POINTER_ATTRIBUTE_MEMORY_TYPE : {