cubecl_core::frontend

Struct SliceMut

Source
pub struct SliceMut<'a, E> { /* private fields */ }
Expand description

A read-write contiguous list of elements.

Implementations§

Source§

impl<'a, E> SliceMut<'a, E>

Source

pub fn len(&self) -> u32

Get the length of the slice.

Source

pub fn as_aligned(&self) -> SliceMut<'a, Line<E>>
where E: CubePrimitive,

Returns the same slice, but with lines of length 1.

Source§

impl<'a, E: CubePrimitive> SliceMut<'a, E>

Source

pub unsafe fn index_unchecked<I: Index>(&self, _i: I) -> &E
where Self: CubeIndex<I>,

Perform an unchecked index into the array

§Safety

Out of bounds indexing causes undefined behaviour and may segfault. Ensure index is always in bounds

Source

pub unsafe fn index_assign_unchecked<I: Index>(&mut self, _i: I, _value: E)
where Self: CubeIndexMut<I>,

Perform an unchecked index assignment into the array

§Safety

Out of bounds indexing causes undefined behaviour and may segfault. Ensure index is always in bounds

Trait Implementations§

Source§

impl<'a, E: CubeType, I: Index> CubeIndex<I> for SliceMut<'a, E>

Source§

type Output = E

Source§

fn cube_idx(&self, _i: T) -> &Self::Output

Source§

impl<'a, E: CubeType, I: Index> CubeIndexMut<I> for SliceMut<'a, E>

Source§

fn cube_idx_mut(&mut self, _i: T) -> &mut Self::Output

Source§

impl<'a, E: CubeType> CubeType for SliceMut<'a, E>

Source§

type ExpandType = ExpandElementTyped<SliceMut<'static, E>>

Source§

fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType

Wrapper around the init method, necessary to type inference.
Source§

impl<'a, E: CubePrimitive> SliceOperator<E> for SliceMut<'a, E>

Source§

type Expand = ExpandElementTyped<SliceMut<'static, E>>

Source§

fn slice<Start: Index, End: Index>( &self, start: Start, end: End, ) -> &Slice<'_, E>

Return a read-only view of all elements comprise between the start and end index.
Source§

fn __expand_slice( context: &mut CubeContext, expand: Self::Expand, start: ExpandElementTyped<u32>, end: ExpandElementTyped<u32>, ) -> ExpandElementTyped<Slice<'static, E>>

Expand function of SliceOperator::slice.
Source§

fn slice_mut<Start: Index, End: Index>( &mut self, start: Start, end: End, ) -> &mut SliceMut<'_, E>

Return a read-write view of all elements comprise between the start and end index.
Source§

fn __expand_slice_mut( context: &mut CubeContext, expand: Self::Expand, start: ExpandElementTyped<u32>, end: ExpandElementTyped<u32>, ) -> ExpandElementTyped<SliceMut<'static, E>>

Expand function of SliceOperator::slice_mut.
Source§

fn slice_mut_unsafe<Start: Index, End: Index>( &self, start: Start, end: End, ) -> &mut SliceMut<'_, E>

Return a read-write view of all elements comprise between the start and end index. Read more
Source§

fn __expand_slice_mut_unsafe( context: &mut CubeContext, expand: Self::Expand, start: ExpandElementTyped<u32>, end: ExpandElementTyped<u32>, ) -> ExpandElementTyped<SliceMut<'static, E>>

Source§

fn as_slice(&self) -> &Slice<'_, E>

Reinterprete the current type as a read-only slice.
Source§

fn __expand_as_slice( context: &mut CubeContext, expand: Self::Expand, ) -> ExpandElementTyped<Slice<'static, E>>

Expand function of SliceOperator::as_slice.
Source§

fn as_slice_mut(&mut self) -> &mut SliceMut<'_, E>

Reinterprete the current type as a read-write slice.
Source§

fn __expand_as_slice_mut( context: &mut CubeContext, expand: Self::Expand, ) -> ExpandElementTyped<SliceMut<'static, E>>

Expand function of SliceOperator::as_slice_mut.
Source§

fn as_slice_mut_unsafe(&self) -> &mut SliceMut<'_, E>

Reinterprete the current type as a read-write slice. Read more
Source§

fn __expand_as_slice_mut_unsafe( context: &mut CubeContext, expand: Self::Expand, ) -> ExpandElementTyped<SliceMut<'static, E>>

Auto Trait Implementations§

§

impl<'a, E> Freeze for SliceMut<'a, E>

§

impl<'a, E> RefUnwindSafe for SliceMut<'a, E>
where E: RefUnwindSafe,

§

impl<'a, E> Send for SliceMut<'a, E>
where E: Send,

§

impl<'a, E> Sync for SliceMut<'a, E>
where E: Sync,

§

impl<'a, E> Unpin for SliceMut<'a, E>
where E: Unpin,

§

impl<'a, E> !UnwindSafe for SliceMut<'a, E>

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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V