Skip to main content

avx512_enabled

Function avx512_enabled 

Source
pub fn avx512_enabled() -> bool
Examples found in repository?
crates/competitive/src/tools/avx_helper.rs (line 31)
28pub fn simd_backend() -> SimdBackend {
29    #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
30    {
31        if avx512_enabled()
32            && is_x86_feature_detected!("avx512f")
33            && is_x86_feature_detected!("avx512dq")
34            && is_x86_feature_detected!("avx512cd")
35            && is_x86_feature_detected!("avx512bw")
36            && is_x86_feature_detected!("avx512vl")
37        {
38            return SimdBackend::Avx512;
39        }
40        if is_x86_feature_detected!("avx2") {
41            return SimdBackend::Avx2;
42        }
43    }
44    SimdBackend::Scalar
45}