Skip to main content

SimdDescriptor

Trait SimdDescriptor 

Source
pub trait SimdDescriptor:
    Sized
    + Copy
    + Debug
    + Send
    + Sync {
    type F32Vec: F32SimdVec<Descriptor = Self>;
    type I32Vec: I32SimdVec<Descriptor = Self>;
    type U32Vec: U32SimdVec<Descriptor = Self>;
    type U16Vec: U16SimdVec<Descriptor = Self>;
    type U8Vec: U8SimdVec<Descriptor = Self>;
    type Mask: SimdMask<Descriptor = Self>;
    type Bf16Table8: Copy;
    type Descriptor256: SimdDescriptor<Descriptor256 = Self::Descriptor256>;
    type Descriptor128: SimdDescriptor<Descriptor128 = Self::Descriptor128>;

    // Required methods
    fn new() -> Option<Self>;
    fn maybe_downgrade_256bit(self) -> Self::Descriptor256;
    fn maybe_downgrade_128bit(self) -> Self::Descriptor128;
    fn call<R>(self, f: impl FnOnce(Self) -> R) -> R;
}

Required Associated Types§

Source

type F32Vec: F32SimdVec<Descriptor = Self>

Source

type I32Vec: I32SimdVec<Descriptor = Self>

Source

type U32Vec: U32SimdVec<Descriptor = Self>

Source

type U16Vec: U16SimdVec<Descriptor = Self>

Source

type U8Vec: U8SimdVec<Descriptor = Self>

Source

type Mask: SimdMask<Descriptor = Self>

Source

type Bf16Table8: Copy

Prepared 8-entry BF16 lookup table for fast approximate lookups. Use F32SimdVec::prepare_table_bf16_8 to create and F32SimdVec::table_lookup_bf16_8 to use.

Source

type Descriptor256: SimdDescriptor<Descriptor256 = Self::Descriptor256>

Source

type Descriptor128: SimdDescriptor<Descriptor128 = Self::Descriptor128>

Required Methods§

Source

fn new() -> Option<Self>

Source

fn maybe_downgrade_256bit(self) -> Self::Descriptor256

Returns a vector descriptor suitable for operations on vectors of length 256 (Self if the current vector type is suitable). Note that it might still be beneficial to use Self for .call(), as the compiler could make use of features from more advanced instruction sets.

Source

fn maybe_downgrade_128bit(self) -> Self::Descriptor128

Same as Self::maybe_downgrade_256bit, but for 128 bits.

Source

fn call<R>(self, f: impl FnOnce(Self) -> R) -> R

Calls the given closure within a target feature context. This enables establishing an unbroken chain of inline functions from the feature-annotated gateway up to the closure, allowing SIMD intrinsics to be used safely.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§