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

#### 产品支持情况

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


#### 功能说明

获取当前昇腾AI软件栈的运行模式。


#### 函数原型

- C函数原型
  1 aclError aclrtGetRunMode(aclrtRunMode *runMode)

- python函数
  1 run_mode, ret = acl.rt.get_run_mode()


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| run\_mode | int，表示运行模式。类型定义请参见aclrtRunMode。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |


#### 资源参考

接口调用流程与示例，请参见运行时资源申请与释放(https://www.hiascend.comdocument/detail/zh/canncommercial/900/programug/acldevg/aclpythondevg_0009.html)。
