| 1038 | } norm_ctx_t; |
| 1039 | |
| 1040 | static void normalize_worker(int worker_id, void *ctx_ptr) { |
| 1041 | (void)worker_id; |
| 1042 | norm_ctx_t *nc = ctx_ptr; |
| 1043 | while (true) { |
| 1044 | int start = atomic_fetch_add_explicit(&nc->next_idx, CBM_SEM_WORKER_STACK_CAP, |
| 1045 | memory_order_relaxed); |
| 1046 | if (start >= nc->entry_count) { |
| 1047 | break; |
| 1048 | } |
| 1049 | int end = start + CBM_SEM_WORKER_STACK_CAP; |
| 1050 | if (end > nc->entry_count) { |
| 1051 | end = nc->entry_count; |
| 1052 | } |
| 1053 | for (int i = start; i < end; i++) { |
| 1054 | cbm_sem_normalize(&nc->entries[i].enriched_vec); |
| 1055 | } |
| 1056 | } |
| 1057 | } |
| 1058 | |
| 1059 | typedef struct { |
| 1060 | corpus_entry_t *entries; |
nothing calls this directly
no test coverage detected