| 1604 | expert_job job = { |
| 1605 | .db = db, .gguf_name = gguf_name, .tmpl = tmpl, .target = target, |
| 1606 | .n_experts = n_experts, .imatrix = imatrix, .expert = e, .wid = wid, |
| 1607 | .ncols = ncols, .nrows = nrows, .per_expert = per_expert, .out = &out, |
| 1608 | }; |
| 1609 | pthread_mutex_init(&job.lock, NULL); |
| 1610 | pthread_t *threads = xcalloc((size_t)worker_count, sizeof(threads[0])); |
| 1611 | for (int i = 1; i < worker_count; i++) pthread_create(&threads[i], NULL, expert_worker, &job); |
| 1612 | expert_worker(&job); |
| 1613 | for (int i = 1; i < worker_count; i++) pthread_join(threads[i], NULL); |
| 1614 | pthread_mutex_destroy(&job.lock); |
| 1615 | free(threads); |
| 1616 | return out; |
no test coverage detected