Update error codes for hipGetDevice for doxygen and move up null check (#1668)
* [docs] Update error codes for hipGetDevice * Move up out ptr check
Dieser Commit ist enthalten in:
committet von
Maneesh Gupta
Ursprung
8519a1411c
Commit
b3161e9fa0
@@ -33,18 +33,16 @@ hipError_t hipGetDevice(int* deviceId) {
|
||||
HIP_INIT_API(hipGetDevice, deviceId);
|
||||
|
||||
hipError_t e = hipSuccess;
|
||||
if (deviceId == nullptr)
|
||||
return ihipLogStatus(hipErrorInvalidValue);
|
||||
|
||||
auto ctx = ihipGetTlsDefaultCtx();
|
||||
|
||||
if (deviceId != nullptr) {
|
||||
if (ctx == nullptr) {
|
||||
e = hipErrorInvalidDevice; // TODO, check error code.
|
||||
*deviceId = -1;
|
||||
} else {
|
||||
*deviceId = ctx->getDevice()->_deviceId;
|
||||
}
|
||||
if (ctx == nullptr) {
|
||||
e = hipErrorInvalidDevice; // TODO, check error code.
|
||||
*deviceId = -1;
|
||||
} else {
|
||||
e = hipErrorInvalidValue;
|
||||
*deviceId = ctx->getDevice()->_deviceId;
|
||||
}
|
||||
|
||||
return ihipLogStatus(e);
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren