Skip to content

Commit

Permalink
More updates for opencl
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Aug 8, 2018
1 parent d6e747c commit 583c7ae
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
5 changes: 5 additions & 0 deletions python/analysis/auto_generated/raster/qgsaspectfilter.sip.in
Expand Up @@ -30,6 +30,11 @@ nodata value if not present or outside of the border. Must be implemented by sub
%End


<<<<<<< d6e747ca57807318c0b3f6be8266f0b43c0f7747
=======


>>>>>>> More updates for opencl
};

/************************************************************************
Expand Down
Expand Up @@ -36,7 +36,11 @@ Starts the calculation, reads from mInputFile and stores the result in mOutputFi
:param feedback: feedback object that receives update and that is checked for cancelation.

:return: 0 in case of success
<<<<<<< d6e747ca57807318c0b3f6be8266f0b43c0f7747
TODO: return an enum
=======
TODO: return an enum
>>>>>>> More updates for opencl
%End

double cellSizeX() const;
Expand Down
3 changes: 3 additions & 0 deletions python/analysis/auto_generated/raster/qgsslopefilter.sip.in
Expand Up @@ -29,7 +29,10 @@ Calculates output value from nine input values. The input values and the output
nodata value if not present or outside of the border. Must be implemented by subclasses*
%End

<<<<<<< d6e747ca57807318c0b3f6be8266f0b43c0f7747

=======
>>>>>>> More updates for opencl
};

/************************************************************************
Expand Down
10 changes: 5 additions & 5 deletions src/analysis/raster/slope.cl
@@ -1,14 +1,14 @@
#pragma OPENCL EXTENSION cl_khr_fp64 : enable

float calcFirstDer( float x11, float x21, float x31, float x12, float x22, float x32, float x13, float x23, float x33,
double mInputNodataValue, double mOutputNodataValue, double mZFactor, double mCellSize )
float mInputNodataValue, float mOutputNodataValue, float mZFactor, float mCellSize )
{
//the basic formula would be simple, but we need to test for nodata values...
//X: return (( (x31 - x11) + 2 * (x32 - x12) + (x33 - x13) ) / (8 * mCellSizeX));
//Y: return (((x11 - x13) + 2 * (x21 - x23) + (x31 - x33)) / ( 8 * mCellSizeY));

int weight = 0;
double sum = 0;
float sum = 0;


//first row
Expand Down Expand Up @@ -75,7 +75,7 @@ __kernel void processNineCellWindow( __global float *scanLine1,
__global float *scanLine2,
__global float *scanLine3,
__global float *resultLine,
__global double *rasterParams
__global float *rasterParams
) {

// Get the index of the current element
Expand All @@ -102,8 +102,8 @@ __kernel void processNineCellWindow( __global float *scanLine1,
}
else
{
double res = sqrt( derX * derX + derY * derY );
float res = sqrt( derX * derX + derY * derY );
res = atanpi( res );
resultLine[i] = (float)res * 180.0;
resultLine[i] = res * 180.0;
}
}

0 comments on commit 583c7ae

Please sign in to comment.