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
impl ReduceOutputLayout
pub fn new( k_stride: usize, write_stride: usize, num_writes: usize, accumulator_length: usize, ) -> ReduceOutputLayout
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
impl Clone for ReduceOutputLayout
Source§impl Layout for ReduceOutputLayout
impl Layout for ReduceOutputLayout
Source§type Coordinates = (u32, u32)
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
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
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)
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_posSource§fn shape(&self) -> Self::Coordinates
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.
fn is_in_bounds(&self, pos: Self::Coordinates) -> bool
fn __expand_to_source_pos( scope: &mut Scope, this: Self::ExpandType, pos: <Self::Coordinates as RudaType>::ExpandType, ) -> <Self::SourceCoordinates as RudaType>::ExpandType
fn __expand_to_source_pos_checked( scope: &mut Scope, this: Self::ExpandType, pos: <Self::Coordinates as RudaType>::ExpandType, ) -> <(Self::SourceCoordinates, bool) as RudaType>::ExpandType
fn __expand_shape( scope: &mut Scope, this: Self::ExpandType, ) -> <Self::Coordinates as RudaType>::ExpandType
fn __expand_is_in_bounds( scope: &mut Scope, this: Self::ExpandType, pos: <Self::Coordinates as RudaType>::ExpandType, ) -> <bool as RudaType>::ExpandType
Auto Trait Implementations§
impl Freeze for ReduceOutputLayout
impl RefUnwindSafe for ReduceOutputLayout
impl Send for ReduceOutputLayout
impl Sync for ReduceOutputLayout
impl Unpin for ReduceOutputLayout
impl UnsafeUnpin for ReduceOutputLayout
impl UnwindSafe for ReduceOutputLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more