mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 14:41:36 +08:00
opencl: Fix OpenCL kernel code assertion for newer versions
With Debian package beignet-opencl-icd 1.2.1-1, Tesseract + OpenCL fails: [DS] Profile file not available (tesseract_opencl_profile_devices.dat); performing profiling. [DS] Device: "Intel(R) HD Graphics IvyBridge M GT2" (OpenCL) evaluation... ASSERTION FAILED: sel.hasDoubleType() at file /home/geier/beignet/backend/src/backend/gen_insn_selection.cpp, function void gbe::ConvertInstructionPattern::convertDoubleToSmallInts(gbe::Selection::Opaque&, const gbe::ir::ConvertInstruction&, bool&) const, line 5269 Trace/breakpoint trap Using a pure float expression (instead of double) fixes this issue. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
786b482ef8
commit
ba6961e0f4
@ -1201,7 +1201,7 @@ KERNEL(
|
|||||||
unsigned int word = srcData[pixelIdx];
|
unsigned int word = srcData[pixelIdx];
|
||||||
int output = (rwt * ((word >> RED_SHIFT) & 0xff) +
|
int output = (rwt * ((word >> RED_SHIFT) & 0xff) +
|
||||||
gwt * ((word >> GREEN_SHIFT) & 0xff) +
|
gwt * ((word >> GREEN_SHIFT) & 0xff) +
|
||||||
bwt * ((word >> BLUE_SHIFT) & 0xff) + 0.5);
|
bwt * ((word >> BLUE_SHIFT) & 0xff) + 0.5f);
|
||||||
// SET_DATA_BYTE
|
// SET_DATA_BYTE
|
||||||
dstData[pixelIdx] = output;
|
dstData[pixelIdx] = output;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user