6 releases

new 0.2.4 Mar 9, 2025
0.2.3 Mar 9, 2025
0.1.1 Mar 7, 2025
0.0.0-reserved Feb 24, 2025

#129 in WebAssembly

Download history 97/week @ 2025-02-19 32/week @ 2025-02-26 516/week @ 2025-03-05

645 downloads per month

MIT/Apache

165KB
4.5K SLoC

Macerator

Originally a thin wrapper around pulp to provide type-generic SIMD operations using similar traits to the standard library, but now uses its own backend for more ergonomic type inference behaviour. Currently in an MVP state, with only operations and backends needed for burn, which means no unstable features are currently used. This may change in the future, but it will likely keep following burn quite closely.

Backends

Currently supports backends for x86_64-v2, x86_64-v3, x86_64-v4 (nightly only), aarch64 and wasm32. Note that wasm32 doesn't support runtime feature detection, so binary must be built with target_feature=+simd128. f16 support for x86_64-v4 is disabled by default, since only one Intel arch currently supports it, and AMD has no support. This may change as support expands.

Example

fn clamp<S: Simd, T: VOrd>(value: Vector<S, T>, min: T, max: T) -> Vector<S, T> {
    let min = min.splat();
    let max = max.splat();
    value.min(max).max(min)
}

Dependencies

~1.3–1.9MB
~39K SLoC