---
title: aclrtQueryDeviceStatus
description: "查询Device状态是正常可用、还是异常不可用。同步接口。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgc/aclcppdevg_03_0036.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgc/aclcppdevg_03_0036.html
indexId: 26652e051cb0c2f53613592e43b48ca45201d002d008182c9b140437db3e16b7105
---
# aclrtQueryDeviceStatus

#### 函数功能

查询Device状态是正常可用、还是异常不可用。同步接口。


#### 函数原型

aclError aclrtQueryDeviceStatus(int32_t deviceId, aclrtDeviceStatus *deviceStatus)


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| deviceId | 输入 | Device ID。 用户调用aclrtGetDeviceCount接口获取可用的Device数量后，这个Device ID的取值范围：[0, (可用的Device数量\-1)] |
| deviceStatus | 输出 | Device状态。 |


#### 返回值说明

返回0表示成功，返回其它值表示失败。
