pub struct Codebook {
pub c_name: &'static str,
pub values: &'static [f32; 16],
}Expand description
The 16-entry value table a codebook format’s 4-bit code indexes.
One slice serves both halves of the kernel: kernel_src formats
Self::values into the emitted __constant__ array, and the Rust
dequant_twin beside it indexes the same values. There is no
second copy of the numbers to drift, which matters more here than
for an affine format – a codebook is 16 arbitrary constants that no
arithmetic can re-derive, so a single transposed pair would decode
every tensor slightly wrong and nothing would look obviously broken.
Fields§
§c_name: &'static strThe __constant__ array’s identifier in the emitted CUDA C.
Must be what dequant_src spells.
values: &'static [f32; 16]The values, code 0 first.
Trait Implementations§
impl Copy for Codebook
impl StructuralPartialEq for Codebook
Auto Trait Implementations§
impl Freeze for Codebook
impl RefUnwindSafe for Codebook
impl Send for Codebook
impl Sync for Codebook
impl Unpin for Codebook
impl UnsafeUnpin for Codebook
impl UnwindSafe for Codebook
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more