---
title: GetPrimaryFormat
description: "获取根format，去除关于C0的信息，只保留单纯的format信息。例如，将FORMAT_FRACTAL_Z_C04转为FORMAT_FRACTAL_Z。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasascendc_api_07_1104.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasascendc_api_07_1104.html
indexId: 92f53dac072410339269305c338584784c729ee574c081ab0534efd31db1a2e570
---
# GetPrimaryFormat

#### 功能说明

获取根format，去除关于C0的信息，只保留单纯的format信息。例如，将FORMAT_FRACTAL_Z_C04转为FORMAT_FRACTAL_Z。


#### 函数原型

```
int32_t GetPrimaryFormat(int32_t format)
```

```
Format GetPrimaryFormat(Format format)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| format | 输入 | 原始目标数据格式。 |


#### 返回值说明

去除C0信息后的格式。


#### 约束说明

无


#### 调用示例

```
// 判断当input的storage format是fractal z时，返回
void Func(const aclTensor *input) {
    if (GetPrimaryFormat(input->GetStorageFormat()) == FORMAT_FRACTAL_Z) {
        return;
    }
}
```
