pub unsafe fn compute_costs<S: AsRef<[isize]>>(
all_strides: &[S],
) -> InlineVec<isize>Expand description
Prevalidated compute costs for kernel-family implementations.
§Safety
All rank-indexed arrays must have matching lengths and a valid destination index (when present). Shape products, stride magnitudes, cost arithmetic, and every intermediate offset used by planning/iteration must be representable. Iteration blocks must be positive and offsets must correspond to the supplied layouts; threaded partitioning additionally requires positive costs. Callback memory accesses must be valid for each generated block, with disjoint mutable regions when partitions execute concurrently.
§Examples
use strided_basic::execution::*;
// SAFETY: the example supplies matching bounded layouts and disjoint storage.
let costs = unsafe { compute_costs(&[vec![1, 4], vec![1, 8]]) };
assert_eq!(costs.as_slice(), [2, 8]);