@@ -76,6 +76,7 @@ struct cpuid_x86 {
7676 bool AVX512_VNNI (void ) { return f_7_ecx[11 ]; }
7777 bool AVX512_FP16 (void ) { return f_7_edx[23 ]; }
7878 bool AVX512_BF16 (void ) { return f_7_1_eax[5 ]; }
79+ bool AVX_VNNI (void ) { return f_7_1_eax[4 ]; }
7980
8081 bool AMX_TILE (void ) { return f_7_edx[24 ]; }
8182 bool AMX_INT8 (void ) { return f_7_edx[25 ]; }
@@ -265,6 +266,7 @@ static int ggml_backend_cpu_x86_score() {
265266 if (ggml_cpu_has_ssse3 () && !is.SSSE3 ()) { return 0 ; }
266267 if (ggml_cpu_has_sse3 () && !is.SSE3 ()) { return 0 ; }
267268 if (ggml_cpu_has_avx () && !is.AVX ()) { return 0 ; }
269+ if (ggml_cpu_has_avx_vnni () && !is.AVX_VNNI ()) { return 0 ; }
268270 if (ggml_cpu_has_avx2 () && !is.AVX2 ()) { return 0 ; }
269271 if (ggml_cpu_has_avx512 () && !is.AVX512F ()) { return 0 ; }
270272 if (ggml_cpu_has_avx512_vbmi () && !is.AVX512_VBMI ()) { return 0 ; }
@@ -279,8 +281,8 @@ static int ggml_backend_cpu_x86_score() {
279281 score += ggml_cpu_has_f16c () * 1 <<1 ;
280282 score += ggml_cpu_has_ssse3 () * 1 <<2 ;
281283 score += ggml_cpu_has_sse3 () * 1 <<3 ;
282- // score += ggml_cpu_has_avx_vnni () * 1<<4; // not used
283284 score += ggml_cpu_has_avx () * 1 <<5 ;
285+ score += ggml_cpu_has_avx_vnni () * 1 <<4 ;
284286 score += ggml_cpu_has_avx2 () * 1 <<6 ;
285287 score += ggml_cpu_has_avx512 () * 1 <<7 ;
286288 // score += ggml_cpu_has_avx512_vbmi() * 1<<8; // not used
0 commit comments