Skip to content

Commit 459bf58

Browse files
ikawrakowIwan Kawrakow
andauthored
Add missing AVX512 operators for MSVC (#948)
Co-authored-by: Iwan Kawrakow <[email protected]>
1 parent 41bde27 commit 459bf58

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ggml/src/iqk/iqk_gemm_legacy_quants.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#include "iqk_gemm_legacy_quants.h"
2+
23
#include <type_traits>
34

45
#ifdef IQK_IMPLEMENT
56

67
#include "ggml-impl.h"
8+
#include "iqk_utils.h"
79

810
#define GGML_COMMON_IMPL_C
911
#include "ggml-common.h"

ggml/src/iqk/iqk_utils.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ static inline float32x4_t v_gelu(float32x4_t x, float32x4_t c1, float32x4_t c2)
8080

8181
#endif // __ARN_NEON
8282

83+
#if defined(__AVX512F__) && defined(_MSC_VER)
84+
#include <immintrin.h>
85+
86+
static inline __m512i operator|(__m512i a, __m512i b) { return _mm512_or_si512(a, b); }
87+
static inline __m512i operator&(__m512i a, __m512i b) { return _mm512_and_si512(a, b); }
88+
static inline __m512i operator^(__m512i a, __m512i b) { return _mm512_xor_si512(a, b); }
89+
#endif
90+
8391
#if defined(__AVX512F__) && defined(__AVX512DQ__)
8492

8593
// copy-pasted from Justine Tunney's contribution to llama.cpp

0 commit comments

Comments
 (0)