| 1064 | } blend_ctx_t; |
| 1065 | |
| 1066 | static void blend_worker(int worker_id, void *ctx_ptr) { |
| 1067 | (void)worker_id; |
| 1068 | blend_ctx_t *bc = ctx_ptr; |
| 1069 | while (true) { |
| 1070 | int start = atomic_fetch_add_explicit(&bc->next_idx, CBM_SEM_WORKER_STACK_CAP, |
| 1071 | memory_order_relaxed); |
| 1072 | if (start >= bc->entry_count) { |
| 1073 | break; |
| 1074 | } |
| 1075 | int end = start + CBM_SEM_WORKER_STACK_CAP; |
| 1076 | if (end > bc->entry_count) { |
| 1077 | end = bc->entry_count; |
| 1078 | } |
| 1079 | for (int i = start; i < end; i++) { |
| 1080 | cbm_sem_normalize(&bc->entries[i].enriched_vec); |
| 1081 | for (int d = 0; d < CBM_SEM_DIM; d++) { |
| 1082 | bc->entries[i].enriched_vec.v[d] = |
| 1083 | (CBM_SEM_RRI_BETA * bc->pass1[i].v[d]) + |
| 1084 | (CBM_SEM_RRI_ALPHA * bc->entries[i].enriched_vec.v[d]); |
| 1085 | } |
| 1086 | } |
| 1087 | } |
| 1088 | } |
| 1089 | |
| 1090 | typedef struct { |
| 1091 | corpus_entry_t *entries; |
nothing calls this directly
no test coverage detected