pub trait SharedAccumulator<In: Numeric>:
CubeType
+ Send
+ Sync
+ 'static {
type Item: CubeType;
// Required methods
fn allocate(length: u32, line_size: u32) -> Self;
fn read(accumulator: &Self, index: u32) -> Self::Item;
fn write(accumulator: &mut Self, index: u32, item: Self::Item);
fn __expand_allocate(
context: &mut CubeContext,
length: u32,
line_size: u32,
) -> <Self as CubeType>::ExpandType;
fn __expand_read(
context: &mut CubeContext,
accumulator: <Self as CubeType>::ExpandType,
index: <u32 as CubeType>::ExpandType,
) -> <Self::Item as CubeType>::ExpandType;
fn __expand_write(
context: &mut CubeContext,
accumulator: <Self as CubeType>::ExpandType,
index: <u32 as CubeType>::ExpandType,
item: <Self::Item as CubeType>::ExpandType,
) -> <() as CubeType>::ExpandType;
}
Expand description
A simple trait that abstract over a single or multiple shared memory.
Required Associated Types§
Required Methods§
fn allocate(length: u32, line_size: u32) -> Self
fn read(accumulator: &Self, index: u32) -> Self::Item
fn write(accumulator: &mut Self, index: u32, item: Self::Item)
fn __expand_allocate( context: &mut CubeContext, length: u32, line_size: u32, ) -> <Self as CubeType>::ExpandType
fn __expand_read( context: &mut CubeContext, accumulator: <Self as CubeType>::ExpandType, index: <u32 as CubeType>::ExpandType, ) -> <Self::Item as CubeType>::ExpandType
fn __expand_write( context: &mut CubeContext, accumulator: <Self as CubeType>::ExpandType, index: <u32 as CubeType>::ExpandType, item: <Self::Item as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.