Skip to main content

Module f16_convert

Module f16_convert 

Source
Expand description

F16 (half-precision) conversion kernel.

Matches f16-conversion-v1.yaml. IEEE 754 half-precision ↔ single-precision conversion via bit manipulation.

Each function provides one of three backends:

  • fn f16_to_f32_scalar(...) / fn f32_to_f16_scalar(...) – Pure Rust scalar
  • unsafe fn f16_to_f32_avx2(...) – AVX2 SIMD implementation
  • fn f16_convert_ptx() -> &'static str – PTX assembly source string

Functions§

f16_convert_ptx
PTX assembly for f16→f32 conversion.
f16_to_f32_avx2
AVX2 f16→f32 conversion – delegates to scalar.
f16_to_f32_scalar
Batch convert f16 bit patterns to f32 (scalar reference).
f16_to_f32_single
Convert a half-precision (f16) bit pattern to f32.
f32_to_f16_avx2
AVX2 f32→f16 conversion – delegates to scalar.
f32_to_f16_scalar
Batch convert f32 to f16 bit patterns (scalar reference).
f32_to_f16_single
Convert an f32 value to f16 bit pattern.