pub fn avx512_supported() -> boolExamples found in repository?
crates/competitive/src/tools/avx_helper.rs (line 43)
40pub fn simd_backend() -> SimdBackend {
41 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
42 {
43 if avx512_enabled() && avx512_supported() {
44 return SimdBackend::Avx512;
45 }
46 if is_x86_feature_detected!("avx2") {
47 return SimdBackend::Avx2;
48 }
49 }
50 SimdBackend::Scalar
51}More examples
crates/competitive/src/num/mint/montgomery_dot_product.rs (line 47)
43 fn add_scaled_assign(x: &mut [MInt<Self>], y: &[MInt<Self>], a: &MInt<Self>) {
44 assert_eq!(x.len(), y.len());
45 #[cfg(target_arch = "x86_64")]
46 if x.len() >= 16 {
47 if x.len() >= 64 && avx512_enabled() && avx512_supported() {
48 unsafe { simd::add_scaled_avx512::<Self>(x, y, a) };
49 return;
50 }
51 if is_x86_feature_detected!("avx2") {
52 unsafe { simd::add_scaled_avx2::<Self>(x, y, a) };
53 return;
54 }
55 }
56 for (x, y) in x.iter_mut().zip(y) {
57 *x += *a * *y;
58 }
59 }