Cmake builds need the additional directories `arch` and `lstm`
to find all include files and also for linking.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc report:
ccstruct/blamer.cpp:343:65: warning:
'truth_x' may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc report:
lstm/lstmrecognizer.cpp:608:47: error: 'isnan' was not declared in this scope
ASSERT_HOST(!isnan(output.f(t)[null_char_]));
Signed-off-by: Stefan Weil <sw@weilnetz.de>
training/commontraining.cpp:824:3: warning:
'register' storage class specifier is deprecated and incompatible with C++1z [-Wdeprecated-register]
...
Signed-off-by: Stefan Weil <sw@weilnetz.de>
CL_PROGRAM_NUM_DEVICES expects a cl_uint.
Passing size_t results in a wrong value for numDevices on hosts where
sizeof(cl_uint) != sizeof(size_t).
Signed-off-by: Stefan Weil <sw@weilnetz.de>
CL_CONTEXT_NUM_DEVICES expects a cl_uint.
Passing size_t results in a wrong value for numDevices on hosts where
sizeof(cl_uint) != sizeof(size_t). This results in errors like these:
Tesseract Open Source OCR Engine v3.05.00dev with Leptonica
OpenCL error code is -44 at when clCreateKernel kernel_HistogramRectAllChannels .
OpenCL error code is -44 at when clCreateKernel kernel_HistogramRectAllChannelsReduction .
OpenCL error code is -48 at when clSetKernelArg imageBuffer .
...
Signed-off-by: Stefan Weil <sw@weilnetz.de>
The compare method is called very often, so even small improvements
are important.
The new code avoids one comparison in each loop iteration.
This results in smaller code (60 bytes for x86_64, gcc).
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Commit b1f03cb697 added a call of function
FreeFeatureSet to fix a memory leak, but introduced a new bug because the
local variable FloatFeatures was not always assigned a value.
Now FloatFeatures is always assigned a value, and we only need a single
place where FreeFeatureSet is called.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc report:
In file included from /usr/include/leptonica/alltypes.h:36:0,
from /usr/include/leptonica/allheaders.h:34,
from openclwrapper.h:2,
from openclwrapper.cpp:11:
openclwrapper.cpp: In static member function 'static PIX* OpenclDevice::pixReadMemTiffCl(const l_uint8*, size_t, l_int32)':
/usr/include/leptonica/environ.h:442:68: warning: format '%d' expects a matching 'int' argument [-Wformat=]
(void)fprintf(stderr, "Warning in %s: " a, __VA_ARGS__), \
^
/usr/include/leptonica/environ.h:427:61: note: in definition of macro 'IF_SEV'
((l) >= MINIMUM_SEVERITY && (l) >= LeptMsgSeverity ? (t) : (f))
^
opencl/openclwrapper.cpp:1162:3: note: in expansion of macro 'L_WARNING'
L_WARNING("tiff page %d not found", procName);
^
Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc report:
opencl_device_selection.h: In function 'ds_status getNumDeviceWithEmptyScore(ds_profile*, unsigned int*)':
opencl_device_selection.h:589:13: warning: value computed is not used [-Wunused-value]
*num++;
^
This is caused by a buggy implementation which increases the value of num
instead of *num.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
It is only used locally in opencl/openclwrapper.cpp.
For all other files which include openclwrapper.h, the compiler
complained about an unused static variable:
opencl/openclwrapper.h:175:16: warning:
‘MORPH_BC’ defined but not used [-Wunused-variable]
Signed-off-by: Stefan Weil <sw@weilnetz.de>