Modify also the code to use a singleton. This simplifies the code as
no locking is needed. It also slightly improves the performance because
no check whether the architecture was tested is needed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Fix compiler warning (see below)
* Use Linux code for Mingw-w64, too
* Simplify conditional code by using X86_BUILD instead of NONX86_BUILD
* Remove unneeded call of __get_cpuid_max (already called by __get_cpuid)
* Remove unneeded #undef statement
gcc report:
lstm/weightmatrix.cpp: In static member function
'static double tesseract::WeightMatrix::DotProduct(const double*, const double*, int)':
weightmatrix.cpp:67:29: warning:
'ecx' may be used uninitialized in this function [-Wmaybe-uninitialized]
avx_available_ = (ecx & 0x10000000) != 0;
^
lstm/weightmatrix.cpp:64:30: note: 'ecx' was declared here
unsigned int eax, ebx, ecx, edx;
^
Signed-off-by: Stefan Weil <sw@weilnetz.de>
cpuid.h is only available for x86 builds. There are lots of non x86
architectures, so simply checking for PowerPC is not enough.
Signed-off-by: Stefan Weil <sw@weilnetz.de>