pub enum StridedLayout {
Pitched(FastDivmod),
None,
}
Expand description
Layout for tensor that may or may not be strided on the last dimension. Efficiently translates the absolute index to strided index.
Variants§
Pitched(FastDivmod)
None
Implementations§
Source§impl StridedLayout
impl StridedLayout
pub fn new_Pitched(_0: FastDivmod) -> Self
pub fn __expand_new_Pitched( _: &mut Scope, _0: <FastDivmod as CubeType>::ExpandType, ) -> StridedLayoutExpand
pub fn new_None() -> Self
pub fn __expand_new_None(_: &mut Scope) -> StridedLayoutExpand
Source§impl StridedLayout
impl StridedLayout
Sourcepub fn index<T: CubePrimitive>(
&self,
tensor: &Tensor<Line<T>>,
index: u32,
) -> u32
pub fn index<T: CubePrimitive>( &self, tensor: &Tensor<Line<T>>, index: u32, ) -> u32
Translates absolute index to strided index if applicable
pub fn __expand_index<T: CubePrimitive>( context: &mut Scope, this: <Self as CubeType>::ExpandType, tensor: <Tensor<Line<T>> as CubeType>::ExpandType, index: <u32 as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType
Trait Implementations§
Source§impl CubeDebug for StridedLayout
impl CubeDebug for StridedLayout
Source§fn set_debug_name(&self, scope: &mut Scope, name: &'static str)
fn set_debug_name(&self, scope: &mut Scope, name: &'static str)
Set the debug name of this type’s expansion. Should do nothing for types that don’t appear
at runtime
Source§impl CubeType for StridedLayout
impl CubeType for StridedLayout
type ExpandType = StridedLayoutExpand
Source§fn init(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
fn init(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
Source§impl LaunchArg for StridedLayout
impl LaunchArg for StridedLayout
Source§type RuntimeArg<'a, R: Runtime> = StridedLayoutArgs<'a, R>
type RuntimeArg<'a, R: Runtime> = StridedLayoutArgs<'a, R>
The runtime argument for the kernel.
fn compilation_arg<'a, R: Runtime>( runtime_arg: &Self::RuntimeArg<'a, R>, ) -> Self::CompilationArg
Source§impl LaunchArgExpand for StridedLayout
impl LaunchArgExpand for StridedLayout
Source§type CompilationArg = StridedLayoutCompilationArg
type CompilationArg = StridedLayoutCompilationArg
Compilation argument.
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
Register an input variable during compilation that fill the KernelBuilder.
Source§fn expand_output(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> <Self as CubeType>::ExpandType
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§
impl Freeze for StridedLayout
impl RefUnwindSafe for StridedLayout
impl Send for StridedLayout
impl Sync for StridedLayout
impl Unpin for StridedLayout
impl UnwindSafe for StridedLayout
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