Skip to main content

Writer

Enum Writer 

Source
pub enum Writer<Out: NumericVector> {
    Parallel(ParallelWriter<Out>),
    Perpendicular(PerpendicularWriter<Out>),
}
Expand description

Abstract how data is written to global memory.

Depending on the problem kind, writes might be buffered to optimize vectorization, only happening when Writer::commit() is called.

Variants§

§

Parallel(ParallelWriter<Out>)

§

Perpendicular(PerpendicularWriter<Out>)

Implementations§

Source§

impl<Out: NumericVector> Writer<Out>

Source

pub fn new_Parallel(_0: ParallelWriter<Out>) -> Self

Source

pub fn __expand_new_Parallel( _: &mut Scope, _0: <ParallelWriter<Out> as RudaType>::ExpandType, ) -> WriterExpand<Out>

Source

pub fn new_Perpendicular(_0: PerpendicularWriter<Out>) -> Self

Source

pub fn __expand_new_Perpendicular( _: &mut Scope, _0: <PerpendicularWriter<Out> as RudaType>::ExpandType, ) -> WriterExpand<Out>

Source§

impl<Out: NumericVector> Writer<Out>

Source

pub fn new<P: ReducePrecision>( input: &VirtualTensor<P::EI, P::SI>, output: &mut VirtualTensor<Out::T, Out::N, ReadWrite>, reduce_axis: usize, out_vec_axis: usize, write_index: usize, vectorization_mode: VectorizationMode, acc_format: AccumulatorFormat, ) -> Writer<Out>

Source

pub fn write<P: ReducePrecision, I: ReduceInstruction<P>>( &mut self, local_index: usize, accumulator: Accumulator<P>, inst: &I, )

Source

pub fn commit_required(&self) -> bool

Source

pub fn commit(&mut self)

Source

pub fn write_count(&self) -> VectorSize

Source

pub fn __expand_new<P: ReducePrecision>( scope: &mut Scope, input: <VirtualTensor<P::EI, P::SI> as RudaType>::ExpandType, output: <VirtualTensor<Out::T, Out::N, ReadWrite> as RudaType>::ExpandType, reduce_axis: <usize as RudaType>::ExpandType, out_vec_axis: <usize as RudaType>::ExpandType, write_index: <usize as RudaType>::ExpandType, vectorization_mode: VectorizationMode, acc_format: AccumulatorFormat, ) -> <Writer<Out> as RudaType>::ExpandType

Source

pub fn __expand_write<P: ReducePrecision, I: ReduceInstruction<P>>( scope: &mut Scope, this: <Self as RudaType>::ExpandType, local_index: <usize as RudaType>::ExpandType, accumulator: <Accumulator<P> as RudaType>::ExpandType, inst: <I as RudaType>::ExpandType, ) -> <() as RudaType>::ExpandType

Source

pub fn __expand_commit_required( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> bool

Source

pub fn __expand_commit( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> <() as RudaType>::ExpandType

Source

pub fn __expand_write_count( scope: &mut Scope, this: <Self as RudaType>::ExpandType, ) -> VectorSize

Trait Implementations§

Source§

impl<Out: NumericVector> RudaDebug for Writer<Out>

Source§

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<Out: NumericVector> RudaType for Writer<Out>

Auto Trait Implementations§

§

impl<Out> Freeze for Writer<Out>
where ParallelWriter<Out>: Freeze, PerpendicularWriter<Out>: Freeze,

§

impl<Out> RefUnwindSafe for Writer<Out>
where ParallelWriter<Out>: RefUnwindSafe, PerpendicularWriter<Out>: RefUnwindSafe,

§

impl<Out> Send for Writer<Out>
where ParallelWriter<Out>: Send, PerpendicularWriter<Out>: Send,

§

impl<Out> Sync for Writer<Out>
where ParallelWriter<Out>: Sync, PerpendicularWriter<Out>: Sync,

§

impl<Out> Unpin for Writer<Out>
where ParallelWriter<Out>: Unpin, PerpendicularWriter<Out>: Unpin,

§

impl<Out> UnsafeUnpin for Writer<Out>
where ParallelWriter<Out>: UnsafeUnpin, PerpendicularWriter<Out>: UnsafeUnpin,

§

impl<Out> UnwindSafe for Writer<Out>
where ParallelWriter<Out>: UnwindSafe, PerpendicularWriter<Out>: UnwindSafe,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoComptime for T

Source§

fn comptime(self) -> Self

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.