pub struct SimdDetector { /* private fields */ }Available on x86 or x86-64 only.
Expand description
SIMD capability detector for the CPU
Implementations§
Source§impl SimdDetector
impl SimdDetector
Sourcepub fn new() -> Self
pub fn new() -> Self
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: Transcendental>() -> usize
pub fn recommended_simd_width<T: Transcendental>() -> usize
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§
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