Skip to content

Commit

Permalink
opencl: Fix OpenCL kernel code assertion for newer versions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
stweil committed Nov 25, 2016
1 parent 786b482 commit ba6961e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opencl/oclkernels.h
Expand Up @@ -1201,7 +1201,7 @@ KERNEL(
unsigned int word = srcData[pixelIdx];
int output = (rwt * ((word >> RED_SHIFT) & 0xff) +
gwt * ((word >> GREEN_SHIFT) & 0xff) +
bwt * ((word >> BLUE_SHIFT) & 0xff) + 0.5);
bwt * ((word >> BLUE_SHIFT) & 0xff) + 0.5f);
// SET_DATA_BYTE
dstData[pixelIdx] = output;
}
Expand Down

0 comments on commit ba6961e

Please sign in to comment.