Skip to main content

RowWise

Struct RowWise 

Source
pub struct RowWise<E: Numeric> {
    pub vals: Array<E>,
    pub num_rows: usize,
}
Expand description

Contains one value per row of a fragment for which the unit contributes

Example: For a 8x8 tile shared by a plane of 32 units, every unit holds 8 values in the tile.

In the following layout, values are held contiguously, and num_rows=1 because every two occurrences of the same plane id are in the same row 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31,

In the following layout, values are held disjointly, and num_rows=2 because the two occurrences of the same plane id are not in the same row 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,

Fields§

§vals: Array<E>§num_rows: usize

Implementations§

Source§

impl<E: Numeric> RowWise<E>

Source

pub fn new_filled(num_rows: usize, val: E) -> RowWise<E>

Source

pub fn fill(&mut self, val: E)

Source

pub fn init_zero(&mut self)

Source

pub fn new_min_value(num_rows: usize) -> RowWise<E>

Source

pub fn new_zero(num_rows: usize) -> RowWise<E>

Source

pub fn copy_from(&mut self, other: &RowWise<E>)

Source

pub fn add(&self, other: &RowWise<E>) -> RowWise<E>

Source

pub fn add_inplace(&mut self, other: &RowWise<E>)

Source

pub fn mul(&self, other: &RowWise<E>) -> RowWise<E>

Source

pub fn mul_inplace(&mut self, other: &RowWise<E>)

Source

pub fn max_inplace(&mut self, other: &RowWise<E>)

Source

pub fn replace_at(&mut self, i: usize, new_val: E)

Source

pub fn cast_from<E2: Float>(row_wise: &RowWise<E>) -> RowWise<E2>

Source

pub fn __expand_new_filled( scope: &Scope, num_rows: usize, val: <E as CubeType>::ExpandType, ) -> <RowWise<E> as CubeType>::ExpandType

Source

pub fn __expand_fill( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, val: <E as CubeType>::ExpandType, )

Source

pub fn __expand_init_zero( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, )

Source

pub fn __expand_new_min_value( scope: &Scope, num_rows: usize, ) -> <RowWise<E> as CubeType>::ExpandType

Source

pub fn __expand_new_zero( scope: &Scope, num_rows: usize, ) -> <RowWise<E> as CubeType>::ExpandType

Source

pub fn __expand_copy_from( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, other: &<RowWise<E> as CubeType>::ExpandType, )

Source

pub fn __expand_add( scope: &Scope, this: &<Self as CubeType>::ExpandType, other: &<RowWise<E> as CubeType>::ExpandType, ) -> <RowWise<E> as CubeType>::ExpandType

Source

pub fn __expand_add_inplace( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, other: &<RowWise<E> as CubeType>::ExpandType, )

Source

pub fn __expand_mul( scope: &Scope, this: &<Self as CubeType>::ExpandType, other: &<RowWise<E> as CubeType>::ExpandType, ) -> <RowWise<E> as CubeType>::ExpandType

Source

pub fn __expand_mul_inplace( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, other: &<RowWise<E> as CubeType>::ExpandType, )

Source

pub fn __expand_max_inplace( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, other: &<RowWise<E> as CubeType>::ExpandType, )

Source

pub fn __expand_replace_at( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, i: <usize as CubeType>::ExpandType, new_val: <E as CubeType>::ExpandType, )

Source

pub fn __expand_cast_from<E2: Float>( scope: &Scope, row_wise: &<RowWise<E> as CubeType>::ExpandType, ) -> <RowWise<E2> as CubeType>::ExpandType

Source§

impl<E: Float> RowWise<E>

Source

pub fn exp_diff(&self, other: &RowWise<E>) -> RowWise<E>

Per-row e^(self - other).

Source

pub fn recip_inplace(&mut self)

v -> 1/v per row, with v == 0 (fully-masked row) staying zero.

Source

pub fn __expand_exp_diff( scope: &Scope, this: &<Self as CubeType>::ExpandType, other: &<RowWise<E> as CubeType>::ExpandType, ) -> <RowWise<E> as CubeType>::ExpandType

Per-row e^(self - other).

Source

pub fn __expand_recip_inplace( scope: &Scope, this: &mut <Self as CubeType>::ExpandType, )

v -> 1/v per row, with v == 0 (fully-masked row) staying zero.

Trait Implementations§

Auto Trait Implementations§

§

impl<E> Freeze for RowWise<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for RowWise<E>
where E: RefUnwindSafe,

§

impl<E> Send for RowWise<E>

§

impl<E> Sync for RowWise<E>

§

impl<E> Unpin for RowWise<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for RowWise<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for RowWise<E>
where E: 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = 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.