| 1027 | } norm_ctx_t; |
| 1028 | |
| 1029 | static void normalize_worker(int worker_id, void *ctx_ptr) { |
| 1030 | (void)worker_id; |
| 1031 | norm_ctx_t *nc = ctx_ptr; |
| 1032 | while (true) { |
| 1033 | int start = atomic_fetch_add_explicit(&nc->next_idx, CBM_SEM_WORKER_STACK_CAP, |
| 1034 | memory_order_relaxed); |
| 1035 | if (start >= nc->entry_count) { |
| 1036 | break; |
| 1037 | } |
| 1038 | int end = start + CBM_SEM_WORKER_STACK_CAP; |
| 1039 | if (end > nc->entry_count) { |
| 1040 | end = nc->entry_count; |
| 1041 | } |
| 1042 | for (int i = start; i < end; i++) { |
| 1043 | cbm_sem_normalize(&nc->entries[i].enriched_vec); |
| 1044 | } |
| 1045 | } |
| 1046 | } |
| 1047 | |
| 1048 | typedef struct { |
| 1049 | corpus_entry_t *entries; |
nothing calls this directly
no test coverage detected