Skip to content

Commit f83470e

Browse files
taronaeoAleksei Nikiforov
andcommitted
ggml: refactor to type-cast and update documentation
Signed-off-by: Aaron Teo <[email protected]> Co-authored-by: Aleksei Nikiforov <[email protected]>
1 parent c2b19c8 commit f83470e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ggml/src/ggml-cpu/simd-mappings.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -851,17 +851,15 @@ static inline __vector float __lzs_f16cx4_load(const ggml_fp16_t * x) {
851851
tmp[i] = GGML_FP16_TO_FP32(x[i]);
852852
}
853853

854-
// TODO: change to const pointer instead (see #12846)
855-
// this is only a workaround to the compile error but its unreadable
856-
return vec_xl(0, &(tmp[0]));
854+
// note: keep type-cast here to prevent compiler bugs (see #12846)
855+
return vec_xl(0, (const float *)(tmp));
857856
}
858857

859858
static inline void __lzs_f16cx4_store(ggml_fp16_t * x, __vector float y) {
860859
float arr[4];
861860

862-
// TODO: change to const pointer instead (see #12846)
863-
// this is only a workaround to the compile error but its unreadable
864-
vec_xst(y, 0, &(arr[0]));
861+
// note: keep type-cast here to prevent compiler bugs (see #12846)
862+
vec_xst(y, 0, (float *)(arr));
865863

866864
for (int i = 0; i < 4; i++) {
867865
x[i] = GGML_FP32_TO_FP16(arr[i]);

0 commit comments

Comments
 (0)