Skip to content

Commit c91e5d5

Browse files
committed
Surround SVE function with compiler directive
1 parent 5485ad7 commit c91e5d5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ggml/src/ggml-cpu/arch/arm/quants.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,6 +2044,7 @@ void ggml_vec_dot_q3_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
20442044

20452045
}
20462046

2047+
#ifdef __ARM_FEATURE_SVE
20472048
static inline svuint32_t ggml_decode_q4scales_and_mins_for_mmla(const uint32_t *vx_scales) {
20482049
const svbool_t pg_all = svptrue_pat_b32(SV_VL4);
20492050
const svbool_t pg_false = svpfalse_b(); // 0x0000
@@ -2061,6 +2062,7 @@ static inline svuint32_t ggml_decode_q4scales_and_mins_for_mmla(const uint32_t *
20612062
svuint32_t vutmp = svorr_u32_z(pg_all, vutmp_hi, vutmp_lo);
20622063
return vutmp;
20632064
}
2065+
#endif
20642066

20652067
void ggml_vec_dot_q4_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const void * GGML_RESTRICT vx, size_t bx, const void * GGML_RESTRICT vy, size_t by, int nrc) {
20662068
assert(n % QK_K == 0);
@@ -2084,12 +2086,12 @@ void ggml_vec_dot_q4_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
20842086
static const uint32_t kmask3 = 0x03030303;
20852087

20862088
uint32_t utmp[4];
2087-
#if __ARM_FEATURE_SVE
2089+
#ifdef __ARM_FEATURE_SVE
20882090
const int vector_length = ggml_cpu_get_sve_cnt()*8;
20892091
#endif
20902092

20912093
#if defined(__ARM_FEATURE_MATMUL_INT8)
2092-
#if __ARM_FEATURE_SVE
2094+
#ifdef __ARM_FEATURE_SVE
20932095
if (nrc==2) {
20942096
svbool_t pg32_2 = svptrue_pat_b32(SV_VL2);
20952097
const block_q4_K * GGML_RESTRICT vx0 = vx;

0 commit comments

Comments
 (0)