gen_dispatcher_codelet!() { /* proc-macro */ }Expand description
Generate a cached ISA runtime dispatcher for a SIMD codelet.
Emits a function codelet_simd_{size}_cached_{ty}(data, sign) that caches
the best ISA level in an AtomicU8 static, avoiding repeated
is_x86_feature_detected! / is_aarch64_feature_detected! calls on hot
paths. The cached dispatcher delegates to the same arch-specific inner
functions as the uncached codelet_simd_{size}<T> dispatcher.
§Arguments
size— DFT size: 2, 4, 8, or 16ty— float type:f32orf64
§Priority order (high → low)
x86_64: AVX-512F > AVX2+FMA > AVX > SSE2 > scalaraarch64: NEON > scalar- other: scalar
§Example
ⓘ
gen_dispatcher_codelet!(size = 4, ty = f32);
// emits: pub fn codelet_simd_4_cached_f32(data: &mut [Complex<f32>], sign: i32)