---
title: GetCoreMemBw
description: "获取硬件平台存储空间的带宽大小。硬件存储空间类型定义如下："
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendcopapi/atlasascendc_api_07_1035.html
sourcePath: /source/zh/canncommercial/900/API/ascendcopapi/atlasascendc_api_07_1035.html
indexId: 60931bbbb30f9b7902f5c33b0fe0e2db09292e2e79e4bc2ee95d50244c03926276
---
# GetCoreMemBw

#### 功能说明

获取硬件平台存储空间的带宽大小。硬件存储空间类型定义如下：

```
enum class CoreMemType {
    L0_A = 0, // 预留参数，暂不支持
    L0_B = 1, // 预留参数，暂不支持
    L0_C = 2, // 预留参数，暂不支持
    L1 = 3,   // 预留参数，暂不支持
    L2 = 4,
    UB = 5,   // 预留参数，暂不支持
    HBM = 6,
    RESERVED
};
```


#### 函数原型

```
void GetCoreMemBw(const CoreMemType &memType, uint64_t &bwSize) const
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| memType | 输入 | 硬件存储空间类型。 |
| bwSize | 输出 | 对应硬件的存储空间的带宽大小。单位是Byte/cycle，cycle代表时钟周期。 |


#### 返回值说明

无


#### 约束说明

无


#### 调用示例

```
ge::graphStatus TilingXXX(gert::TilingContext* context) {
    auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
    uint64_t l2_bw;
    ascendcPlatform.GetCoreMemBw(platform_ascendc::CoreMemType::L2, l2_bw);
    // ...
    return ret;
}
```
