---
title: 函数：get_run_mode
description: "| C函数原型 | aclError aclrtGetRunMode(aclrtRunMode \\*runMode) |"
url: "https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application%20Development%20Guide/aadgp/aclpythondevg_01_0063.html"
---

# 函数：get_run_mode

| C函数原型 | aclError aclrtGetRunMode(aclrtRunMode \*runMode) |
| --- | --- |
| Python函数 | run\_mode, ret = acl.rt.get\_run\_mode() |
| 函数功能 | 获取当前昇腾AI软件栈的运行模式，同步接口。 |
| 输入说明 | 无 |
| 返回值说明 | run\_mode：int，表示运行模式。 0：ACL\_DEVICE，昇腾AI软件栈运行在Device的Control CPU或板端环境上。 1：ACL\_HOST，昇腾AI软件栈运行在Host CPU上。 ret：int，错误码。 返回0表示成功。 返回其它值表示失败。 |
| 约束说明 | 无 |
| 参考资源 | 接口调用流程与示例，请参见运行管理资源申请与释放。 |
