P4 to Git Change 2049240 by lmoriche@lmoriche_opencl_dev2 on 2019/12/20 13:54:17

SWDEV-216705 - [hipclang-vdi-rocm][FBA-80]Test crash when all GPUs are hidden by ROCR_VISIBLE_DEVICES

	Return an error instead of dereferencing a null pointer. This should address the issue described
	in the ticket, but more places need fixing in the runtime to avoid crashes for corner cases.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_platform.cpp#59 edit


[ROCm/hip commit: 0c35aa5f1c]
This commit is contained in:
foreman
2019-12-20 13:02:52 -06:00
rodzic 9d6cc4d642
commit a1e5fb0c3c
@@ -569,6 +569,9 @@ extern "C" hipError_t hipLaunchKernel(const void *hostFunction,
stream);
int deviceId = ihipGetDevice();
if (deviceId == -1) {
HIP_RETURN(hipErrorNoDevice);
}
hipFunction_t func = PlatformState::instance().getFunc(hostFunction, deviceId);
if (func == nullptr) {
HIP_RETURN(hipErrorInvalidDeviceFunction);