strided_basic/inline.rs
1//! Inline (heap-free up to a bound) metadata collections shared by the
2//! strided-basic planner and plan types.
3//!
4//! [`strided_view::INLINE_RANK`] is the workspace capacity constant ([#306]
5//! P2). [`InlineVec`] is the rank-bounded metadata vector, and [`OperandVec`]
6//! holds the destination plus up to four inputs (five slots, matching
7//! `zip_map4_into` and erased fusion). Both are `tinyvec` [`TinyVec`]s: they
8//! store up to their bound inline and spill to the heap above it, never
9//! erroring ([#306] P1, P4; crate policy in [#312]).
10//!
11//! [#306]: https://github.com/tensor4all/strided-rs/issues/306
12//! [#312]: https://github.com/tensor4all/strided-rs/issues/312
13
14/// Inline vector of at most [`strided_view::INLINE_RANK`] elements.
15pub type InlineVec<T> = tinyvec::TinyVec<[T; strided_view::INLINE_RANK]>;
16
17/// Number of operand slots: destination plus up to four inputs.
18pub const OPERAND_CAP: usize = 5;
19
20/// Inline vector of at most [`OPERAND_CAP`] operands (strides, offsets, ...).
21pub type OperandVec<T> = tinyvec::TinyVec<[T; OPERAND_CAP]>;