---
title: 函数：get_device_count
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclpythondevg_01_0067.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclpythondevg_01_0067.html
indexId: a5fa7abd760a393c95f807ae8e18fda09471f381b58df224bd67509391feeb2471
---
# 函数：get_device_count

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |


#### 功能说明

获取可用Device的数量。


#### 函数原型

- C函数原型
  1 aclError aclrtGetDeviceCount(uint32_t *count)

- python函数
  1 count, ret = acl.rt.get_device_count()


#### 参数说明

无


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| count | int，获取Device数量。 |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |
