fallthrough if deviceId pointer is null

Change-Id: I924996d60d0286a7be1d18881ee733459de2981c
这个提交包含在:
Aditya Atluri
2016-09-27 11:47:58 -05:00
父节点 977918badf
当前提交 57872d2a88
+9 -5
查看文件
@@ -33,11 +33,15 @@ hipError_t hipGetDevice(int *deviceId)
auto ctx = ihipGetTlsDefaultCtx();
if (ctx == nullptr) {
e = hipErrorInvalidDevice; // TODO, check error code.
*deviceId = -1;
} else {
*deviceId = ctx->getDevice()->_deviceId;
if(deviceId != nullptr){
if (ctx == nullptr) {
e = hipErrorInvalidDevice; // TODO, check error code.
*deviceId = -1;
} else {
*deviceId = ctx->getDevice()->_deviceId;
}
}else{
e = hipErrorInvalidDevice;
}
return ihipLogStatus(e);