Skip to main content

CubeMapping

Struct CubeMapping 

Source
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: bool

Implementations§

Source§

impl CubeMapping

Source

pub fn num_valid_cubes(&self) -> usize

Returns the number of valid cubes (problem-space volume).

Source

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.).

Source

pub fn __expand_num_valid_cubes( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType

Source

pub fn __expand_cube_pos_to_xyz( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <(u32, u32, u32) as CubeType>::ExpandType

Trait Implementations§

Source§

impl CubeType for CubeMapping

Source§

type ExpandType = CubeMappingExpand

Source§

impl LaunchArg for CubeMapping

Source§

type RuntimeArg<R: Runtime> = CubeMappingLaunch<R>

The runtime argument for the kernel.
Source§

type CompilationArg = CubeMappingCompilationArg

Compilation argument.
Source§

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

Register an input variable during compilation that fill the KernelBuilder.
Source§

fn expand_output( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType

Register an output variable during compilation that fill the KernelBuilder.

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<T> ViewLayoutLaunchArg for T
where T: LaunchArg,

Source§

type RuntimeArg<R: Runtime> = <T as LaunchArg>::RuntimeArg<R>

The runtime argument for the kernel.
Source§

type CompilationArg = <T as LaunchArg>::CompilationArg

Compilation argument.
Source§

fn register<R, B>( arg: <T as ViewLayoutLaunchArg>::RuntimeArg<R>, _buffer: &B, _ty: Type, launcher: &mut KernelLauncher<R>, ) -> <T as ViewLayoutLaunchArg>::CompilationArg
where R: Runtime, B: BufferArg,

Source§

fn expand( arg: &<T as ViewLayoutLaunchArg>::CompilationArg, _ty: Type, builder: &mut KernelBuilder, ) -> <T as CubeType>::ExpandType

Register an input variable during compilation that fill the KernelBuilder.
Source§

fn expand_output( arg: &<T as ViewLayoutLaunchArg>::CompilationArg, _ty: Type, builder: &mut KernelBuilder, ) -> <T as CubeType>::ExpandType

Register an output variable during compilation that fill the KernelBuilder.