Opened 3 years ago

Closed 3 years ago

#5400 closed defect (fixed)

OpenCL georeferencer error

Reported by: vince Owned by: warmerdam
Priority: normal Milestone:
Component: Algorithms Version: 1.10.1
Severity: normal Keywords: OpenCL georeferencer clang
Cc: sprice

Description

When I try to use (via QGis) the Gdal Georeferencer, I get a bunch of errors from the OpenCL compiler (and thus the operation fails):

ERROR 1: Error: Failed to build program executable!
Build Log:
<program source>:11:6: error: no previous prototype for function 'clampToDst'
void clampToDst(float fReal,
     ^
<program source>:34:6: error: no previous prototype for function 'setPixel'
void setPixel(__global outType *dstReal,
     ^
<program source>:102:5: error: no previous prototype for function 'getPixel'
int getPixel(__read_only image2d_t srcReal,
    ^
<program source>:114:25: error: use of logical '||' with constant operand
if(useUnifiedSrcDensity || useUnifiedSrcValid || useUseBandSrcValid){
                        ^  ~~~~~~~~~~~~~~~~~~
<program source>:114:25: note: use '|' for a bitwise operation
if(useUnifiedSrcDensity || useUnifiedSrcValid || useUseBandSrcValid){
                        ^~
                        |
<program source>:114:47: error: use of logical '||' with constant operand
if(useUnifiedSrcDensity || useUnifiedSrcValid || useUseBandSrcValid){
                                              ^  ~~~~~~~~~~~~~~~~~~
<program source>:114:47: note: use '|' for a bitwise operation
if(useUnifiedSrcDensity || useUnifiedSrcValid || useUseBandSrcValid){
                                              ^~
                                              |
<program source>:177:5: error: no previous prototype for function 'isValid'
int isValid(__global float *fUnifiedSrcDensity,
    ^
<program source>:195:8: error: no previous prototype for function 'getSrcCoords'
float2 getSrcCoords(__read_only image2d_t srcCoords)
       ^
<program source>:212:7: error: no previous prototype for function 'lanczosSinc'
float lanczosSinc( float fX, float fR )
      ^
<program source>:221:7: error: no previous prototype for function 'bSpline'
float bSpline( float x )
      ^

ERROR 1: Error at file gdalwarpkernel_opencl.c line 2299: CL_BUILD_PROGRAM_FAILURE
ERROR 1: OpenCL routines reported failure (-11) on line 3242.

This seems to be related to a stiff underlying compiler (Clang), but can it be fixed easily? Thanks

Attachments (1)

gdalwarpkernel_opencl.diff (2.6 KB) - added by sprice 3 years ago.
This fixes the bug (for me).

Download all attachments as: .zip

Change History (5)

comment:1 Changed 3 years ago by warmerdam

Cc: sprice added
Component: defaultAlgorithms

Seth, any thoughts?

comment:2 Changed 3 years ago by vince

Sorry, I forgot to say I run GDAL over an Intel HD5000 OpenCL 1.2 driver on MacOS 10.9, if that is relevant.

Changed 3 years ago by sprice

Attachment: gdalwarpkernel_opencl.diff added

This fixes the bug (for me).

comment:3 Changed 3 years ago by warmerdam

Status: newassigned

Patch applied in trunk (r26983).

If this looks fine, it could likely be backported.

comment:4 Changed 3 years ago by vince

Resolution: fixed
Status: assignedclosed

I confirm it works now. I'll commit the patch into Macports, but if you can back port it, it would be still nicer. Thanks anyhow for being so responsive.

Note: See TracTickets for help on using tickets.