Skip to content

Commit fd5de67

Browse files
committed
ggml : fix loongson compile warnings
ggml-ci
1 parent d5c0582 commit fd5de67

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
@@ -7404,6 +7404,9 @@ void ggml_vec_dot_q4_K_q8_K(int n, float * restrict s, size_t bs, const void * r
74047404
*s = vec_extract(vsumf0, 0);
74057405

74067406
#elif defined __loongarch_asx
7407+
GGML_UNUSED(kmask1);
7408+
GGML_UNUSED(kmask2);
7409+
GGML_UNUSED(kmask3);
74077410

74087411
const __m256i m4 = __lasx_xvreplgr2vr_b(0xF);
74097412

@@ -8002,6 +8005,9 @@ void ggml_vec_dot_q5_K_q8_K(int n, float * restrict s, size_t bs, const void * r
80028005
*s = vec_extract(vsumf0, 0);
80038006

80048007
#elif defined __loongarch_asx
8008+
GGML_UNUSED(kmask1);
8009+
GGML_UNUSED(kmask2);
8010+
GGML_UNUSED(kmask3);
80058011

80068012
const __m256i m4 = __lasx_xvreplgr2vr_b(0xF);
80078013
const __m128i mzero = __lsx_vldi(0);

ggml.c

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

15771577
// F16 arithmetic is not supported by AVX, so we use F32 instead
15781578

1579-
#define GGML_F32Cx8 __m256
1579+
#define GGML_F32Cx8 __m256
15801580
#define GGML_F32Cx8_ZERO (__m256)__lasx_xvldi(0)
15811581
#define GGML_F32Cx8_SET1(x) (__m256)__lasx_xvreplgr2vr_w((x))
15821582

1583-
static inline __m256 __lasx_f32cx8_load(const ggml_fp16_t *x) {
1583+
static inline __m256 __lasx_f32cx8_load(const ggml_fp16_t * x) {
15841584
float tmp[8];
15851585

15861586
for (int i = 0; i < 8; i++) {
@@ -1589,13 +1589,14 @@ static inline __m256 __lasx_f32cx8_load(const ggml_fp16_t *x) {
15891589

15901590
return (__m256)__lasx_xvld(tmp, 0);
15911591
}
1592-
static inline void __lasx_f32cx8_store(ggml_fp16_t *x, __m256 y) {
1592+
static inline void __lasx_f32cx8_store(ggml_fp16_t * x, __m256 y) {
15931593
float arr[8];
15941594

15951595
__lasx_xvst(y, arr, 0);
15961596

1597-
for (int i = 0; i < 8; i++)
1597+
for (int i = 0; i < 8; i++) {
15981598
x[i] = GGML_FP32_TO_FP16(arr[i]);
1599+
}
15991600
}
16001601
#define GGML_F32Cx8_LOAD(x) __lasx_f32cx8_load(x)
16011602
#define GGML_F32Cx8_STORE(x, y) __lasx_f32cx8_store(x, y)
@@ -1671,7 +1672,7 @@ static inline void __lasx_f32cx8_store(ggml_fp16_t *x, __m256 y) {
16711672
#define GGML_F16_STEP 32
16721673
#define GGML_F16_EPR 4
16731674

1674-
static inline __m128 __lsx_f16x4_load(ggml_fp16_t *x) {
1675+
static inline __m128 __lsx_f16x4_load(const ggml_fp16_t * x) {
16751676
float tmp[4];
16761677

16771678
tmp[0] = GGML_FP16_TO_FP32(x[0]);
@@ -1682,7 +1683,7 @@ static inline __m128 __lsx_f16x4_load(ggml_fp16_t *x) {
16821683
return __lsx_vld(tmp, 0);
16831684
}
16841685

1685-
static inline void __lsx_f16x4_store(ggml_fp16_t *x, __m128 y) {
1686+
static inline void __lsx_f16x4_store(ggml_fp16_t * x, __m128 y) {
16861687
float arr[4];
16871688

16881689
__lsx_vst(y, arr, 0);

0 commit comments

Comments
 (0)