Skip to main content

SimdArch

Trait SimdArch 

Source
pub trait SimdArch:
    Sealed
    + Send
    + Sync
    + 'static
    + Copy
    + Clone {
    const NAME: &'static str;
    const REGISTER_WIDTH_BITS: u32;
    const ISA_FAMILY: IsaFamily;
    const FMA_THROUGHPUT_HINT: u32;

    // Required method
    fn is_runtime_supported() -> bool;
}
Expand description

Trait representing a SIMD instruction set architecture.

Implemented by Zero-Sized Types (ZSTs). Constants are queryable without a scalar type parameter — contrast with SimdKernel<T> which requires T to be known.

Required Associated Constants§

Source

const NAME: &'static str

Human-readable ISA name ("avx2", "avx512", "neon", "scalar").

Source

const REGISTER_WIDTH_BITS: u32

Width of vector registers in bits.

ArchitectureWidth
Scalar0
Neon128
Avx2256
Avx512512
Source

const ISA_FAMILY: IsaFamily

ISA family for this architecture.

Source

const FMA_THROUGHPUT_HINT: u32

Suggested TILE_M value for tiled_dot to saturate FMA throughput.

This is a hint, not a constraint. Optimal values:

  • Scalar: 1 (no tiling benefit)
  • Neon: 4 (4 NEON regs × 4-cycle FMA latency)
  • Avx2: 4 (16 YMM / TILE_M=4 leaves headroom for loop overhead)
  • Avx512: 8 (32 ZMM / TILE_M=8 saturates two FMA ports)

Required Methods§

Source

fn is_runtime_supported() -> bool

Returns true when the current host may execute this architecture’s native instructions from safe wrappers.

Emulated backends return true; native ISA backends must include the OS-enabled register-state checks covered by the platform feature probe.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§