Function: query_device_status

Applicable Products

  • Ascend 950PR&950DT products: Supported
  • Atlas A3 products: Supported
  • Atlas A2 products: Supported
  • Atlas 200I/500 A2 inference products: Supported
  • Atlas inference products: Supported
  • Atlas training products: Supported

Function

Queries the status of a device (normal or abnormal).

Prototype

  • C Prototype

    aclError aclrtQueryDeviceStatus(int32_t deviceId, aclrtDeviceStatus *deviceStatus)
    
  • Python Function

    device_status, ret = acl.rt.query_device_status(device_id)
    

Parameters

Parameter Description
device_id Int, device ID.
After the number of available devices is obtained by calling acl.rt.get_device_count, the value range of the device ID is [0, Number of available devices – 1].

Return Values

Return Value Description
device_status Int, device status. For details, see aclrtDeviceStatus.
ret Int, error code. If 0 is returned, the operation is successful. If other values are returned, the operation fails.