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:
Stefan Weil 2016-11-25 17:31:41 +01:00
parent 786b482ef8
commit ba6961e0f4

View File

@ -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;
} }