---
title: Expand
description: "该函数用于将TilingData扩展指定的大小。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00686.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00686.html
indexId: 80599519489eb4cb0dde3731fcf684156cfc17484a02ad5e20f73f37ace35a3f78
---
# Expand

#### 函数功能

该函数用于将TilingData扩展指定的大小。


#### 函数原型

```
void *Expand(size_t size)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| size | 输入 | 需要扩展的大小，单位为字节。 |


#### 返回值说明

返回扩展对应size后TilingData的内存地址。


#### 约束说明

扩展后的总大小不能超过TilingData的最大容量。


#### 调用示例

```
auto td_buf = TilingData::CreateCap(100U);
auto td = reinterpret_cast<TilingData *>(td_buf.get());
auto ptr = td->Expand(64U);
size_t cap = td->GetCapacity(); // 64U
```
