Expand description
Pure-Rust CPU kernels for nuvec.
Kernels work on typed slices and know nothing about arrays or graphs; nuvec-core
dispatches to them. Inputs may have any layout (contiguous, transposed, sliced with
negative steps, broadcast with zero strides); outputs are always row-contiguous.
Status: pre-alpha. Element-wise, reduction and matrix-multiplication kernels.
Structs§
- MatView
- A strided matrix: element
(i, j)lives atdata[offset + i·row_stride + j·col_stride]. - View
- A strided view of elements: element
i(a multi-index) lives atdata[offset + Σ i_k · strides_k].
Constants§
- VERSION
- The version of this crate.
Traits§
- Gemm
- An element type with a GEMM kernel:
f32,f64,f16, and[f32; 2](complex64 as(re, im)).
Functions§
- collapse_
dims - Merges adjacent dimensions that are contiguous for every operand and drops unit dimensions, so that common layouts iterate as one flat loop.
- map1
- Applies
felement-wise:out[i] = f(a[i])in row-major order ofshape. - map2
- Applies
felement-wise:out[i] = f(a[i], b[i])in row-major order ofshape. - map3
- Applies
felement-wise:out[i] = f(a[i], b[i], c[i])in row-major order ofshape. - matmul
out = a · bfor anm × kmatrixaand ak × nmatrixb;outis row-majorm × n. Operands may have any strides (transposed, reversed, broadcast).- reduce
- Folds blocks of elements:
out[i]is the fold of thereducedblock at output positioni, starting frominit.keptandreducedare(shape, strides)pairs that split the input’s dimensions; the output is row-major overkept.