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
impl KernelVariant
Sourcepub fn tier(self) -> InstructionTier
pub fn tier(self) -> InstructionTier
Returns this variant’s precise instruction tier.
Sourcepub fn dot_i8(self, a: &[i8], b: &[i8]) -> i32
pub fn dot_i8(self, a: &[i8], b: &[i8]) -> i32
Computes an i8 dot product through this concrete table.
Sourcepub fn dot_f32(self, a: &[f32], b: &[f32]) -> f32
pub fn dot_f32(self, a: &[f32], b: &[f32]) -> f32
Computes an f32 dot product through this concrete table.
Sourcepub fn dot_f16(self, a: &[u16], b: &[u16]) -> f32
pub fn dot_f16(self, a: &[u16], b: &[u16]) -> f32
Computes an IEEE-f16-bits dot product through this concrete table.
Sourcepub fn hamming_u1(self, a: &[u8], b: &[u8]) -> u32
pub fn hamming_u1(self, a: &[u8], b: &[u8]) -> u32
Computes packed-byte Hamming distance through this concrete table.
Sourcepub fn dot_i8_batch(self, q: &[i8], rows: &[i8], d: usize, out: &mut [i32])
pub fn dot_i8_batch(self, q: &[i8], rows: &[i8], d: usize, out: &mut [i32])
Scores contiguous i8 rows through this concrete table.
Sourcepub fn hamming_u1_batch(
self,
q: &[u8],
rows: &[u8],
d_bytes: usize,
out: &mut [u32],
)
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.
Sourcepub fn dot_bit4(self, q: &[i8], codes: &[u8]) -> i32
pub fn dot_bit4(self, q: &[i8], codes: &[u8]) -> i32
Scores a signed-byte query against one packed four-bit row.
Sourcepub fn dot_bit4_batch(self, q: &[i8], rows: &[u8], d: usize, out: &mut [i32])
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.
Sourcepub fn score_bit4_ptrs(
&self,
query: (&[i8], i32, f64),
rows: &Bit4Rows4<'_>,
factors: &[Bit4Factors; 4],
out: &mut [f32; 4],
) -> Result<(), GatherShapeError>
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.