ggml : fix avx512bf16 build (#18623)

- include `immintrin.h` when required
- remove unused m512bh

Signed-off-by: Adrien Gallouët <angt@huggingface.co>
This commit is contained in:
Adrien Gallouët 2026-01-06 07:54:10 +01:00 committed by GitHub
parent da9b8d3300
commit e75ee11024
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -53,13 +53,15 @@
#define UNUSED GGML_UNUSED
// Needed for ggml_fp32_to_bf16_row()
#if defined(__AVX512BF16__)
#if defined(_MSC_VER)
#define m512bh(p) p
#define m512i(p) p
#else
#define m512bh(p) (__m512bh)(p)
#include <immintrin.h>
#define m512i(p) (__m512i)(p)
#endif
#endif // defined(_MSC_VER)
#endif // defined(__AVX512BF16__)
#if defined(__linux__) || \
defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \