pub enum LayoutStrategy {
RowMajor,
ColumnMajor,
Blocked {
block_size: usize,
},
Tiled {
tile_height: usize,
tile_width: usize,
},
ZOrder,
Hilbert,
}Expand description
Memory layout strategy for tensors.
Variants§
RowMajor
Row-major order (C-style, default for most systems)
ColumnMajor
Column-major order (Fortran-style, good for column operations)
Blocked
Blocked layout for cache-friendly access
Tiled
Tiled layout with specific tile dimensions
ZOrder
Z-order (Morton) curve for locality preservation
Hilbert
Hilbert curve for even better locality
Implementations§
Source§impl LayoutStrategy
impl LayoutStrategy
Sourcepub fn for_operation(op: &str) -> Self
pub fn for_operation(op: &str) -> Self
Get the recommended strategy for a given operation pattern.
Sourcepub fn supports_vectorization(&self) -> bool
pub fn supports_vectorization(&self) -> bool
Check if this layout benefits from vectorization.
Sourcepub fn preserves_locality(&self) -> bool
pub fn preserves_locality(&self) -> bool
Check if this layout preserves spatial locality.
Trait Implementations§
Source§impl Clone for LayoutStrategy
impl Clone for LayoutStrategy
Source§fn clone(&self) -> LayoutStrategy
fn clone(&self) -> LayoutStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LayoutStrategy
impl Debug for LayoutStrategy
Source§impl Default for LayoutStrategy
impl Default for LayoutStrategy
Source§fn default() -> LayoutStrategy
fn default() -> LayoutStrategy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LayoutStrategy
impl<'de> Deserialize<'de> for LayoutStrategy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for LayoutStrategy
impl Hash for LayoutStrategy
Source§impl PartialEq for LayoutStrategy
impl PartialEq for LayoutStrategy
Source§impl Serialize for LayoutStrategy
impl Serialize for LayoutStrategy
impl Copy for LayoutStrategy
impl Eq for LayoutStrategy
impl StructuralPartialEq for LayoutStrategy
Auto Trait Implementations§
impl Freeze for LayoutStrategy
impl RefUnwindSafe for LayoutStrategy
impl Send for LayoutStrategy
impl Sync for LayoutStrategy
impl Unpin for LayoutStrategy
impl UnwindSafe for LayoutStrategy
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