Skip to content

Commit 80787c2

Browse files
committed
ggml : fix loongson compile warnings
ggml-ci
1 parent 9588f19 commit 80787c2

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

ggml-quants.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7399,6 +7399,9 @@ void ggml_vec_dot_q4_K_q8_K(int n, float * restrict s, size_t bs, const void * r
73997399
*s = vec_extract(vsumf0, 0);
74007400

74017401
#elif defined __loongarch_asx
7402+
GGML_UNUSED(kmask1);
7403+
GGML_UNUSED(kmask2);
7404+
GGML_UNUSED(kmask3);
74027405

74037406
const __m256i m4 = __lasx_xvreplgr2vr_b(0xF);
74047407

@@ -7997,6 +8000,9 @@ void ggml_vec_dot_q5_K_q8_K(int n, float * restrict s, size_t bs, const void * r
79978000
*s = vec_extract(vsumf0, 0);
79988001

79998002
#elif defined __loongarch_asx
8003+
GGML_UNUSED(kmask1);
8004+
GGML_UNUSED(kmask2);
8005+
GGML_UNUSED(kmask3);
80008006

80018007
const __m256i m4 = __lasx_xvreplgr2vr_b(0xF);
80028008
const __m128i mzero = __lsx_vldi(0);

ggml.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,11 +1567,11 @@ do { \
15671567

15681568
// F16 arithmetic is not supported by AVX, so we use F32 instead
15691569

1570-
#define GGML_F32Cx8 __m256
1570+
#define GGML_F32Cx8 __m256
15711571
#define GGML_F32Cx8_ZERO (__m256)__lasx_xvldi(0)
15721572
#define GGML_F32Cx8_SET1(x) (__m256)__lasx_xvreplgr2vr_w((x))
15731573

1574-
static inline __m256 __lasx_f32cx8_load(ggml_fp16_t *x) {
1574+
static inline __m256 __lasx_f32cx8_load(const ggml_fp16_t * x) {
15751575
float tmp[8];
15761576

15771577
for (int i = 0; i < 8; i++) {
@@ -1580,13 +1580,14 @@ static inline __m256 __lasx_f32cx8_load(ggml_fp16_t *x) {
15801580

15811581
return (__m256)__lasx_xvld(tmp, 0);
15821582
}
1583-
static inline void __lasx_f32cx8_store(ggml_fp16_t *x, __m256 y) {
1583+
static inline void __lasx_f32cx8_store(ggml_fp16_t * x, __m256 y) {
15841584
float arr[8];
15851585

15861586
__lasx_xvst(y, arr, 0);
15871587

1588-
for (int i = 0; i < 8; i++)
1588+
for (int i = 0; i < 8; i++) {
15891589
x[i] = GGML_FP32_TO_FP16(arr[i]);
1590+
}
15901591
}
15911592
#define GGML_F32Cx8_LOAD(x) __lasx_f32cx8_load(x)
15921593
#define GGML_F32Cx8_STORE(x, y) __lasx_f32cx8_store(x, y)
@@ -1662,7 +1663,7 @@ static inline void __lasx_f32cx8_store(ggml_fp16_t *x, __m256 y) {
16621663
#define GGML_F16_STEP 32
16631664
#define GGML_F16_EPR 4
16641665

1665-
static inline __m128 __lsx_f16x4_load(ggml_fp16_t *x) {
1666+
static inline __m128 __lsx_f16x4_load(const ggml_fp16_t * x) {
16661667
float tmp[4];
16671668

16681669
tmp[0] = GGML_FP16_TO_FP32(x[0]);
@@ -1673,7 +1674,7 @@ static inline __m128 __lsx_f16x4_load(ggml_fp16_t *x) {
16731674
return __lsx_vld(tmp, 0);
16741675
}
16751676

1676-
static inline void __lsx_f16x4_store(ggml_fp16_t *x, __m128 y) {
1677+
static inline void __lsx_f16x4_store(ggml_fp16_t * x, __m128 y) {
16771678
float arr[4];
16781679

16791680
__lsx_vst(y, arr, 0);

0 commit comments

Comments
 (0)