From d12a2a6dd25aadbb5038804da5123138c1b77ec0 Mon Sep 17 00:00:00 2001 From: Robert Blackwell Date: Wed, 8 Nov 2023 10:19:04 -0500 Subject: [PATCH] dispatch: only include cpuid header when on x86_64 --- src/hog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hog.cpp b/src/hog.cpp index 94726e1..e7eca47 100644 --- a/src/hog.cpp +++ b/src/hog.cpp @@ -5,9 +5,9 @@ #include #include -#include #ifdef __x86_64__ +#include #include #include #endif @@ -24,6 +24,7 @@ enum instruction_t : int { Scalar = 0, SSE4 = 1, AVX2 = 2, AVX512 = 3 }; instruction_t get_current_capability() noexcept { instruction_t ilvl = Scalar; +#ifdef __x86_64__ unsigned eax, ebx, ecx, edx, flag = 0; int cpuidret = __get_cpuid(1, &eax, &ebx, &ecx, &edx); @@ -43,7 +44,7 @@ instruction_t get_current_capability() noexcept { if (ebx & bit_AVX2) return AVX2; - +#endif return ilvl; }