MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / cpu_count_math_cpus

Function cpu_count_math_cpus

smallthinker/common/common.cpp:155–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155static 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

Callers 1

cpu_get_num_mathFunction · 0.85

Calls 2

pin_cpuFunction · 0.85

Tested by

no test coverage detected