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 index_mut<I: Index>(&mut self, index: I) -> &mut T
pub fn index_mut<I: Index>(&mut self, index: I) -> &mut T
Get the variable at the given position in the sequence.
Sourcepub fn __expand_new(_scope: &mut Scope) -> SequenceExpand<T>
pub fn __expand_new(_scope: &mut Scope) -> SequenceExpand<T>
Expand function of new.
Sourcepub fn __expand_push(
scope: &mut Scope,
expand: &mut SequenceExpand<T>,
value: T::ExpandType,
)
pub fn __expand_push( scope: &mut Scope, expand: &mut SequenceExpand<T>, value: T::ExpandType, )
Expand function of push.
Sourcepub fn __expand_index(
scope: &mut Scope,
expand: SequenceExpand<T>,
index: ExpandElementTyped<u32>,
) -> T::ExpandType
pub fn __expand_index( scope: &mut Scope, expand: SequenceExpand<T>, index: ExpandElementTyped<u32>, ) -> T::ExpandType
Expand function of index.
Sourcepub fn __expand_index_mut(
scope: &mut Scope,
expand: SequenceExpand<T>,
index: ExpandElementTyped<u32>,
) -> T::ExpandType
pub fn __expand_index_mut( scope: &mut Scope, expand: SequenceExpand<T>, index: ExpandElementTyped<u32>, ) -> T::ExpandType
Expand function of index_mut.
Trait Implementations§
Source§impl<T: CubeType> CubeDebug for Sequence<T>
impl<T: CubeType> CubeDebug for Sequence<T>
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<T: CubeType> CubeType for Sequence<T>
impl<T: CubeType> CubeType for Sequence<T>
type ExpandType = SequenceExpand<T>
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<'de, T> Deserialize<'de> for Sequence<T>where
T: Deserialize<'de> + CubeType,
impl<'de, T> Deserialize<'de> for Sequence<T>where
T: Deserialize<'de> + CubeType,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: CubeType> IntoIterator for Sequence<T>
impl<T: CubeType> IntoIterator for Sequence<T>
Source§impl<C: LaunchArg> LaunchArg for Sequence<C>
impl<C: LaunchArg> LaunchArg for Sequence<C>
Source§type RuntimeArg<'a, R: Runtime> = SequenceArg<'a, R, C>
type RuntimeArg<'a, R: Runtime> = SequenceArg<'a, R, C>
The runtime argument for the kernel.
fn compilation_arg<R: Runtime>( runtime_arg: &Self::RuntimeArg<'_, R>, ) -> Self::CompilationArg
Source§impl<C: LaunchArg> LaunchArgExpand for Sequence<C>
impl<C: LaunchArg> LaunchArgExpand for Sequence<C>
Source§type CompilationArg = SequenceCompilationArg<C>
type CompilationArg = SequenceCompilationArg<C>
Compilation argument.
Source§fn expand(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> SequenceExpand<C>
fn expand( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> SequenceExpand<C>
Register an input variable during compilation that fill the KernelBuilder.
Source§fn expand_output(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> SequenceExpand<C>
fn expand_output( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> SequenceExpand<C>
Register an output variable during compilation that fill the KernelBuilder.
Source§impl<T: Ord + CubeType> Ord for Sequence<T>
impl<T: Ord + CubeType> Ord for Sequence<T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd + CubeType> PartialOrd for Sequence<T>
impl<T: PartialOrd + CubeType> PartialOrd for Sequence<T>
impl<T: Eq + CubeType> Eq for Sequence<T>
impl<T: CubeType> StructuralPartialEq for Sequence<T>
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