csv_lib/models/
platform_info.rs1
2
3#[derive(Debug)]
4pub struct PlatformInfo{
8 pub supports_neon: bool,
9 pub supports_avx2: bool,
10 pub supports_memcacher3 : bool,
11}
12
13impl Default for PlatformInfo {
16 fn default() -> Self {
17 Self {
18 supports_avx2 : false,
19 supports_memcacher3: true,
20 supports_neon: false,
21 }
22 }
23}
24
25
26impl PlatformInfo {
27 pub fn new() -> Self{
30 let mut plat = Self::default();
31 #[cfg(target_arch = "x86_64")]
32 {
33 if is_x86_feature_detected!("avx2") {
34 plat.supports_avx2 = true;
35 }
36 }
37 #[cfg(target_arch = "aarch64")]
38 {
39 plat.supports_neon = true;
40 }
41 plat
42 }
43}
44
45
46