pub trait LayoutExpand: Clone {
type Coordinates: Coordinates;
type SourceCoordinates: Coordinates;
// Required methods
fn __expand_to_source_pos_method(
self,
scope: &mut Scope,
pos: <Self::Coordinates as CubeType>::ExpandType,
) -> <Self::SourceCoordinates as CubeType>::ExpandType;
fn __expand_to_source_pos_checked_method(
self,
scope: &mut Scope,
pos: <Self::Coordinates as CubeType>::ExpandType,
) -> <(Self::SourceCoordinates, bool) as CubeType>::ExpandType;
fn __expand_shape_method(
self,
scope: &mut Scope,
) -> <Self::Coordinates as CubeType>::ExpandType;
fn __expand_is_in_bounds_method(
self,
scope: &mut Scope,
pos: <Self::Coordinates as CubeType>::ExpandType,
) -> <bool as CubeType>::ExpandType;
}Expand description
A layout that represents the mapping from a conceptual multi-dimensional tensor to a linear storage. Some layouts may be transformers meant to be composed with others (i.e. swizzling), others will represent the actual underlying structure of the data.
Required Associated Types§
Sourcetype Coordinates: Coordinates
type Coordinates: Coordinates
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.
Sourcetype SourceCoordinates: Coordinates
type SourceCoordinates: Coordinates
The coordinate type used by the inner storage wrapped in this layout, i.e. u32 for
Array, or (u32, u32) for a 2D view.
Required Methods§
fn __expand_to_source_pos_method( self, scope: &mut Scope, pos: <Self::Coordinates as CubeType>::ExpandType, ) -> <Self::SourceCoordinates as CubeType>::ExpandType
fn __expand_to_source_pos_checked_method( self, scope: &mut Scope, pos: <Self::Coordinates as CubeType>::ExpandType, ) -> <(Self::SourceCoordinates, bool) as CubeType>::ExpandType
fn __expand_shape_method( self, scope: &mut Scope, ) -> <Self::Coordinates as CubeType>::ExpandType
fn __expand_is_in_bounds_method( self, scope: &mut Scope, pos: <Self::Coordinates as CubeType>::ExpandType, ) -> <bool 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.