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