diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 147905b..0000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,4 +0,0 @@ -[alias] -tex = ["rustdoc", "--", "--html-in-header", "katex.html"] -[build] -rustflags = ["-C", "target-cpu=native"] diff --git a/README.md b/README.md index 6418e81..7a209a9 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ Lane-Associated Vector (LAV): [Portable SIMD] vector trait as GAT of SIMD lane t **NOTE**: This crate requires nightly Rust. +This [`example`] uses SIMD generically over floating-point types while hiding it from the user. + # Features * SIMD lane trait [`Real`] abstracting over [`f32`] and [`f64`]. @@ -25,15 +27,18 @@ Lane-Associated Vector (LAV): [Portable SIMD] vector trait as GAT of SIMD lane t * Generic associated type (GAT) [`Real::Simd`] as part of SIMD lane trait [`Real`] implementing SIMD vector trait [`SimdReal`] for itself as lane type where the GAT is generic over the number of SIMD vector lanes `N`. - * Supports [AoS/SoA/AoSoA] via [`Real::as_simd`]/[`Real::as_simd_mut`] abstracting over + * [AoS/SoA/AoSoA] via [`Real::as_simd`]/[`Real::as_simd_mut`] abstracting over [`as_simd`]/[`as_simd_mut`] of [`f32`] and [`f64`] slices. * Lanewise approximate equality test wrt to epsilon and [ULP] SIMD vectors. * [`ApproxEq`] trait complementing [`PartialEq`]. - * [`no_std`] without loss of functionality by enabling the [`libm`] feature. -This [`example`] uses SIMD generically over floating-point types while hiding it from the user. +# Optional Features + +Following features are disabled by default unless their feature gate is enabled: -See the [release history] to keep track of the development. + * [`target-features`]: Provides native number of SIMD vector lanes + `Real::NATIVE_LANE_COUNT` for the current build target. + * [`libm`]: Enables [`no_std`] without loss of functionality. [Portable SIMD]: https://doc.rust-lang.org/nightly/core/simd/index.html [`Real`]: https://docs.rs/lav/latest/lav/trait.Real.html @@ -50,23 +55,21 @@ See the [release history] to keep track of the development. [ULP]: https://en.wikipedia.org/wiki/Unit_in_the_last_place [`ApproxEq`]: https://docs.rs/lav/latest/lav/trait.ApproxEq.html [`PartialEq`]: https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html -[`no_std`]: https://docs.rust-embedded.org/book/intro/no-std.html +[`target-features`]: https://docs.rs/target-features [`libm`]: https://docs.rs/libm +[`no_std`]: https://docs.rust-embedded.org/book/intro/no-std.html [`example`]: https://docs.rs/lav/latest/lav/example/index.html [release history]: RELEASES.md # Documentation Builds +Build and open documentation of this crate and its dependencies using KaTeX. + ```sh -# Build and open documentation inclusive dependencies. -cargo doc --open -# Rebuild this crate's documentation with KaTeX. -cargo tex -# Refresh opened documentation. +env RUSTDOCFLAGS="--html-in-header $PWD/katex.html" cargo doc --features target-features --open ``` -With `cargo tex` defined in [.cargo/config.toml](.cargo/config.toml). Note that navigating the -documentation requires web access as KaTeX is embedded via remote CDN. +Note that navigating the documentation requires web access as KaTeX is embedded via remote CDN. ## License diff --git a/src/lib.rs b/src/lib.rs index 84d0d90..75b52ab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,6 +8,8 @@ //! //! **NOTE**: This crate requires nightly Rust. //! +//! This [`example`] uses SIMD generically over floating-point types while hiding it from the user. +//! //! # Features //! //! * SIMD lane trait [`Real`] abstracting over [`f32`] and [`f64`]. @@ -16,13 +18,18 @@ //! * Generic associated type (GAT) [`Real::Simd`] as part of SIMD lane trait [`Real`] //! implementing SIMD vector trait [`SimdReal`] for itself as lane type where the //! GAT is generic over the number of SIMD vector lanes `N`. -//! * Supports [AoS/SoA/AoSoA] via [`Real::as_simd`]/[`Real::as_simd_mut`] abstracting over +//! * [AoS/SoA/AoSoA] via [`Real::as_simd`]/[`Real::as_simd_mut`] abstracting over //! [`as_simd`]/[`as_simd_mut`] of [`f32`] and [`f64`] slices. //! * Lanewise approximate equality test wrt to epsilon and [ULP] SIMD vectors. //! * [`ApproxEq`] trait complementing [`PartialEq`]. -//! * [`no_std`] without loss of functionality by enabling the [`libm`] feature. //! -//! This [`example`] uses SIMD generically over floating-point types while hiding it from the user. +//! # Optional Features +//! +//! Following features are disabled by default unless their feature gate is enabled: +//! +//! * [`target-features`]: Provides native number of SIMD vector lanes +//! `Real::NATIVE_LANE_COUNT` for the current build target. +//! * [`libm`]: Enables [`no_std`] without loss of functionality. //! //! [Portable SIMD]: `core::simd` //! [`Simd`]: `core::simd::Simd` @@ -30,6 +37,7 @@ //! [`Real::Simd`]: `Real::Simd` //! [`as_simd`]: `slice::as_simd` //! [`as_simd_mut`]: `slice::as_simd_mut` +//! [`target-features`]: https://docs.rs/target-features //! [`libm`]: https://docs.rs/libm //! [`no_std`]: https://docs.rust-embedded.org/book/intro/no-std.html //! [AoS/SoA/AoSoA]: https://en.wikipedia.org/wiki/AoS_and_SoA