#[repr(transparent)]pub struct U4(pub u8);Expand description
Unsigned 4-bit integer element marker — packed-pair storage.
#[repr(transparent)] around u8. Packing convention is identical
to S4 (low nibble = even index, high nibble = odd index); the
only difference is zero-extension to s32 on the GPU side
(nibble & 0xF).
Numerical range per element: [0, 15]. Plan-layer conventions
(M/N/K in elements, LDs in storage slots, K even) match S4.
Routes through Ada Lovelace int4 tensor cores
(mma.sync.aligned.m16n8k64.row.col.satfinite.s32.u4.u4.s32) with
the same S32 accumulator and float α/β family as S4.
Tuple Fields§
§0: u8Implementations§
Trait Implementations§
impl Copy for U4
impl DeviceRepr for U4
impl Eq for U4
impl IntElement for U4
Source§impl KernelDtype for U4
impl KernelDtype for U4
Source§const KIND: ElementKind = ElementKind::U4
const KIND: ElementKind = ElementKind::U4
Runtime tag for this dtype. Stable across the workspace —
keyed by this same enum in
crate::KernelSku::element.Source§impl Ord for U4
impl Ord for U4
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for U4
impl PartialOrd for U4
impl StructuralPartialEq for U4
Auto Trait Implementations§
impl Freeze for U4
impl RefUnwindSafe for U4
impl Send for U4
impl Sync for U4
impl Unpin for U4
impl UnsafeUnpin for U4
impl UnwindSafe for U4
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