Skip to content

Commit d1315a3

Browse files
committed
Fix wasm build after breaking it in ggml-org#356
1 parent f2d1c47 commit d1315a3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ggml.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ static void quantize_row_q4_0(const float * restrict x, void * restrict vy, int
788788
MAX(wasm_f32x4_extract_lane(amaxv[0], 2), wasm_f32x4_extract_lane(amaxv[0], 3)));
789789

790790
const float d = amax / ((1 << 3) - 1);
791-
const float id = d ? 1.0/d : 0.0;
791+
const float id = d ? 1.0f/d : 0.0f;
792792

793793
y[i].d = d;
794794

@@ -2087,18 +2087,18 @@ static void ggml_vec_dot_q4_0(const int n, float * restrict s, const void * rest
20872087
float sum1 = 0.0f;
20882088

20892089
for (int i = 0; i < nb; i += 2) {
2090-
const block_q4_0 * restrict x0 = &px[i + 0];
2091-
const block_q4_0 * restrict y0 = &py[i + 0];
2092-
const block_q4_0 * restrict x1 = &px[i + 1];
2093-
const block_q4_0 * restrict y1 = &py[i + 1];
2090+
const block_q4_0 * restrict x0 = &x[i + 0];
2091+
const block_q4_0 * restrict y0 = &y[i + 0];
2092+
const block_q4_0 * restrict x1 = &x[i + 1];
2093+
const block_q4_0 * restrict y1 = &y[i + 1];
20942094

20952095
const v128_t m4b = wasm_u8x16_splat(0xf);
20962096
const v128_t s8b = wasm_i8x16_splat(0x8);
20972097

2098-
const v128_t v0_0 = wasm_v128_load(x0.qs);
2099-
const v128_t v0_1 = wasm_v128_load(y0.qs);
2100-
const v128_t v1_0 = wasm_v128_load(x1.qs);
2101-
const v128_t v1_1 = wasm_v128_load(y1.qs);
2098+
const v128_t v0_0 = wasm_v128_load(x0->qs);
2099+
const v128_t v0_1 = wasm_v128_load(y0->qs);
2100+
const v128_t v1_0 = wasm_v128_load(x1->qs);
2101+
const v128_t v1_1 = wasm_v128_load(y1->qs);
21022102

21032103
// 4-bit -> 8-bit
21042104
const v128_t v0_0l = wasm_v128_and(v0_0, m4b);

0 commit comments

Comments
 (0)