SetHF32TransMode

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Sets the HF32 rounding mode. You must first enable HF32 rounding mode using SetHF32Mode.

Prototype

1
__aicore__ inline void SetHF32TransMode(HF32TransMode mode)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

mode

Input

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

  • NEAREST_ZERO: FP32 will be rounded toward zero when converted to HF32.
  • NEAREST_EVEN: FP32 is rounded to the nearest even integer when converted to HF32.

Returns

None

Restrictions

None

Examples

Set the HF32 rounding mode. You must first enable HF32 rounding mode using SetHF32Mode.

1
AscendC::SetHF32TransMode(HF32TransMode::NEAREST_ZERO);