MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / postprocess_cpu_params

Function postprocess_cpu_params

common/common.cpp:266–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264
265
266void postprocess_cpu_params(cpu_params& cpuparams, const cpu_params* role_model) {
267 int32_t n_set = 0;
268
269 if (cpuparams.n_threads < 0) {
270 // Assuming everything about cpuparams is invalid
271 if (role_model != nullptr) {
272 cpuparams = *role_model;
273 } else {
274 cpuparams.n_threads = cpu_get_num_math();
275 }
276 }
277
278 for (int32_t i = 0; i < GGML_MAX_N_THREADS; i++) {
279 if (cpuparams.cpumask[i]) {
280 n_set++;
281 }
282 }
283
284 if (n_set && n_set < cpuparams.n_threads) {
285 // Not enough set bits, may experience performance issues.
286 LOG_WRN("Not enough set bits in CPU mask (%d) to satisfy requested thread count: %d\n", n_set, cpuparams.n_threads);
287 }
288}
289
290bool parse_cpu_range(const std::string & range, bool (&boolmask)[GGML_MAX_N_THREADS]) {
291 size_t dash_loc = range.find('-');

Callers 1

common_params_parse_exFunction · 0.85

Calls 1

cpu_get_num_mathFunction · 0.85

Tested by

no test coverage detected