The code in ccutil/hashfn.h was needed for some old compilers. Now that we support MSVC >= 2010 and compilers that has good support for C++11, we can drop this code.
As a result of this file removal, we now use:
std::unordered_map
std::unordered_set
std::unique_ptr
directly in the codebase with '#include' for the needed headers.
This information is not needed for normal runs, so it is sufficient
to show it on request (like versions and OpenCL information).
This also fixes a crash caused by undefined order of global constructors:
When the global variable SIMDDetect::detector is initialized before the
global variable debug_file, the first tprintf call in simddetect.cpp
crashes because of a NULL pointer in debug_file. This was only seen when
running with a shared library (libtesseract.so).
Signed-off-by: Stefan Weil <sw@weilnetz.de>
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>