ToBfloat16
Applicability
Product |
Supported/Unsupported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
|
x |
Function Usage
Converts scalar data of the float type to scalar data of the bfloat16_t type.
Prototype
1 | __aicore__ inline bfloat16_t ToBfloat16(const float& fVal) |
Parameters
Parameter |
Input/Output |
Meaning |
|---|---|---|
fVal |
Input |
Scalar data of the float type |
Returns
Converted scalar data of the bfloat16_t type.
Restrictions
None
Example
1 2 | float m = 3.0f; bfloat16_t n = AscendC::ToBfloat16(m); |
Parent topic: Scalar Computation