mirror of https://github.com/davisking/dlib.git
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.
This commit is contained in:
parent
6b5b461dd0
commit
9ca72b3e1c
|
@ -129,7 +129,7 @@
|
|||
{
|
||||
std::array<unsigned int,4> 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue