SWDEV-144570 - Fix pointer attribute query.

	- For memory not registered with runtime, return
	  `hipErrorInvalidValue`. That's the behavior expected to check whether
	  a host buffer is pinned.
	- Return `hipErrorInvalidDevice` in case a registered memory object
	  cannot find its matching device.

	RB: http://ocltc.amd.com/reviews/r/17094/

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_memory.cpp#51 edit


[ROCm/clr commit: f695910290]
Этот коммит содержится в:
foreman
2019-04-05 14:51:37 -04:00
родитель a0f0714729
Коммит 00680db557
+3 -9
Просмотреть файл
@@ -1459,18 +1459,12 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void
for (auto& ctx : g_devices) {
if (*ctx == memObjCtx) {
attributes->device = device;
break;
HIP_RETURN(hipSuccess);
}
++device;
}
} else {
attributes->memoryType = hipMemoryTypeHost;
attributes->hostPointer = (void*)ptr;
attributes->devicePointer = 0;
attributes->device = -1;
attributes->isManaged = 0;
attributes->allocationFlags = 0;
HIP_RETURN(hipErrorInvalidDevice);
}
HIP_RETURN(hipSuccess);
HIP_RETURN(hipErrorInvalidValue);
}