Commit 9ca72b3e authored by Chris Mayo's avatar Chris Mayo Committed by Davis E. King

Reliably detect AVX2 at runtime on Linux (#1614)

ECX must be set to 0 to read this flag, the easiest way to achieve this
is to use __cpuid_count with 0 as the second argument.
parent 6b5b461d
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
{ {
std::array<unsigned int,4> info; std::array<unsigned int,4> info;
// Load EAX, EBX, ECX, EDX into info // Load EAX, EBX, ECX, EDX into info
__cpuid(function_id, info[0], info[1], info[2], info[3]); __cpuid_count(function_id, 0, info[0], info[1], info[2], info[3]);
return info; return info;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment