Struct cubecl_core::frontend::Sequence
source · pub struct Sequence<T: CubeType> { /* private fields */ }
Expand description
A sequence of cube types that is inlined during compilation.
In other words, it allows you to group a dynamic amount of variables at compile time.
All methods push, index and into_iter are executed during compilation and don’t add any overhead on the generated kernel.
Implementations§
source§impl<T: CubeType> Sequence<T>
impl<T: CubeType> Sequence<T>
sourcepub fn index<I: Index>(&self, index: I) -> &T
pub fn index<I: Index>(&self, index: I) -> &T
Get the variable at the given position in the sequence.
sourcepub fn __expand_new(_context: &mut CubeContext) -> SequenceExpand<T>
pub fn __expand_new(_context: &mut CubeContext) -> SequenceExpand<T>
Expand function of new.
sourcepub fn __expand_push(
context: &mut CubeContext,
expand: &mut SequenceExpand<T>,
value: T::ExpandType,
)
pub fn __expand_push( context: &mut CubeContext, expand: &mut SequenceExpand<T>, value: T::ExpandType, )
Expand function of push.
sourcepub fn __expand_index<I: Index>(
context: &mut CubeContext,
expand: SequenceExpand<T>,
index: I,
) -> T::ExpandType
pub fn __expand_index<I: Index>( context: &mut CubeContext, expand: SequenceExpand<T>, index: I, ) -> T::ExpandType
Expand function of index.
Trait Implementations§
source§impl<T: CubeType> CubeType for Sequence<T>
impl<T: CubeType> CubeType for Sequence<T>
type ExpandType = SequenceExpand<T>
source§fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
Auto Trait Implementations§
impl<T> Freeze for Sequence<T>
impl<T> RefUnwindSafe for Sequence<T>where
T: RefUnwindSafe,
impl<T> Send for Sequence<T>where
T: Send,
impl<T> Sync for Sequence<T>where
T: Sync,
impl<T> Unpin for Sequence<T>where
T: Unpin,
impl<T> UnwindSafe for Sequence<T>where
T: UnwindSafe,
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