MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / to_bf_precision

Function to_bf_precision

support/Bfloat16.h:84–90  ·  view source on GitHub ↗

Truncate a float to bf16 precision. * * @param[in] v F32 value to truncate to bfloat16 precision * * @return Truncated float */

Source from the content-addressed store, hash-verified

82 * @return Truncated float
83 */
84inline float to_bf_precision(float v)
85{
86 uint32_t resu32 = ((uint32_t)(float_to_bf16(v)) << 16);
87 float resf32;
88 memcpy(&resf32, &resu32, sizeof resf32);
89 return resf32;
90}
91
92/** Convert bfloat16 to float
93 *

Callers 1

gemmFunction · 0.85

Calls 1

float_to_bf16Function · 0.85

Tested by

no test coverage detected