Commit fda0cc5c authored by David Rohr's avatar David Rohr
Browse files

fix bug in gpu fft code, index calculation was wrong if number of maps was...

fix bug in gpu fft code, index calculation was wrong if number of maps was higher than number of maps per cufft call
parent 050253b8
......@@ -115,7 +115,7 @@ __global__ void compareRefMapLoopShifts_kernel(const int iOrient, const int iCon
__global__ void multComplexMap(const mycomplex_t* convmap, const mycomplex_t* refmap, mycuComplex_t* out, const int NumberPixelsTotal, const int MapSize, const int NumberMaps, const int Offset)
{
if (myBlockIdxX >= NumberMaps) return;
const mycuComplex_t* myin = (mycuComplex_t*) &refmap[myBlockIdxX * MapSize + Offset];
const mycuComplex_t* myin = (mycuComplex_t*) &refmap[(myBlockIdxX + Offset) * MapSize];
const mycuComplex_t* myconv = (mycuComplex_t*) convmap;
mycuComplex_t* myout = &out[myBlockIdxX * MapSize];
for(int i = myThreadIdxX; i < NumberPixelsTotal; i += myBlockDimX)
......@@ -132,9 +132,9 @@ __global__ void multComplexMap(const mycomplex_t* convmap, const mycomplex_t* re
__global__ void cuDoRefMapsFFT(const int iOrient, const int iConv, const myfloat_t* lCC, const myfloat_t sumC, const myfloat_t sumsquareC, bioem_Probability pProb, const bioem_param_device param, const bioem_RefMap RefMap, const int maxRef, const int Offset)
{
if (myBlockIdxX * myBlockDimX + myThreadIdxX >= maxRef) return;
const int iRefMap = myBlockIdxX * myBlockDimX + myThreadIdxX + Offset;
const myfloat_t* mylCC = &lCC[(myBlockIdxX * myBlockDimX + myThreadIdxX) * param.NumberPixels * param.NumberPixels];
if (iRefMap >= maxRef) return;
doRefMapFFT(iRefMap, iOrient, iConv, mylCC, sumC, sumsquareC, pProb, param, RefMap);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment