---
title: SetDenormAreZeros
description: "启用或禁用刷零模式："
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2200/accel/kunpengaccel_hmpp_06_0040.html
sourcePath: /source/zh/kunpengboostkithistory/2200/accel/kunpengaccel_hmpp_06_0040.html
indexId: c5285aa470e36282b80673d82660ae7839de04d1889c5d76e696349070e5955b75
---
# SetDenormAreZeros

启用或禁用刷零模式：

HmppResult HMPP_SetDenormAreZeros (int32_t value);

#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| value | 0表示禁用 非0表示启用 | int32\_t值范围 | 输入 |


#### 返回值

- 成功：返回HMPP_STS_NO_ERR。
- 失败：返回错误码。


#### 错误码

| 错误码 | 描述 |
| --- | --- |
| HMPP\_STS\_NOT\_SUPPORT | 当前系统不是aarch64架构，不支持此函数。 |


#### 示例

```
#define LEN 4
void  SetDenormAreZeros_Example()
{
HmppResult result = HMPP_SetDenormAreZeros(1);
cout << HMPP_GetStatusString(result) << endl;
const float a[LEN] = {0.99 * pow(2, -126), 1.0 * pow(2, -126),
1.5 * pow(2, -126), 1.5 * pow(2, -126)};
const float b[LEN] = {0.99 * pow(2, -126), 0.99 * pow(2, -126),
1.4 * pow(2, -126), -1.4 * pow(2, -126)};
for (int32_t i = 0; i < LEN; ++i) {
cout << a[i] + b[i] << endl;
}
result = HMPP_SetDenormAreZeros(0);
cout << HMPP_GetStatusString(result) << endl;
for (int32_t i = 0; i < LEN; ++i) {
cout << a[i] + b[i] << endl;
}
}
```

运行结果：

```
No Error
1.17549e-38
3.40893e-38
No Error
2.32748e-38
2.33923e-38
3.40893e-38
1.17549e-39
```
