pub unsafe fn for_each_inner_block_preordered<S: AsRef<[isize]>, F>(
dims: &[usize],
blocks: &[usize],
strides: &[S],
initial_offsets: &[isize],
f: F,
) -> Result<()>Expand description
Prevalidated for each inner block preordered 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 mut count = 0;
unsafe { for_each_inner_block_preordered(&[4], &[4], &[vec![1]], &[0], |_, n, _| { count += n; Ok(()) }) }.unwrap();
assert_eq!(count, 4);§Errors
Performs no validation of its own, so the only error it can return is the
one f returns; the block walk itself cannot fail. Callers must still
satisfy the safety contract before invoking this prevalidated entry.