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§

Source§

impl SimdArch for AmxBf16

Source§

const NAME: &'static str = "amx_bf16"

Source§

const REGISTER_WIDTH_BITS: u32 = 8192

Source§

const ISA_FAMILY: IsaFamily = IsaFamily::X86

Source§

const FMA_THROUGHPUT_HINT: u32 = 16

Source§

impl SimdArch for AmxInt8

Source§

const NAME: &'static str = "amx_int8"

Source§

const REGISTER_WIDTH_BITS: u32 = 8192

Source§

const ISA_FAMILY: IsaFamily = IsaFamily::X86

Source§

const FMA_THROUGHPUT_HINT: u32 = 16

Source§

impl SimdArch for Avx2

Source§

const NAME: &'static str = "avx2"

Source§

const REGISTER_WIDTH_BITS: u32 = 256

Source§

const ISA_FAMILY: IsaFamily = hermes_simd_core::arch::IsaFamily::X86

Source§

const FMA_THROUGHPUT_HINT: u32 = 4

Source§

impl SimdArch for Avx512

Source§

const NAME: &'static str = "avx512"

Source§

const REGISTER_WIDTH_BITS: u32 = 512

Source§

const ISA_FAMILY: IsaFamily = hermes_simd_core::arch::IsaFamily::X86

Source§

const FMA_THROUGHPUT_HINT: u32 = 8

Source§

impl SimdArch for AvxVnni

Source§

const NAME: &'static str = "avx_vnni"

Source§

const REGISTER_WIDTH_BITS: u32 = 256

Source§

const ISA_FAMILY: IsaFamily = hermes_simd_core::arch::IsaFamily::X86

Source§

const FMA_THROUGHPUT_HINT: u32 = 4

Source§

impl SimdArch for Neon

Source§

const NAME: &'static str = "neon"

Source§

const REGISTER_WIDTH_BITS: u32 = 128

Source§

const ISA_FAMILY: IsaFamily = hermes_simd_core::arch::IsaFamily::AArch64

Source§

const FMA_THROUGHPUT_HINT: u32 = 4

Source§

impl SimdArch for Scalar

Source§

const NAME: &'static str = "scalar"

Source§

const REGISTER_WIDTH_BITS: u32 = 0

Source§

const ISA_FAMILY: IsaFamily = hermes_simd_core::arch::IsaFamily::Scalar

Source§

const FMA_THROUGHPUT_HINT: u32 = 1

Source§

impl SimdArch for SveArch

Source§

const NAME: &'static str = "sve-emulated"

Source§

const REGISTER_WIDTH_BITS: u32 = 512

Source§

const ISA_FAMILY: IsaFamily = IsaFamily::AArch64

Source§

const FMA_THROUGHPUT_HINT: u32 = 4