Commit ff7b0d2b authored by David Rohr's avatar David Rohr

fix cuda code if max fft maps per kernel is divider of total map count

parent 4c6954bc
......@@ -377,6 +377,7 @@ int bioem_cuda::deviceStartRun()
{
for (int i = 0; i < 2; i++)
{
if (i && maxRef % CUDA_FFTS_AT_ONCE == 0) continue;
int n[2] = {param.param_device.NumberPixels, param.param_device.NumberPixels};
if (cufftPlanMany(&plan[i][j], 2, n, NULL, 1, param.FFTMapSize, NULL, 1, 0, MY_CUFFT_C2R, i ? (maxRef % CUDA_FFTS_AT_ONCE) : CUDA_FFTS_AT_ONCE) != CUFFT_SUCCESS)
{
......@@ -409,7 +410,11 @@ int bioem_cuda::deviceFinishRun()
{
for (int j = 0;j < 2;j++)
{
for (int i = 0; i < 2; i++) cufftDestroy(plan[i][j]);
for (int i = 0; i < 2; i++)
{
if (i && maxRef % CUDA_FFTS_AT_ONCE == 0) continue;
cufftDestroy(plan[i][j]);
}
if (!GPUDualStream) break;
}
}
......
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