pub struct SimdDetector { /* private fields */ }Expand description
SIMD capability detector for the CPU
Implementations§
Source§impl SimdDetector
impl SimdDetector
Sourcepub fn new() -> SimdDetector
pub fn new() -> SimdDetector
Creates a detector and determines the current CPU’s capabilities.
Uses std::arch::is_x86_feature_detected! on x86/x86_64
and std::arch::is_aarch64_feature_detected! on AArch64.
On other targets, all features are reported as unavailable.
Sourcepub fn recommended_simd_width<T>() -> usizewhere
T: Transcendental,
pub fn recommended_simd_width<T>() -> usizewhere
T: Transcendental,
Returns the maximum recommended SIMD width for the current platform.
On x86_64: 8 if AVX available, 4 if SSE2 available. On AArch64: 4 if NEON available. On wasm32: 4. Fallback: 1 (scalar).
Trait Implementations§
Source§impl Default for SimdDetector
impl Default for SimdDetector
Source§fn default() -> SimdDetector
fn default() -> SimdDetector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SimdDetector
impl RefUnwindSafe for SimdDetector
impl Send for SimdDetector
impl Sync for SimdDetector
impl Unpin for SimdDetector
impl UnsafeUnpin for SimdDetector
impl UnwindSafe for SimdDetector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more