Skip to main content

Stages

Struct Stages 

Source
pub struct Stages<T: CubeType> { /* private fields */ }
Expand description

The depth slots of one buffered walk and the operands they are filled from.

Implementations§

Source§

impl Stages<OperandPair>

Source

pub fn consume_async<S: AsyncStage>(&mut self, walk: &Walk, stage: &S)

A compute plane’s side of walk, whose stages the filling planes fill by TMA: each stage issued through stage, and its slot freed only once what it issued completes. That is a stage later, so the reads of the previous stage run on beside the ones just issued, where the ring holds more than one slot; a ring of one waits for them at once.

Source

pub fn __expand_consume_async<S: AsyncStage>( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, walk: &<Walk as CubeType>::ExpandType, stage: &<S as CubeType>::ExpandType, )

A compute plane’s side of walk, whose stages the filling planes fill by TMA: each stage issued through stage, and its slot freed only once what it issued completes. That is a stage later, so the reads of the previous stage run on beside the ones just issued, where the ring holds more than one slot; a ring of one waits for them at once.

Source§

impl<T: CubeType> Stages<T>

Source

pub fn role(&self) -> Role

What this plane does with the stages’ slots; filler planes sit at the end of the cube.

Source

pub fn slot_mut(&mut self, index: usize) -> &mut Slot<T>

Slot index, known at comptime.

Source

pub fn __expand_role( scope: &Scope, this: &<Self as CubeType>::ExpandType, ) -> <Role as CubeType>::ExpandType

What this plane does with the stages’ slots; filler planes sit at the end of the cube.

Source

pub fn __expand_slot_mut<'infer, 'scope>( scope: &'scope Scope, this: &'infer mut <Self as CubeType>::ExpandType, index: usize, ) -> &'infer mut <Slot<T> as CubeType>::ExpandType

Slot index, known at comptime.

Source§

impl<P: Payload<P> + Clone + CubeType<ExpandType: Clone>> Stages<P>

Source

pub fn free(&self)

Free the shared memory every slot holds, for what the kernel declares after it to take: once the walk is over, nothing reads a stage again. Every unit of the cube reaches it, and a cube barrier comes before any unit touches what is declared in its place, as Tile::smem_accumulation and Tile::smem_cyclic_accumulation open with.

Source

pub fn fill(&mut self, slot: usize, region: &Region)

Fill slot slot from region’s window: one step of a Fill plane’s walk.

Source

pub fn __expand_free(scope: &Scope, this: &<Self as CubeType>::ExpandType)

Free the shared memory every slot holds, for what the kernel declares after it to take: once the walk is over, nothing reads a stage again. Every unit of the cube reaches it, and a cube barrier comes before any unit touches what is declared in its place, as Tile::smem_accumulation and Tile::smem_cyclic_accumulation open with.

Source

pub fn __expand_fill( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, slot: usize, region: &<Region as CubeType>::ExpandType, )

Fill slot slot from region’s window: one step of a Fill plane’s walk.

Source§

impl Stages<OperandPair>

Source

pub fn smem( walk: &Walk, lhs: &Tile, rhs: &Tile, storage: StageStorage, depth: usize, decoded: Option<ElemType>, ) -> Stages<OperandPair>

The depth slots staging both operands of a contraction into shared memory laid out as storage.

A stage whose fill decodes its operand, from scales, a codebook or fields as wide as their word, holds the values at decoded, or at f32 where None. An operand staged as it lies keeps its own element.

Source

pub fn __expand_smem( scope: &Scope, walk: &<Walk as CubeType>::ExpandType, lhs: &<Tile as CubeType>::ExpandType, rhs: &<Tile as CubeType>::ExpandType, storage: StageStorage, depth: usize, decoded: Option<ElemType>, ) -> <Stages<OperandPair> as CubeType>::ExpandType

The depth slots staging both operands of a contraction into shared memory laid out as storage.

A stage whose fill decodes its operand, from scales, a codebook or fields as wide as their word, holds the values at decoded, or at f32 where None. An operand staged as it lies keeps its own element.

Source§

impl Stages<Tile>

Source

pub fn smem_single( walk: &Walk, input: &Tile, storage: StageStorage, depth: usize, decoded: Option<ElemType>, ) -> Stages<Tile>

smem for the sole operand input.

Source

pub fn smem_single_at( walk: &Walk, input: &Tile, storage: StageStorage, width: Option<usize>, depth: usize, decoded: Option<ElemType>, ) -> Stages<Tile>

smem_single with the stage served in width-wide lines.

Source

pub fn __expand_smem_single( scope: &Scope, walk: &<Walk as CubeType>::ExpandType, input: &<Tile as CubeType>::ExpandType, storage: StageStorage, depth: usize, decoded: Option<ElemType>, ) -> <Stages<Tile> as CubeType>::ExpandType

smem for the sole operand input.

Source

pub fn __expand_smem_single_at( scope: &Scope, walk: &<Walk as CubeType>::ExpandType, input: &<Tile as CubeType>::ExpandType, storage: StageStorage, width: Option<usize>, depth: usize, decoded: Option<ElemType>, ) -> <Stages<Tile> as CubeType>::ExpandType

smem_single with the stage served in width-wide lines.

Source§

impl Stages<OperandPair>

Source

pub fn consume(&mut self, _slot: usize, _compute: impl FnOnce(&Tile, &Tile))

Consume slot slot: one step of a Compute plane’s walk.

Source§

impl Stages<Tile>

Source

pub fn consume(&mut self, _slot: usize, _compute: impl FnOnce(&Tile))

consume for the sole operand.

Source§

impl<T: CubeType> Stages<T>

Source

pub fn pipelined<F>(&mut self, _walk: Walk, _compute: F)
where F: FnMut(&mut Slot<T>, &Region),

Walk walk‘s regions, filling slots from the stages’ sources and compute consuming each through consume.

Source§

impl Stages<OperandPair>

Source

pub fn walk<F>(&mut self, _walk: Walk, _prefetch: Prefetch, _compute: F)
where F: FnMut(&mut Slot<OperandPair>, &Region),

Walk walk’s stages with the schedule prefetch selects.

Source§

impl Stages<OperandPair>

Source

pub fn prefetched<F>(&mut self, _walk: Walk, _compute: F)
where F: FnMut(&mut Slot<OperandPair>, &Region),

pipelined with the next region’s loads held in registers across the current contraction.

Requires depth 1 or 2, every unit copying straight from a plain operand, and loads within Prefetch::fits; otherwise refused at expansion. Fixed operands, and operands whose stages keep their scales beside them, fall back to pipelined.

Trait Implementations§

Source§

impl<T: CubeType> CubeType for Stages<T>

Source§

type ExpandType = StagesExpand<T>

Auto Trait Implementations§

§

impl<T> !Send for Stages<T>

§

impl<T> !Sync for Stages<T>

§

impl<T> Freeze for Stages<T>
where Sequence<Slot<T>>: Freeze, T: Freeze,

§

impl<T> RefUnwindSafe for Stages<T>

§

impl<T> Unpin for Stages<T>
where Sequence<Slot<T>>: Unpin, T: Unpin,

§

impl<T> UnsafeUnpin for Stages<T>

§

impl<T> UnwindSafe for Stages<T>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoComptime for T

Source§

fn comptime(self) -> Self

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more