SetHF32TransMode

Supported Products

Product

Supported/Unsupported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference product's AI Core

x

Atlas inference product's Vector Core

x

Atlas training products

x

Function Usage

Sets the HF32 rounding mode. You need to enable the HF32 rounding mode by using SetHF32Mode first.

Prototype

1
__aicore__ inline void SetHF32TransMode(bool hf32TransMode)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

hf32TransMode

Input

Input parameter for controlling the MMAD HF32 rounding mode. The value is of the Boolean type. The options are as follows:

  • true: FP32 is rounded to zero as HF32.
  • false: FP32 is rounded to the nearest even integer as HF32.

Returns

None

Constraints

None

Example

1
2
bool hf32TransMode = true;
AscendC::SetHF32TransMode(hf32TransMode);