npsimd 0.3.0

An ergonomic library for architecture-specific vectorization.
Documentation
//! The Advanced Vector eXtensions.
//!
//! This generation of SIMD instructions operate on 32-byte (256-bit) vectors.
//! Intrinsics are implemented as methods on [`Use`]; see its documentation.

use super::*;

mod avx;
pub use avx::AVX;

mod avx2;
pub use avx2::AVX2;

/// The AVX feature set group.
pub struct FeatureGroup;

/// Support for the AVX generation of SIMD instructions.
pub struct Use<FS>
where FS: FeatureSet<FeatureGroup> {
    /// The set of supported features.
    _features: FS,
}

impl<FS> Use<FS>
where FS: FeatureSet<FeatureGroup> {
    /// Construct AVX support from a [`RuntimeSupport`].
    pub fn new(runtime: &RuntimeSupport) -> Option<Self> {
        Some(Self { _features: FS::get_support(runtime)? })
    }
}