Skip to main content

Module execution

Module execution 

Source
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§

KernelPlan
Blocking metadata produced by the execution planners; not a layout-validity proof.
SendPtr
A raw pointer wrapper that is Send + Sync.
ValidatedDestinationLayout
Internal validation marker used by kernel-family execution adapters.

Enums§

KernelClass
Serial cost class of a kernel; see the module documentation of strided-basic/src/cost.rs for the table.

Constants§

SMALL_TENSOR_THRESHOLD
Maximum total elements for the small tensor fast path. Tensors at or below this size skip compute_order and compute_block_sizes since 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 range within the budget of exec.
parallel_width
Width of a flat entry (one section) that exec should use for elements elements of class: the width in 1..=budget that minimises the section cost plus the share of the work, 1 when 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 in 1..=budget that minimises ceil(log2 k) * D(k) + estimate / k among the widths at which ceil(log2 k) sections pay, 1 when 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.