docsapi referencedarkforest-core-tensor-layout
API Referencecrate: darkforest-coresince v0.1.0-alpha

Layout

Memory layout categorization used by kernel dispatchers to select optimal vectorized loops.

Layout

darkforest-core module: tensor since v0.1.0-alpha

Signature

rust
pub enum Layout { Contiguous, Strided, Broadcasted }

Overview

Memory layout categorization used by kernel dispatchers to select optimal vectorized loops.

Invariants & Design Principles

  • Invariant: Contiguous layouts dispatch directly to SIMD vectorized assembly.

Usage Example

rust
match tensor.layout() { Layout::Contiguous => (), _ => () }

Related Components