pub trait TileIO {
// Required method
unsafe fn address(&self, base: *const f32, c: Coord2) -> *const f32;
// Provided methods
unsafe fn load(&self, base: *const f32, c: Coord2) -> f32 { ... }
unsafe fn store(&self, base: *mut f32, c: Coord2, v: f32) { ... }
unsafe fn prefetch(&self, base: *const f32, c: Coord2) { ... }
}Expand description
Tile I/O trait — load / store / prefetch parameterized over the
physical layout. Two impls today: RowMajorTile (the standard
flat layout) and StridedTile (when reading a non-contiguous
view, e.g. last-axis Narrow into Attention).
Methods take pointers (not slices) so the abstraction works for both owned and aliased buffers.
Required Methods§
Provided Methods§
Sourceunsafe fn load(&self, base: *const f32, c: Coord2) -> f32
unsafe fn load(&self, base: *const f32, c: Coord2) -> f32
Load a tile element by (row, col).
SAFETY: caller ensures the address is valid for read.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".