---
title: aclmdlBundleGetModelId
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/aclcppdevg_03_0294.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/aclcppdevg_03_0294.html
indexId: f8b02f1b445dde8cbf1e2ef5a610e5a7b0d34da8f75665ece2af522a428ba59c72
---
# aclmdlBundleGetModelId

#### 产品支持情况

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


#### 功能说明

获取实际可执行的模型ID。

本接口需与其它接口配合使用，以便实现动态更新变量的目的，请参见aclmdlBundleLoadFromFile处的说明。


#### 函数原型

```
aclError aclmdlBundleGetModelId(uint32_t bundleId, size_t index, uint32_t *modelId)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| bundleId | 输入 | 通过aclmdlBundleLoadFromFile接口或aclmdlBundleLoadFromMem接口加载模型成功后返回的bundleId。 |
| index | 输入 | 索引。 用户调用aclmdlBundleGetModelNum接口获取模型数量后，这个index的取值范围：[0, (模型数量\-1)]。 |
| modelId | 输出 | 实际可执行的模型ID。 |


#### 返回值说明

返回0表示成功，返回其他值表示失败，请参见aclError。


#### 接口调用示例

接口调用流程及示例代码请参见权重更新（由系统管理内存）(https://www.hiascend.comdocument/detail/zh/canncommercial/900/programug/acldevg/aclcppdevg_000045.html)。
