Skip to main content

Clifford3BitCacheLine64

Struct Clifford3BitCacheLine64 

Source
#[repr(C, align(64))]
pub struct Clifford3BitCacheLine64 { pub words: [Clifford3BitWord64; 8], }
Expand description

64-byte Cache-Line Block of 128 weights. Holds exactly 8 x Clifford3BitWord64 words = 128 weights. Size is exactly 64 bytes (1 L1d cache line) and 64-byte cache-line aligned.

Fields§

§words: [Clifford3BitWord64; 8]

Implementations§

Source§

impl Clifford3BitCacheLine64

Source

pub const CAPACITY: usize = 128

Source

pub fn pack_128(weights: &[f32; 128]) -> Self

Packs 128 float weights into a single 64-byte cache line block. Automatically computes optimal per-16 sub-block standard deviation scales.

Source

pub fn unpack_128(&self, out: &mut [f32; 128])

Unpacks all 128 float weights into destination slice.

Source

pub fn as_bytes(&self) -> &[u8; 64]

Returns a direct 64-byte slice view of this cache line block.

Source

pub fn slice_as_bytes(slice: &[Self]) -> &[u8] ⓘ

Converts a slice of cache lines into a contiguous byte slice without allocations.

Source

pub fn slice_from_bytes(bytes: &[u8]) -> Result<&[Self], String>

Casts an aligned slice of bytes into a slice of 64-byte cache lines.

Source

pub fn dot_128(&self, x: &[f32; 128]) -> f32

Evaluates direct dot product of this 128-weight cache line against an activation slice.

Trait Implementations§

Source§

impl Clone for Clifford3BitCacheLine64

Source§

fn clone(&self) -> Self

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 Clifford3BitCacheLine64

Source§

impl Debug for Clifford3BitCacheLine64

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Clifford3BitCacheLine64

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Clifford3BitCacheLine64

Source§

impl PartialEq for Clifford3BitCacheLine64

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Clifford3BitCacheLine64

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.