pub struct Space { /* private fields */ }Expand description
Every axis with its extent, in canonical order, plus the runtime sizes of dynamic axes.
Implementations§
Source§impl Space
impl Space
pub fn shape(&self) -> &Shape
pub fn rank(&self) -> usize
pub fn axis_at(&self, i: usize) -> Axis
pub fn position(&self, axis: Axis) -> usize
pub fn contains(&self, axis: Axis) -> bool
pub fn axes(&self) -> impl Iterator<Item = Axis> + '_
pub fn extent_at(&self, i: usize) -> usize
pub fn is_dynamic(&self, axis: Axis) -> bool
Source§impl Space
impl Space
Sourcepub fn count(&self, p: usize, edge: usize) -> usize
pub fn count(&self, p: usize, edge: usize) -> usize
Axis p’s tile count for a sub-tile edge; comptime for a Static axis.
Sourcepub fn __expand_count(
scope: &Scope,
this: &<Self as CubeType>::ExpandType,
p: usize,
edge: usize,
) -> <usize as CubeType>::ExpandType
pub fn __expand_count( scope: &Scope, this: &<Self as CubeType>::ExpandType, p: usize, edge: usize, ) -> <usize as CubeType>::ExpandType
Axis p’s tile count for a sub-tile edge; comptime for a Static axis.
Source§impl Space
impl Space
pub fn new(extents: &[(Axis, usize)]) -> Self
Sourcepub fn dynamic(axes: &[Axis]) -> Self
pub fn dynamic(axes: &[Axis]) -> Self
Every axis dynamic, extents resolved in-kernel from the tensors.
Sourcepub fn with_dynamic(self, axes: &[Axis]) -> Self
pub fn with_dynamic(self, axes: &[Axis]) -> Self
Flip the listed axes to Dynamic.
Sourcepub fn all_dynamic(self) -> Self
pub fn all_dynamic(self) -> Self
Every axis dynamic (see with_dynamic).
Sourcepub fn merge(parts: &[&Space]) -> Space
pub fn merge(parts: &[&Space]) -> Space
The smallest space containing every part, axes in first-appearance order, shared axes
broadcast-merged. E.g. {M,K} ∪ {K,N} ∪ {M,N} = {M,N,K}.
Sourcepub fn covering(parts: &[&Space]) -> Space
pub fn covering(parts: &[&Space]) -> Space
The smallest space every one of parts tiles evenly: on each axis the least common
multiple of the parts’ extents, axes in first-appearance order. The box a step covers so
that each operand’s load fills it whole: NVFP4 values loaded {k 16, n 2}, their scales
{k 16, n 16} and an f16 activation {k 8} cover {k 16, n 16}.
§Panics
On a dynamic extent, which has no multiple.
Sourcepub fn tiles(&self, tile: &Space) -> usize
pub fn tiles(&self, tile: &Space) -> usize
How many tiles this space holds, laid side by side along every axis tile names; an axis
it does not name it spans whole, one tile serving every position along it. An f16
activation loaded {k 8} fills a step {k 16, n 16} in two loads.
§Panics
Where tile names an axis this space lacks, or does not divide its extent there.
Sourcepub fn difference(&self, output: &Space) -> SmallVec<[Axis; 6]>
pub fn difference(&self, output: &Space) -> SmallVec<[Axis; 6]>
The axes in this space but not in output: those contracted.
Sourcepub fn contracted(operands: &[&Space], output: &Space) -> SmallVec<[Axis; 6]>
pub fn contracted(operands: &[&Space], output: &Space) -> SmallVec<[Axis; 6]>
The axes operands jointly contract against output.
Sourcepub fn slices_along(&self, axis: Axis) -> usize
pub fn slices_along(&self, axis: Axis) -> usize
How many slices along axis the space holds: one for every index of its other axes. The
extent of axis itself may be one a walk has yet to cut, which only the launch knows.
Trait Implementations§
impl Eq for Space
Source§impl LaunchArg for Space
impl LaunchArg for Space
Source§type RuntimeArg = SpaceLaunch
type RuntimeArg = SpaceLaunch
Source§type CompilationArg = SpaceCompilationArg
type CompilationArg = SpaceCompilationArg
fn register( arg: Self::RuntimeArg, launcher: &mut KernelLauncher, ) -> Self::CompilationArg
Source§fn expand(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> <Self as CubeType>::ExpandType
fn expand( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType
KernelBuilder.Auto Trait Implementations§
impl Freeze for Space
impl RefUnwindSafe for Space
impl Send for Space
impl Sync for Space
impl Unpin for Space
impl UnsafeUnpin for Space
impl UnwindSafe for Space
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CompilationArg for T
impl<T> CompilationArg for T
Source§fn dynamic_cast<Arg>(&self) -> Argwhere
Arg: CompilationArg,
fn dynamic_cast<Arg>(&self) -> Argwhere
Arg: CompilationArg,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> TuneInputs for T
impl<T> TuneInputs for T
Source§impl<T> ViewLayoutLaunchArg for T
impl<T> ViewLayoutLaunchArg for T
Source§type RuntimeArg = <T as LaunchArg>::RuntimeArg
type RuntimeArg = <T as LaunchArg>::RuntimeArg
Source§type CompilationArg = <T as LaunchArg>::CompilationArg
type CompilationArg = <T as LaunchArg>::CompilationArg
fn register<B>(
arg: <T as ViewLayoutLaunchArg>::RuntimeArg,
_buffer: &B,
_ty: Type,
launcher: &mut KernelLauncher,
) -> <T as ViewLayoutLaunchArg>::CompilationArgwhere
B: MemoryArg,
Source§fn expand(
arg: &<T as ViewLayoutLaunchArg>::CompilationArg,
_ty: Type,
builder: &mut KernelBuilder,
) -> <T as CubeType>::ExpandType
fn expand( arg: &<T as ViewLayoutLaunchArg>::CompilationArg, _ty: Type, builder: &mut KernelBuilder, ) -> <T as CubeType>::ExpandType
KernelBuilder.Source§fn expand_output(
arg: &Self::CompilationArg,
ty: Type,
builder: &mut KernelBuilder,
) -> Self::ExpandType
fn expand_output( arg: &Self::CompilationArg, ty: Type, builder: &mut KernelBuilder, ) -> Self::ExpandType
KernelBuilder.