Trait SharedAccumulator

Source
pub trait SharedAccumulator:
    CubeType
    + Send
    + Sync
    + 'static {
    type Item: CubeType;

    // Required methods
    fn allocate(length: u32, line_size: u32, _coordinate: bool) -> Self;
    fn read(accumulator: &Self, index: u32) -> Self::Item;
    fn write(accumulator: &mut Self, index: u32, item: Self::Item);
    fn __expand_allocate(
        scope: &mut Scope,
        length: u32,
        line_size: u32,
        _coordinate: bool,
    ) -> <Self as CubeType>::ExpandType;
    fn __expand_read(
        scope: &mut Scope,
        accumulator: <Self as CubeType>::ExpandType,
        index: <u32 as CubeType>::ExpandType,
    ) -> <Self::Item as CubeType>::ExpandType;
    fn __expand_write(
        scope: &mut Scope,
        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§

Source

fn allocate(length: u32, line_size: u32, _coordinate: bool) -> Self

Source

fn read(accumulator: &Self, index: u32) -> Self::Item

Source

fn write(accumulator: &mut Self, index: u32, item: Self::Item)

Source

fn __expand_allocate( scope: &mut Scope, length: u32, line_size: u32, _coordinate: bool, ) -> <Self as CubeType>::ExpandType

Source

fn __expand_read( scope: &mut Scope, accumulator: <Self as CubeType>::ExpandType, index: <u32 as CubeType>::ExpandType, ) -> <Self::Item as CubeType>::ExpandType

Source

fn __expand_write( scope: &mut Scope, 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.

Implementations on Foreign Types§

Source§

impl<In: Numeric> SharedAccumulator for SharedMemory<Line<In>>

Source§

type Item = Line<In>

Source§

fn allocate(length: u32, line_size: u32, _coordinate: bool) -> Self

Source§

fn read(accumulator: &Self, index: u32) -> Self::Item

Source§

fn write(accumulator: &mut Self, index: u32, item: Self::Item)

Source§

fn __expand_allocate( scope: &mut Scope, length: u32, line_size: u32, _coordinate: bool, ) -> <Self as CubeType>::ExpandType

Source§

fn __expand_read( scope: &mut Scope, accumulator: <Self as CubeType>::ExpandType, index: <u32 as CubeType>::ExpandType, ) -> <Self::Item as CubeType>::ExpandType

Source§

fn __expand_write( scope: &mut Scope, accumulator: <Self as CubeType>::ExpandType, index: <u32 as CubeType>::ExpandType, item: <Self::Item as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType

Implementors§