diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2021-11-16 11:58:04 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2021-11-16 14:08:57 +0100 |
commit | 7f5a50d5b142fe8aeea22754b9895d1fae25e662 (patch) | |
tree | db07e4a2014494c28babb9d1d05804854eef39a4 | |
parent | 63de6635ac1e5b232f88e90afdf6492df2682a38 (diff) | |
download | astra-7f5a50d5b142fe8aeea22754b9895d1fae25e662.tar.gz astra-7f5a50d5b142fe8aeea22754b9895d1fae25e662.tar.bz2 astra-7f5a50d5b142fe8aeea22754b9895d1fae25e662.tar.xz astra-7f5a50d5b142fe8aeea22754b9895d1fae25e662.zip |
Add missing synchronize before free in FFT
-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; } |