Expand description
Execution contract for operation-family implementations.
This module is the shared kernel-extension interface, not a public mirror
of implementation modules. Prevalidated entries require the caller to prove
the exact destination geometry and every omitted shape check. A layout marker
alone does not prove those obligations. Ordinary callers should use the
checked APIs at the crate root. Every family that can fan out takes the same
Exec placement token as its last parameter.
§Examples
use strided_basic::{Exec, StridedArray, execution::*};
let src = StridedArray::<f64>::col_major(&[2]);
let mut dst = StridedArray::<f64>::col_major(&[2]);
let marker = validate_destination_layout_without_alloc(&[2], &[1]).unwrap();
// SAFETY: both arrays have shape [2], distinct storage, and the checked layout.
unsafe { map_into_validated(&mut dst.view_mut(), &src.view(), |x| x, marker, Exec::serial()) }.unwrap();A marker alone does not make the prevalidated entry safe to call:
ⓘ
use strided_basic::{Exec, StridedArray, execution::*};
let src = StridedArray::<f64>::col_major(&[2]);
let mut dst = StridedArray::<f64>::col_major(&[2]);
let marker = validate_destination_layout_without_alloc(&[2], &[1]).unwrap();
map_into_validated(&mut dst.view_mut(), &src.view(), |x| x, marker, Exec::serial()).unwrap();Structs§
- Kernel
Plan - Blocking metadata produced by the execution planners; not a layout-validity proof.
- SendPtr
- A raw pointer wrapper that is
Send+Sync. - Validated
Destination Layout - Internal validation marker used by kernel-family execution adapters.
Enums§
- Kernel
Class - Serial cost class of a kernel; see the module documentation of
strided-basic/src/cost.rsfor the table.
Constants§
- SMALL_
TENSOR_ THRESHOLD - Maximum total elements for the small tensor fast path.
Tensors at or below this size skip
compute_orderandcompute_block_sizessince they fit in L1 cache and blocking provides no benefit.
Functions§
- build_
plan_ ⚠fused - Prevalidated build plan fused for kernel-family implementations.
- build_
plan_ ⚠fused_ small - Prevalidated build plan fused small for kernel-family implementations.
- check_
dtype - Check a descriptor dtype against a prepared operation.
- check_
static_ indexing_ dtype - Check whether a dtype has a static-indexing implementation.
- compute_
costs ⚠ - Prevalidated compute costs for kernel-family implementations.
- dynamic_
slice_ ⚠into_ uninit - Full-overwrite indexed replay for an operation-family adapter.
- dynamic_
update_ ⚠into_ uninit - Full-overwrite indexed replay for an operation-family adapter.
- ensure_
same_ shape - Check exact shape agreement before prevalidated replay.
- erased_
view - Borrow initialized element storage and its descriptor metadata.
- for_
each_ ⚠inner_ block_ preordered - Prevalidated for each inner block preordered for kernel-family implementations.
- gather_
into_ ⚠uninit - Full-overwrite indexed replay for an operation-family adapter.
- is_
injective_ layout - Decide whether distinct logical positions map to distinct offsets.
- map_
into_ ⚠validated - Prevalidated map into validated for kernel-family implementations.
- map_
raw_ ⚠into_ validated - Prevalidated map raw into validated for kernel-family implementations.
- mapreduce_
threaded ⚠ - Prevalidated mapreduce threaded for kernel-family implementations.
- parallel_
map_ reduce - Recursive halving map-reduce over
rangewithin the budget ofexec. - parallel_
width - Width of a flat entry (one section) that
execshould use forelementselements ofclass: the width in1..=budgetthat minimises the section cost plus the share of the work,1when no width pays. - scatter_
into_ ⚠uninit - Full-overwrite indexed replay for an operation-family adapter.
- tree_
width - Width of a tree entry (
parallel_map_reduce): the width in1..=budgetthat minimisesceil(log2 k) * D(k) + estimate / kamong the widths at whichceil(log2 k)sections pay,1when none does. - validate_
destination_ layout - Validate destination injectivity and return the replay marker.
- validate_
destination_ layout_ without_ alloc - Validate injectivity without allocating a set of offsets.
- validate_
uninit_ no_ overlap - Reject an input overlapping any byte of the output backing allocation.
- zip_
map2_ ⚠into_ validated - Prevalidated zip map2 into validated for kernel-family implementations.
- zip_
map2_ ⚠raw_ into_ validated - Prevalidated zip map2 raw into validated for kernel-family implementations.
- zip_
map3_ ⚠into_ validated - Prevalidated zip map3 into validated for kernel-family implementations.
- zip_
map4_ ⚠into_ validated - Prevalidated zip map4 into validated for kernel-family implementations.