diff --git a/lstm/weightmatrix.cpp b/lstm/weightmatrix.cpp index 8c7aa4645d..84dd9b77ab 100644 --- a/lstm/weightmatrix.cpp +++ b/lstm/weightmatrix.cpp @@ -29,6 +29,7 @@ # if defined(__linux__) || defined(__MINGW32__) # include # elif defined(_WIN32) +# include # endif #endif #include "dotproductavx.h" @@ -71,6 +72,14 @@ class SIMDDetect { sse_available_ = (ecx & 0x00080000) != 0; avx_available_ = (ecx & 0x10000000) != 0; } +# elif defined(_WIN32) + int cpuInfo[4]; + __cpuid(cpuInfo, 0); + if (cpuInfo[0] >= 1) { + __cpuid(cpuInfo, 1); + sse_available_ = (cpuInfo[2] & 0x00080000) != 0; + avx_available_ = (cpuInfo[2] & 0x10000000) != 0; + } # endif if (avx_available_) tprintf("Found AVX\n"); if (sse_available_) tprintf("Found SSE\n");