| 168 | } |
| 169 | |
| 170 | static int cpu_count_math_cpus(int n_cpu) { |
| 171 | int result = 0; |
| 172 | for (int cpu = 0; cpu < n_cpu; ++cpu) { |
| 173 | if (pin_cpu(cpu)) { |
| 174 | return -1; |
| 175 | } |
| 176 | if (is_running_on_efficiency_core()) { |
| 177 | continue; // efficiency cores harm lockstep threading |
| 178 | } |
| 179 | ++cpu; // hyperthreading isn't useful for linear algebra |
| 180 | ++result; |
| 181 | } |
| 182 | return result; |
| 183 | } |
| 184 | |
| 185 | #endif // __x86_64__ && __linux__ |
| 186 |
no test coverage detected