Skip to main content

Module complex

Module complex 

Source
Expand description

Generic interleaved complex kernels.

The public surface accepts primitive lane slices in [re, im, ...] order so domain crates can use their own complex storage types without Hermes taking a dependency on a concrete complex-number crate.

Arithmetic stays in vector registers for every (T, Arch) pair via the adjacent-pair shuffle and alternating-FMA primitives on SimdKernel:

  • a * b = fmaddsub(dup_even(a), b, mul(dup_odd(a), swap_adjacent(b)))
  • a * conj(b) = fmsubadd(dup_odd(a), swap_adjacent(b), mul(dup_even(a), b))

Runtime architecture selection is generated by #[runtime_dispatch], the same mechanism used by the dense kernels — no per-type provider impls and no OnceLock feature caching.

Functions§

interleaved_complex_dot
Computes an interleaved complex dot product using architecture A.
interleaved_complex_mul_assign
Multiplies interleaved complex values in-place using architecture A.