Skip to content

Commit

Permalink
provide prototypes and work around strict compiler requirements on so…
Browse files Browse the repository at this point in the history
…me opencl platforms (https://trac.osgeo.org/gdal/ticket/5400)

git-svn-id: https://svn.osgeo.org/gdal/trunk@26983 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
warmerdam committed Feb 26, 2014
1 parent 136f6a8 commit bdec6d6
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion gdal/alg/gdalwarpkernel_opencl.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,32 @@ cl_kernel get_kernel(struct oclWarper *warper, char useVec,
const char *dVecf = "float";
const char *kernGenFuncs =
// ********************* General Funcs ********************
"void clampToDst(float fReal,\n"
"__global outType *dstPtr,\n"
"unsigned int iDstOffset,\n"
"__constant float *fDstNoDataReal,\n"
"int bandNum);\n"
"void setPixel(__global outType *dstReal,\n"
"__global outType *dstImag,\n"
"__global float *dstDensity,\n"
"__global int *nDstValid,\n"
"__constant float *fDstNoDataReal,\n"
"const int bandNum,\n"
"vecf fDensity, vecf fReal, vecf fImag);\n"
"int getPixel(__read_only image2d_t srcReal,\n"
"__read_only image2d_t srcImag,\n"
"__global float *fUnifiedSrcDensity,\n"
"__global int *nUnifiedSrcValid,\n"
"__constant char *useBandSrcValid,\n"
"__global int *nBandSrcValid,\n"
"const int2 iSrc,\n"
"int bandNum,\n"
"vecf *fDensity, vecf *fReal, vecf *fImag);\n"
"int isValid(__global float *fUnifiedSrcDensity,\n"
"__global int *nUnifiedSrcValid,\n"
"float2 fSrcCoords );\n"
"float2 getSrcCoords(__read_only image2d_t srcCoords);\n"

"#ifdef USE_CLAMP_TO_DST_FLOAT\n"
"void clampToDst(float fReal,\n"
"__global outType *dstPtr,\n"
Expand Down Expand Up @@ -666,7 +692,7 @@ cl_kernel get_kernel(struct oclWarper *warper, char useVec,
"int bHasValid = FALSE;\n"

// Clamp the src offset values if needed
"if(useUnifiedSrcDensity || useUnifiedSrcValid || useUseBandSrcValid){\n"
"if(useUnifiedSrcDensity | useUnifiedSrcValid | useUseBandSrcValid){\n"
"int iSrcX = iSrc.x;\n"
"int iSrcY = iSrc.y;\n"

Expand Down Expand Up @@ -902,6 +928,9 @@ cl_kernel get_kernel(struct oclWarper *warper, char useVec,

const char *kernCubic =
// ************************ Cubic ************************
"vecf cubicConvolution(float dist1, float dist2, float dist3,\n"
"vecf f0, vecf f1, vecf f2, vecf f3);\n"

"vecf cubicConvolution(float dist1, float dist2, float dist3,\n"
"vecf f0, vecf f1, vecf f2, vecf f3)\n"
"{\n"
Expand Down Expand Up @@ -1023,6 +1052,9 @@ cl_kernel get_kernel(struct oclWarper *warper, char useVec,
const char *kernResampler =
// ************************ LanczosSinc ************************

"float lanczosSinc( float fX, float fR );\n"
"float bSpline( float x );\n"

"float lanczosSinc( float fX, float fR )\n"
"{\n"
"if ( fX > fR || fX < -fR)\n"
Expand Down

0 comments on commit bdec6d6

Please sign in to comment.