summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2021-11-16 11:58:04 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2021-11-16 14:08:57 +0100
commit7f5a50d5b142fe8aeea22754b9895d1fae25e662 (patch)
treedb07e4a2014494c28babb9d1d05804854eef39a4
parent63de6635ac1e5b232f88e90afdf6492df2682a38 (diff)
downloadastra-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.cu12
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;
}