diff options
-rw-r--r-- | cuda/2d/fft.cu | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cuda/2d/fft.cu b/cuda/2d/fft.cu index 2bb5dc3..413f3aa 100644 --- a/cuda/2d/fft.cu +++ b/cuda/2d/fft.cu @@ -156,8 +156,12 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, return false; } - cufftDestroy(plan); + if (!checkCuda(cudaDeviceSynchronize(), "invokeCudaFFT sync")) { + cufftDestroy(plan); + return false; + } + cufftDestroy(plan); return true; } @@ -179,8 +183,12 @@ static bool invokeCudaIFFT(int _iProjectionCount, int _iDetectorCount, return false; } - cufftDestroy(plan); + if (!checkCuda(cudaDeviceSynchronize(), "invokeCudaIFFT sync")) { + cufftDestroy(plan); + return false; + } + cufftDestroy(plan); return true; } |