Lane-Associated Vector (LAV): Portable SIMD vector trait as GAT of SIMD lane trait.
NOTE: This crate requires nightly Rust.
This example
uses SIMD generically over floating-point types while hiding it from the user.
- SIMD lane trait
Real
abstracting overf32
andf64
. - SIMD vector trait
SimdReal<Real, N>
abstracting overSimd<f32, N>
andSimd<f64, N>
. - Generic associated type (GAT)
Real::Simd<N>
as part of SIMD lane traitReal
implementing SIMD vector traitSimdReal<Self, N>
for itself as lane type where the GAT is generic over the number of SIMD vector lanesN
. - AoS/SoA/AoSoA via
Real::as_simd
/Real::as_simd_mut
abstracting overas_simd
/as_simd_mut
off32
andf64
slices. - Lanewise approximate equality test wrt to epsilon and ULP SIMD vectors.
ApproxEq
trait complementingPartialEq
.
Following features are disabled by default unless their feature gate is enabled:
target-features
: Provides native number of SIMD vector lanesReal::NATIVE_LANE_COUNT
for the current build target.libm
: Enablesno_std
without loss of functionality.
Build and open documentation of this crate and its dependencies using KaTeX.
env RUSTDOCFLAGS="--html-in-header $PWD/katex.html" cargo doc --features target-features --open
Note that navigating the documentation requires web access as KaTeX is embedded via remote CDN.
Copyright © 2021-2024 Rouven Spreckels [email protected]
Licensed under the terms of the MPL-2.0
.
The MPL allows the integration of MPL-licensed code into proprietary codebases, as long as the MPL-licensed components remain accessible under the terms of the MPL.
Unless you explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Covered Software by You shall be licensed as above, without any additional terms or conditions.