pub struct CubeMapping {
pub can_yield_extra_cubes: bool,
/* private fields */
}Expand description
Runtime-side counterpart of CubeCountPlan: given the cube position,
resolves the conceptual (x, y, z) coordinates in problem space.
Each operation is responsible for mapping the returned generic (x, y, z)
tuple to its own domain axes (e.g. matmul interprets them as (m, n, batch),
gemv as (matrix_axis, _, batch), attention as (seq_q, batch_heads, _)).
Fields§
§can_yield_extra_cubes: boolImplementations§
Source§impl CubeMapping
impl CubeMapping
Sourcepub fn num_valid_cubes(&self) -> usize
pub fn num_valid_cubes(&self) -> usize
Returns the number of valid cubes (problem-space volume).
Sourcepub fn cube_pos_to_xyz(&self) -> (u32, u32, u32)
pub fn cube_pos_to_xyz(&self) -> (u32, u32, u32)
Given a cube position, returns the generic problem-space coordinates (x, y, z).
Consumers assign meaning to x/y/z (matmul: m/n/batch, gemv: matrix/_/batch, etc.).
Sourcepub fn __expand_num_valid_cubes(
scope: &Scope,
this: &<Self as CubeType>::ExpandType,
) -> <usize as CubeType>::ExpandType
pub fn __expand_num_valid_cubes( scope: &Scope, this: &<Self as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType
Returns the number of valid cubes (problem-space volume).
Sourcepub fn __expand_cube_pos_to_xyz(
scope: &Scope,
this: &<Self as CubeType>::ExpandType,
) -> (<u32 as CubeType>::ExpandType, <u32 as CubeType>::ExpandType, <u32 as CubeType>::ExpandType)
pub fn __expand_cube_pos_to_xyz( scope: &Scope, this: &<Self as CubeType>::ExpandType, ) -> (<u32 as CubeType>::ExpandType, <u32 as CubeType>::ExpandType, <u32 as CubeType>::ExpandType)
Given a cube position, returns the generic problem-space coordinates (x, y, z).
Consumers assign meaning to x/y/z (matmul: m/n/batch, gemv: matrix/_/batch, etc.).
Trait Implementations§
Source§impl CubeType for CubeMapping
impl CubeType for CubeMapping
type ExpandType = CubeMappingExpand
Source§impl LaunchArg for CubeMapping
impl LaunchArg for CubeMapping
Source§type RuntimeArg<R: Runtime> = CubeMappingLaunch<R>
type RuntimeArg<R: Runtime> = CubeMappingLaunch<R>
Source§type CompilationArg = CubeMappingCompilationArg
type CompilationArg = CubeMappingCompilationArg
fn register<R: Runtime>( arg: Self::RuntimeArg<R>, launcher: &mut KernelLauncher<R>, ) -> 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 CubeMapping
impl RefUnwindSafe for CubeMapping
impl Send for CubeMapping
impl Sync for CubeMapping
impl Unpin for CubeMapping
impl UnsafeUnpin for CubeMapping
impl UnwindSafe for CubeMapping
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> 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 moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ViewLayoutLaunchArg for T
impl<T> ViewLayoutLaunchArg for T
Source§type RuntimeArg<R: Runtime> = <T as LaunchArg>::RuntimeArg<R>
type RuntimeArg<R: Runtime> = <T as LaunchArg>::RuntimeArg<R>
Source§type CompilationArg = <T as LaunchArg>::CompilationArg
type CompilationArg = <T as LaunchArg>::CompilationArg
fn register<R, B>( arg: <T as ViewLayoutLaunchArg>::RuntimeArg<R>, _buffer: &B, _ty: Type, launcher: &mut KernelLauncher<R>, ) -> <T as ViewLayoutLaunchArg>::CompilationArg
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.