Ticket #42621: patch-gdalwarpkernel_opencl_c_2.diff

File patch-gdalwarpkernel_opencl_c_2.diff, 2.6 KB (added by Veence (Vincent), 11 years ago)

New patch to fix the OpenCL compilation errors (from upstream)

  • alg/gdalwarpkernel_opencl.

    old new  
    535535    const char *dVecf = "float";
    536536    const char *kernGenFuncs =
    537537// ********************* General Funcs ********************
     538"void clampToDst(float fReal,\n"
     539                "__global outType *dstPtr,\n"
     540                "unsigned int iDstOffset,\n"
     541                "__constant float *fDstNoDataReal,\n"
     542                "int bandNum);\n"
     543"void setPixel(__global outType *dstReal,\n"
     544                "__global outType *dstImag,\n"
     545                "__global float *dstDensity,\n"
     546                "__global int *nDstValid,\n"
     547                "__constant float *fDstNoDataReal,\n"
     548                "const int bandNum,\n"
     549                "vecf fDensity, vecf fReal, vecf fImag);\n"
     550"int getPixel(__read_only image2d_t srcReal,\n"
     551                "__read_only image2d_t srcImag,\n"
     552                "__global float *fUnifiedSrcDensity,\n"
     553                "__global int *nUnifiedSrcValid,\n"
     554                "__constant char *useBandSrcValid,\n"
     555                "__global int *nBandSrcValid,\n"
     556                "const int2 iSrc,\n"
     557                "int bandNum,\n"
     558                "vecf *fDensity, vecf *fReal, vecf *fImag);\n"
     559"int isValid(__global float *fUnifiedSrcDensity,\n"
     560                "__global int *nUnifiedSrcValid,\n"
     561                "float2 fSrcCoords );\n"
     562"float2 getSrcCoords(__read_only image2d_t srcCoords);\n"
     563
    538564"#ifdef USE_CLAMP_TO_DST_FLOAT\n"
    539565"void clampToDst(float fReal,\n"
    540566                "__global outType *dstPtr,\n"
     
    666692    "int bHasValid = FALSE;\n"
    667693   
    668694    // Clamp the src offset values if needed
    669     "if(useUnifiedSrcDensity || useUnifiedSrcValid || useUseBandSrcValid){\n"
     695    "if(useUnifiedSrcDensity | useUnifiedSrcValid | useUseBandSrcValid){\n"
    670696        "int iSrcX = iSrc.x;\n"
    671697        "int iSrcY = iSrc.y;\n"
    672698       
     
    903929    const char *kernCubic =
    904930// ************************ Cubic ************************
    905931"vecf cubicConvolution(float dist1, float dist2, float dist3,\n"
     932                        "vecf f0, vecf f1, vecf f2, vecf f3);\n"
     933
     934"vecf cubicConvolution(float dist1, float dist2, float dist3,\n"
    906935                       "vecf f0, vecf f1, vecf f2, vecf f3)\n"
    907936"{\n"
    908937    "return   (  -f0 +    f1  - f2 + f3) * dist3\n"
     
    10231052    const char *kernResampler =
    10241053// ************************ LanczosSinc ************************
    10251054
     1055"float lanczosSinc( float fX, float fR );\n"
     1056"float bSpline( float x );\n"
     1057
    10261058"float lanczosSinc( float fX, float fR )\n"
    10271059"{\n"
    10281060    "if ( fX > fR || fX < -fR)\n"