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

#### 产品支持情况

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


#### 功能说明

根据模型描述信息和图索引获取图执行时所需的权值内存大小、工作内存大小。


#### 函数原型

```
aclError aclmdlBundleGetSize(const aclmdlBundleQueryInfo *queryInfo, size_t index, size_t *workSize, size_t *constWeightSize)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| queryInfo | 输入 | 需提前调用aclmdlBundleCreateQueryInfo接口创建aclmdlBundleQueryInfo类型的数据。 |
| index | 输入 | 索引。 用户调用aclmdlBundleGetQueryModelNum接口获取模型中的图总数后，这个index的取值范围：[0, (图总数\-1)]。 |
| workSize | 输出 | 图执行时所需的工作内存大小的指针，单位Byte。 此处的内存为Device内存，而且需要用户申请和释放。 |
| weightSize | 输出 | 图执行时所需权值内存大小的指针，单位Byte。 此处的内存为Device内存，而且需要用户申请和释放。 |


#### 返回值说明

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


#### 接口调用示例

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