pub struct SharedMemory<E: CubePrimitive> { /* private fields */ }Implementations§
Sourcepub unsafe fn index_unchecked(&self, i: usize) -> &E
pub unsafe fn index_unchecked(&self, i: usize) -> &E
Perform an unchecked index into the array
§Safety
Out of bounds indexing causes undefined behaviour and may segfault. Ensure index is always in bounds
Sourcepub unsafe fn index_assign_unchecked(&mut self, i: usize, value: E)
pub unsafe fn index_assign_unchecked(&mut self, i: usize, value: E)
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
pub fn __expand_index_unchecked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, i: <usize as CubeType>::ExpandType, ) -> <E as CubeType>::ExpandType
pub fn __expand_index_assign_unchecked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, i: <usize as CubeType>::ExpandType, value: <E as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType
pub fn new(size: usize) -> Self
pub fn new_lined(size: usize, line_size: LineSize) -> SharedMemory<Line<T>>
pub fn len(&self) -> usize
pub fn buffer_len(&self) -> usize
pub fn __expand_new( scope: &mut Scope, size: usize, ) -> <Self as CubeType>::ExpandType
pub fn __expand_new_lined( scope: &mut Scope, size: usize, line_size: LineSize, ) -> <SharedMemory<Line<T>> as CubeType>::ExpandType
pub fn __expand_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType
pub fn __expand_buffer_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType
pub fn new_aligned( size: usize, line_size: LineSize, alignment: usize, ) -> SharedMemory<Line<T>>
Sourcepub unsafe fn free(self)
pub unsafe fn free(self)
Frees the shared memory for reuse, if possible on the target runtime.
§Safety
Must be used in uniform control flow Must not have any dangling references to this shared memory
pub fn __expand_new_aligned( scope: &mut Scope, size: usize, line_size: LineSize, alignment: usize, ) -> <SharedMemory<Line<T>> as CubeType>::ExpandType
pub fn __expand_free( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType
Trait Implementations§
Source§fn clone(&self) -> SharedMemory<E>
fn clone(&self) -> SharedMemory<E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moretype Output = E
type Idx = usize
fn cube_idx(&self, _i: Self::Idx) -> &Self::Output
fn expand_index( scope: &mut Scope, array: Self::ExpandType, index: <Self::Idx as CubeType>::ExpandType, ) -> <Self::Output as CubeType>::ExpandType
fn expand_index_unchecked( scope: &mut Scope, array: Self::ExpandType, index: <Self::Idx as CubeType>::ExpandType, ) -> <Self::Output as CubeType>::ExpandType
fn cube_idx_mut( &mut self, _i: <Self as CubeIndex>::Idx, ) -> &mut <Self as CubeIndex>::Output
fn expand_index_mut( scope: &mut Scope, array: Self::ExpandType, index: <Self::Idx as CubeType>::ExpandType, value: <Self::Output as CubeType>::ExpandType, )
type ExpandType = ExpandElementTyped<SharedMemory<T>>
Source§fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
fn line_size(&self) -> LineSize
fn __expand_line_size(_scope: &mut Scope, this: Self::ExpandType) -> LineSize
fn __expand_read( scope: &mut Scope, this: ExpandElementTyped<SharedMemory<T>>, idx: ExpandElementTyped<usize>, ) -> ExpandElementTyped<T>
fn read(&self, index: usize) -> T
fn read_unchecked(&self, index: usize) -> T
fn len(&self) -> usize
fn __expand_read_unchecked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, index: <usize as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType
fn __expand_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType
fn __expand_write( scope: &mut Scope, this: ExpandElementTyped<SharedMemory<T>>, idx: ExpandElementTyped<usize>, value: ExpandElementTyped<T>, )
fn write(&self, index: usize, value: T)
Source§fn slice_mut(&mut self, start: usize, end: usize) -> Slice<E, ReadWrite> ⓘ
fn slice_mut(&mut self, start: usize, end: usize) -> Slice<E, ReadWrite> ⓘ
Return a read-write view of all elements comprise between the
start and end indices.
In checked mode, if the end index is out-of-bound, it is replaced by
the length of self.Source§fn to_slice_mut(&mut self) -> Slice<E, ReadWrite> ⓘ
fn to_slice_mut(&mut self) -> Slice<E, ReadWrite> ⓘ
Reinterprete the current type as a read-write slice.
fn __expand_slice_mut( scope: &mut Scope, this: <Self as CubeType>::ExpandType, start: <usize as CubeType>::ExpandType, end: <usize as CubeType>::ExpandType, ) -> <Slice<E, ReadWrite> as CubeType>::ExpandType ⓘ
fn __expand_to_slice_mut( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <Slice<E, ReadWrite> as CubeType>::ExpandType ⓘ
Source§fn slice(&self, start: usize, end: usize) -> Slice<E, ReadOnly> ⓘ
fn slice(&self, start: usize, end: usize) -> Slice<E, ReadOnly> ⓘ
Return a read-only view of all elements comprise between the
start and end indices.
In checked mode, if the end index is out-of-bound, it is replaced by
the length of self.Source§fn to_slice(&self) -> Slice<E, ReadOnly> ⓘ
fn to_slice(&self) -> Slice<E, ReadOnly> ⓘ
Reinterprete the current type as a read-only slice.
fn __expand_slice( scope: &mut Scope, this: <Self as CubeType>::ExpandType, start: <usize as CubeType>::ExpandType, end: <usize as CubeType>::ExpandType, ) -> <Slice<E, ReadOnly> as CubeType>::ExpandType ⓘ
fn __expand_to_slice( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <Slice<E, ReadOnly> as CubeType>::ExpandType ⓘ
Auto Trait Implementations§
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