Skip to content

Commit ba6961e

Browse files
committed
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 <[email protected]>
1 parent 786b482 commit ba6961e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opencl/oclkernels.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ KERNEL(
12011201
unsigned int word = srcData[pixelIdx];
12021202
int output = (rwt * ((word >> RED_SHIFT) & 0xff) +
12031203
gwt * ((word >> GREEN_SHIFT) & 0xff) +
1204-
bwt * ((word >> BLUE_SHIFT) & 0xff) + 0.5);
1204+
bwt * ((word >> BLUE_SHIFT) & 0xff) + 0.5f);
12051205
// SET_DATA_BYTE
12061206
dstData[pixelIdx] = output;
12071207
}

0 commit comments

Comments
 (0)