pub const fn simd_width() -> usizeExpand description
Returns the SIMD width for the current build target.
Dispatches at compile time based on enabled features and target architecture:
- AVX2 (
x86_64): 8 lanes (256-bit / 32-bit float) - SSE2 / no-AVX2 (
x86_64without avx2): 4 lanes (128-bit) - NEON (aarch64): 4 lanes (128-bit)
- Other targets with
simd(wasm32, …): 1, no SIMD path, the scalar code runs - Scalar fallback (no
simdfeature): 1
Use the SIMD_WIDTH constant for a zero-cost compile-time value.