| 153 | } |
| 154 | |
| 155 | static int cpu_count_math_cpus(int n_cpu) { |
| 156 | int result = 0; |
| 157 | for (int cpu = 0; cpu < n_cpu; ++cpu) { |
| 158 | if (pin_cpu(cpu)) { |
| 159 | return -1; |
| 160 | } |
| 161 | if (is_running_on_efficiency_core()) { |
| 162 | continue; // efficiency cores harm lockstep threading |
| 163 | } |
| 164 | ++cpu; // hyperthreading isn't useful for linear algebra |
| 165 | ++result; |
| 166 | } |
| 167 | return result; |
| 168 | } |
| 169 | |
| 170 | #endif // __x86_64__ && __linux__ |
| 171 |
no test coverage detected