You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Check if /sys/devices/cpu exists - if it does, then this is not a "Performance-hybrid" CPU.
139
+
if std::fs::exists("/sys/devices/cpu").expect("Could not check the CPU architecture detali: could not check if `/sys/devices/cpu` exists!"){
140
+
None
141
+
}
142
+
// Check if /sys/devices/cpu_core exists - if it does, then this is a "Performance-hybrid" CPU.
143
+
elseif std::fs::exists("/sys/devices/cpu_core").expect("Could not check the CPU architecture detali: could not check if `/sys/devices/cpu_core` exists!"){
// If neither dir exists, then something is wrong - `/sys/devices/cpu` has been in Linux for over a decade.
147
+
eprintln!("WARNING: neither `/sys/devices/cpu` nor `/sys/devices/cpu_core` present, unable to determine if this CPU has a Performance-Hybrid architecture.");
148
+
None
149
+
}
150
+
});
151
+
(*PERFORMANCE_CORES).as_ref()
152
+
}
153
+
#[cfg(target_os = "windows")]
154
+
// Windows stub - TODO: implement to add Performance core support to Windows.
155
+
fnperformance_cores() -> Option<&'staticString>{
156
+
None
157
+
}
158
+
#[cfg(target_os = "macos")]
159
+
// To my knoweladge, MacOS does not run on hardware with P/E cores, so this can simply always return None.
0 commit comments