pub struct CpuFeatures {
pub sse2: bool,
pub sse4_2: bool,
pub popcnt: bool,
pub avx: bool,
pub avx2: bool,
pub neon: bool,
}Expand description
Detected CPU features for SIMD dispatch
Fields§
§sse2: boolSSE2 support
sse4_2: boolSSE4.2 support
popcnt: boolPOPCNT instruction support
avx: boolAVX support
avx2: boolAVX2 support
neon: boolNEON support (AArch64 only)
Implementations§
Source§impl CpuFeatures
impl CpuFeatures
Sourcepub fn detect() -> Self
pub fn detect() -> Self
Detect CPU features at runtime
This matches the C++ ProcessorSupport::POPCNTenabled() method and extends it to detect all SIMD features used by RustAlign.
Sourcepub fn x86_64_v3(&self) -> bool
pub fn x86_64_v3(&self) -> bool
Check if x86-64-v3 (AVX2) is supported
This matches the C++ __builtin_cpu_supports(“x86-64-v3”) check.
Sourcepub fn simd_width(&self) -> usize
pub fn simd_width(&self) -> usize
Get the best available SIMD width
Trait Implementations§
Source§impl Clone for CpuFeatures
impl Clone for CpuFeatures
Source§fn clone(&self) -> CpuFeatures
fn clone(&self) -> CpuFeatures
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CpuFeatures
impl Debug for CpuFeatures
Source§impl Default for CpuFeatures
impl Default for CpuFeatures
impl Copy for CpuFeatures
Auto Trait Implementations§
impl Freeze for CpuFeatures
impl RefUnwindSafe for CpuFeatures
impl Send for CpuFeatures
impl Sync for CpuFeatures
impl Unpin for CpuFeatures
impl UnsafeUnpin for CpuFeatures
impl UnwindSafe for CpuFeatures
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