aclFloatToFloat16

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

Atlas training product

Description

Converts data from float32 to aclFloat16.

Prototype

1
aclFloat16 aclFloatToFloat16(float value)

Parameters

Parameter

Input/Output

Description

value

Input

Data to convert.

Returns

Result data.

Note: The C language does not support the float16 type. Therefore, the return value is stored in uint16_t format. If printing is required, convert the value in uint16_t format to a value in float16 or float type first.