When building with clang-cl (MSVC + Clang), the CMake MSVC branch defined __AVXVNNI__ as a preprocessor macro alongside /arch:AVX2, but clang-cl requires the actual -mavxvnni target feature flag to enable AVX-VNNI codegen. Without it, clang-cl refused to inline _mm256_dpbusd_avx_epi32 and _mm256_dpwssd_avx_epi32 into functions compiled under /arch:AVX2, causing 'requires target feature avxvnni' errors in: - ggml-quants.c (mul_sum_us8_pairs_float) - iqk_gemm_iquants.cpp (mul_mat_iq3_xxs_r4_q8_k) - iqk_gemm_kquants.cpp (mul_mat_q3_k_r4_q8_k) - iqk_gemm_legacy_quants.cpp (dot, accum_q4_0_quants, operator()) Fix: Detect clang-cl via CMAKE_CXX_COMPILER_ID STREQUAL 'Clang' and append -mavxvnni to ARCH_FLAGS instead of manual __AVXVNNI__ define. Also add missing GGML_AVXVNNI handling for the non-MSVC (GCC/Clang on Linux) branch, passing -mavxvnni as expected. |
||
|---|---|---|
| .. | ||
| cmake | ||
| include | ||
| src | ||
| .gitignore | ||
| CMakeLists.txt | ||