Go to the source code of this file.
◆ ck_packed_q8_dot_ordered()
| float ck_packed_q8_dot_ordered |
( |
const float * | input, |
|
|
const unsigned char * | weight, |
|
|
size_t | width ) |
|
inlinestatic |
Definition at line 6 of file packed_q8_dot_ordered.h.
8{
9 double sum = 0.0;
10 for (
size_t i = 0; i < width; i +=
QK8_0, weight +=
sizeof(
block_q8_0)) {
12 for (
size_t j = 0; j <
QK8_0; ++j) {
13 const int code = weight[j + 2];
14 const float value = scale * (float)(code < 128 ? code : code - 256);
15 sum += (double)input[i + j] * (double)value;
16 }
17 }
18 return (float)sum;
19}
static float ck_fp16_to_fp32_soft(ck_half h)
Convert FP16 (ck_half) to FP32 — software implementation.
References ck_fp16_to_fp32_soft(), and QK8_0.
Referenced by expert_dot(), and linear_rows_q8_0_checked().