Skip to main content

SimdBackend

Trait SimdBackend 

Source
pub trait SimdBackend {
    type U8x32;
    type I8x32;
    type F32x8;
    type U64x4;

    // Required methods
    fn l1_distance_u8(a: Self::U8x32, b: Self::U8x32) -> Self::U8x32;
    fn dot_i8(a: Self::I8x32, b: Self::I8x32) -> i32;
    fn dot_f32(a: Self::F32x8, b: Self::F32x8) -> f32;
}
Expand description

Trait for SIMD backend abstraction.

This allows the algorithm code to be generic over the backend, enabling A/B testing and gradual migration to core::simd.

Required Associated Types§

Source

type U8x32

32 x u8 vector type

Source

type I8x32

32 x i8 vector type

Source

type F32x8

8 x f32 vector type

Source

type U64x4

4 x u64 vector type

Required Methods§

Source

fn l1_distance_u8(a: Self::U8x32, b: Self::U8x32) -> Self::U8x32

Compute L1 distance between two u8 vectors

Source

fn dot_i8(a: Self::I8x32, b: Self::I8x32) -> i32

Compute dot product of two i8 vectors

Source

fn dot_f32(a: Self::F32x8, b: Self::F32x8) -> f32

Compute dot product of two f32 vectors

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§