MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / cpu_count_math_cpus

Function cpu_count_math_cpus

subprojects/llama.cpp/common/common.cpp:170–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170static 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

Callers 1

cpu_get_num_mathFunction · 0.85

Calls 2

pin_cpuFunction · 0.85

Tested by

no test coverage detected