Skip to main content

Module lane_kernels

Module lane_kernels 

Source
Expand description

Elementwise lane kernels over indexed sources.

Replaces &[T] with an IndexedSource trait: each lane read is unsafe fn get_unchecked(i) -> Item, independent across iterations. For &[T] this inlines to the same indexed load as the slice kernel; for LaneZip(&[A], &[B]) it gives two independent indexed reads per lane — both shapes the auto-vectorizer handles.

The module is split into:

The kernels never allocate. Both kernel families handle a mask with a non-byte-aligned offset and with a logical len shorter than the underlying byte buffer, via BitBuffer::chunks.

Re-exports§

pub use map_in_place::IndexedSinkExt;
pub use map_into::IndexedSourceExt;
pub use sink::IndexedSink;
pub use sink::ReinterpretSink;
pub use source::IndexedSource;
pub use source::LaneZip;

Modules§

map_in_place
In-place lane kernels: read from an IndexedSink and write back through the same sink (no separate output buffer).
map_into
Out-of-place lane kernels: read from an IndexedSource and write into a caller-provided &mut [MaybeUninit<R>].
sink
Writable lane sink — the IndexedSink trait and the ReinterpretSink adapter for in-place type-punning kernels.
source
Read-only lane source — the IndexedSource trait and the LaneZip adapter.