MCPcopy Create free account
hub / github.com/antirez/ds4 / model_map_span_vec_include_one

Function model_map_span_vec_include_one

ds4.c:4156–4187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4154 isum += (int64_t)sc_val * q * (int)q8[j + 32 + l];
4155 }
4156
4157 ql += 32;
4158 is += 2;
4159 u1 = (uint8_t)(u1 << 2);
4160 u2 = (uint8_t)(u2 << 2);
4161 }
4162
4163 sumf += d * (float)isum - dmin * (float)summs;
4164 }
4165
4166 *s = sumf;
4167}
4168
4169static void ds4_vec_dot_q6_K_q8_K(int n, float *s, const block_q6_K *x, const block_q8_K *y) {
4170 const int nb = n / QK_K;
4171 float sumf = 0.0f;
4172
4173 for (int i = 0; i < nb; i++) {
4174 const float d = y[i].d * f16_to_f32(x[i].d);
4175 const uint8_t *ql = x[i].ql;
4176 const uint8_t *qh = x[i].qh;
4177 const int8_t *scales = x[i].scales;
4178 const int8_t *q8 = y[i].qs;
4179 int64_t isum = 0;
4180
4181 for (int n128 = 0; n128 < QK_K; n128 += 128) {
4182 for (int l = 0; l < 32; l++) {
4183 const int is = l / 16;
4184 const int q1 = ((int)(ql[l + 0] & 0x0F) | (((qh[l] >> 0) & 3) << 4)) - 32;
4185 const int q2 = ((int)(ql[l + 32] & 0x0F) | (((qh[l] >> 2) & 3) << 4)) - 32;
4186 const int q3 = ((int)(ql[l + 0] >> 4) | (((qh[l] >> 4) & 3) << 4)) - 32;
4187 const int q4 = ((int)(ql[l + 32] >> 4) | (((qh[l] >> 6) & 3) << 4)) - 32;
4188
4189 isum += (int64_t)scales[is + 0] * q1 * (int)q8[n128 + l + 0];
4190 isum += (int64_t)scales[is + 2] * q2 * (int)q8[n128 + l + 32];

Calls 3

Tested by

no test coverage detected