Skip to main content

KernelVariant

Struct KernelVariant 

Source
pub struct KernelVariant { /* private fields */ }
Expand description

One concrete runtime dispatch table.

Variants are exposed so the scalar oracle, property suite, fuzzer, and future frontier harness can evaluate every arm independently of the global once-selected default.

Implementations§

Source§

impl KernelVariant

Source

pub fn scalar() -> Self

Returns the scalar oracle variant.

Source

pub fn arm(self) -> KernelArm

Returns this variant’s runtime family.

Source

pub fn tier(self) -> InstructionTier

Returns this variant’s precise instruction tier.

Source

pub fn dot_i8(self, a: &[i8], b: &[i8]) -> i32

Computes an i8 dot product through this concrete table.

Source

pub fn dot_f32(self, a: &[f32], b: &[f32]) -> f32

Computes an f32 dot product through this concrete table.

Source

pub fn dot_f16(self, a: &[u16], b: &[u16]) -> f32

Computes an IEEE-f16-bits dot product through this concrete table.

Source

pub fn hamming_u1(self, a: &[u8], b: &[u8]) -> u32

Computes packed-byte Hamming distance through this concrete table.

Source

pub fn dot_i8_batch(self, q: &[i8], rows: &[i8], d: usize, out: &mut [i32])

Scores contiguous i8 rows through this concrete table.

Source

pub fn hamming_u1_batch( self, q: &[u8], rows: &[u8], d_bytes: usize, out: &mut [u32], )

Scores contiguous packed-bit rows through this concrete table.

Source

pub fn dot_bit4(self, q: &[i8], codes: &[u8]) -> i32

Scores a signed-byte query against one packed four-bit row.

Source

pub fn dot_bit4_batch(self, q: &[i8], rows: &[u8], d: usize, out: &mut [i32])

Scores a signed-byte query against contiguous packed four-bit rows.

Source

pub fn score_bit4_ptrs( &self, query: (&[i8], i32, f64), rows: &Bit4Rows4<'_>, factors: &[Bit4Factors; 4], out: &mut [f32; 4], ) -> Result<(), GatherShapeError>

Scores four arbitrary validated packed four-bit rows through this table.

§Safety

Bit4Rows4::from_rows proves that every row address is readable for a common width and that the mapped regions outlive this call. This method checks that the width equals q.len().div_ceil(2) and that the supported dimension bound holds. No row alignment is required.

Trait Implementations§

Source§

impl Clone for KernelVariant

Source§

fn clone(&self) -> KernelVariant

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for KernelVariant

Source§

impl Debug for KernelVariant

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.