From 823c3f4b288be5bb5bc9b6f3bf41e809e66b6279 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Mon, 16 Apr 2018 13:01:35 +0000
Subject: [PATCH] Fixed AVX detection on Linux.
---
src/gemm.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gemm.c b/src/gemm.c
index 0efefd0..317fd65 100644
--- a/src/gemm.c
+++ b/src/gemm.c
@@ -92,6 +92,7 @@
#include <ammintrin.h>
#include <immintrin.h>
#include <smmintrin.h>
+#include <cpuid.h>
void asm_cpuid(uint32_t* abcd, uint32_t eax)
{
@@ -109,6 +110,7 @@
abcd[2] = ecx;
abcd[3] = edx;
}
+
#endif
int simd_detect_x86(unsigned int idFeature)
@@ -118,8 +120,8 @@
__cpuid(regs, 0);
if (regs[0] > 1U) __cpuid(regs, 1);
#else
- asm_cpuid(regs, 0);
- if (regs[0] > 1U) asm_cpuid(regs, 0);
+ __get_cpuid(0, ®s[0], ®s[1], ®s[2], ®s[3]);
+ if(regs[0] > 1U) __get_cpuid(1, ®s[0], ®s[1], ®s[2], ®s[3]);
#endif
if ((regs[2] & idFeature) != idFeature)
--
Gitblit v1.10.0