Skip to main content

Module kernels

Module kernels 

Source
Expand description

Generic CPU compute kernels, written over the element traits and plain slices + Layout. The impl FloatOps/IntOps/BoolOps for Cpu blocks dispatch the storage enums to these.

Modules§

element
Per-element numeric traits. Generic CPU kernels are written over these, then the storage enums dispatch to the concrete f32/f64/i32/… instantiation.
elementwise
Generic elementwise kernels (binary, binary-scalar, unary, comparison, in-place accumulate). Ported from luma-core’s arith.rs, generalized over the CpuNum element trait and returning plain Vecs.
indexing
Indexing kernels: index_select, gather, index_add, scatter_add. Ported from luma-core storage.rs. All require contiguous inputs.
iter
Shared strided-iteration helpers used by the generic CPU kernels, plus the DimArray view for iterating a single (possibly strided) dimension.
matmul
Batched matmul. Ported from luma-core matmul.rs. f32/f64 go through the gemm crate; other element types use a naive triple loop.
nn
Fused nn kernels: softmax and rms_norm. Ported from luma-core nn.rs.
reduce
Generic reduction kernels. Ported from luma-core reduce.rs.
shape
Shape-movement kernels that materialize data: concatenation.