diff options
author | Kenneth Heafield <github@kheafield.com> | 2020-11-18 21:16:07 +0300 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2020-11-18 21:16:07 +0300 |
commit | b7a513372bf9d81bad5b00568aa1daec13054d34 (patch) | |
tree | 11066c030b06dbc0a59eabf0dd9feacd88085410 | |
parent | d19e9135de4b8aa98ae50a129ceae25fff0cf45e (diff) |
Guard cpuid.h for emscripten
-rw-r--r-- | intgemm/intgemm.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/intgemm/intgemm.h b/intgemm/intgemm.h index e89f9ff..a354b60 100644 --- a/intgemm/intgemm.h +++ b/intgemm/intgemm.h @@ -49,11 +49,14 @@ #include "avx512_gemm.h" #include "avx512vnni_gemm.h" -#if defined(__INTEL_COMPILER) +#if defined(__EMSCRIPTEN__) +// No header for CPUID since it's hard-coded. +#elif defined(__INTEL_COMPILER) #include <immintrin.h> #elif defined(_MSC_VER) #include <intrin.h> -#elif defined(__GNUC__) || defined(__clang__) +#else +// Assume GCC and clang style. #include <cpuid.h> #endif @@ -177,7 +180,7 @@ template <class T> T ChooseCPU(T #endif ) { #if defined(__EMSCRIPTEN__) - // emscripten is always ssse3. + // emscripten does SSE4.1 but we only use up to SSSE3. return ssse3; #elif defined(__INTEL_COMPILER) # ifdef INTGEMM_COMPILER_SUPPORTS_AVX512VNNI |