SWDEV-508962 - [6.4 Preview] Update hipPointerGetAttributes to match CUDA > 11.0 behavior (#120) (#363)

[ROCm/clr commit: 0b64eec921]
이 커밋은 다음에 포함됨:
Assiouras, Ioannis 작성하고 GitHub가 2025-05-21 21:18:05 +05:30를 커밋함
1 부모 3ea732b38a
커밋 6467351f4c
1 파일이 변경됨
+5 -3
+5 -3
파일 보기
@@ -3357,11 +3357,11 @@ hipError_t hipHostGetDevicePointer(void** devicePointer, void* hostPointer, unsi
hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void* ptr) {
HIP_INIT_API(hipPointerGetAttributes, attributes, ptr);
if (attributes == nullptr || ptr == nullptr) {
if (attributes == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
size_t offset = 0;
amd::Memory* memObj = getMemoryObject(ptr, offset);
amd::Memory* memObj = (ptr != nullptr) ? getMemoryObject(ptr, offset) : nullptr;
int device = 0;
device::Memory* devMem = nullptr;
memset(attributes, 0, sizeof(hipPointerAttribute_t));
@@ -3406,7 +3406,9 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void
attributes->isManaged = false;
attributes->allocationFlags = 0;
attributes->device = hipInvalidDeviceId;
LogPrintfError("Cannot get amd_mem_obj for ptr: %p", ptr);
if (ptr != nullptr) {
LogPrintfError("Cannot get amd_mem_obj for ptr: %p", ptr);
}
}
HIP_RETURN(hipSuccess);
}