$darkmode
#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Functions | |
| void | convert_float_to_half_simd (const float *src, uint16_t *dst, size_t count) |
| Converts an array of 32-bit floats to 16-bit half-floats using SIMD (AVX2/F16C). More... | |
| void convert_float_to_half_simd | ( | const float * | src, |
| uint16_t * | dst, | ||
| size_t | count | ||
| ) |
Converts an array of 32-bit floats to 16-bit half-floats using SIMD (AVX2/F16C).
This function utilizes hardware acceleration to perform the conversion significantly faster than a scalar implementation. It falls back to a scalar loop for the remaining elements (tail) or if SIMD is completely unavailable at compile time.
| src | Pointer to the source array of floats. |
| dst | Pointer to the destination array of half-floats (uint16_t storage). |
| count | Number of elements to convert. |