Skip to main content

ReduceOutputLayout

Struct ReduceOutputLayout 

Source
pub struct ReduceOutputLayout { /* private fields */ }
Expand description

Maps a (write_index, k_iter) coordinate to a flat vector position in the output buffer. Strides are expressed in vector units (one step along the output’s SIMD axis = one unit in write_stride).

For rank-1 outputs (or any case where reduce_axis == out_vec_axis), the caller should pass write_stride = 0 and num_writes = 1, so the layout collapses to position = k_iter * k_stride.

Implementations§

Source§

impl ReduceOutputLayout

Source

pub fn new( k_stride: usize, write_stride: usize, num_writes: usize, accumulator_length: usize, ) -> ReduceOutputLayout

Source

pub fn __expand_new( scope: &mut Scope, k_stride: <usize as RudaType>::ExpandType, write_stride: <usize as RudaType>::ExpandType, num_writes: <usize as RudaType>::ExpandType, accumulator_length: <usize as RudaType>::ExpandType, ) -> <ReduceOutputLayout as RudaType>::ExpandType

Trait Implementations§

Source§

impl Clone for ReduceOutputLayout

Source§

fn clone(&self) -> ReduceOutputLayout

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Layout for ReduceOutputLayout

Source§

type Coordinates = (u32, u32)

The coordinate type used by the conceptual tensor represented by this layout, i.e. (u32, u32, u32) for a fixed-rank 3D tensor. This does not have to match the rank of the underlying storage (if applicable). It’s only how the tensor is interpreted (viewed) by the code.
Source§

type SourceCoordinates = usize

The coordinate type used by the inner storage wrapped in this layout, i.e. u32 for Array, or (u32, u32) for a 2D view.
Source§

fn to_source_pos(&self, coords: Self::Coordinates) -> Coords1d

Transform a set of n-dimensional coordinates to a source coordinate space. It is recommended to use absolute positions here, and handle the translation into vectors at the lowest level (global memory layout).
Source§

fn to_source_pos_checked(&self, coords: Self::Coordinates) -> (Coords1d, bool)

Transform a set of n-dimensional coordinates to an offset into the underlying storage, and return whether the position is in bounds of this layout. See also Layout::to_source_pos
Source§

fn shape(&self) -> Self::Coordinates

The shape of the conceptual tensor represented by this layout. Not necessarily the extent of the underlying storage, but only this view of it.
Source§

fn is_in_bounds(&self, pos: Self::Coordinates) -> bool

Source§

fn __expand_to_source_pos( scope: &mut Scope, this: Self::ExpandType, pos: <Self::Coordinates as RudaType>::ExpandType, ) -> <Self::SourceCoordinates as RudaType>::ExpandType

Source§

fn __expand_to_source_pos_checked( scope: &mut Scope, this: Self::ExpandType, pos: <Self::Coordinates as RudaType>::ExpandType, ) -> <(Self::SourceCoordinates, bool) as RudaType>::ExpandType

Source§

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

Source§

fn __expand_is_in_bounds( scope: &mut Scope, this: Self::ExpandType, pos: <Self::Coordinates as RudaType>::ExpandType, ) -> <bool as RudaType>::ExpandType

Source§

impl RudaType for ReduceOutputLayout

Auto Trait Implementations§

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<C> CloneExpand for C
where C: Clone,

Source§

fn __expand_clone_method(&self, _scope: &mut Scope) -> C

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> TuneInputs for T
where T: Clone + Send + Sync + 'static,

Source§

type At<'a> = T

The concrete input type at lifetime 'a.