diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2021-11-16 14:07:55 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2021-11-16 14:07:55 +0100 |
commit | c6e203411abf3dad3e677aaa1186b927086f8ba7 (patch) | |
tree | 6c728e1125961fc04ba6f77bf9af637925825f5b /cuda/2d/par_fp.cu | |
parent | 231dd3e5e28319aa16155efd9ec7fdc69834666b (diff) | |
parent | 39582115bc93b5435d25e56891815ae7cb1898fd (diff) | |
download | astra-c6e203411abf3dad3e677aaa1186b927086f8ba7.tar.gz astra-c6e203411abf3dad3e677aaa1186b927086f8ba7.tar.bz2 astra-c6e203411abf3dad3e677aaa1186b927086f8ba7.tar.xz astra-c6e203411abf3dad3e677aaa1186b927086f8ba7.zip |
Merge branch 'checkCuda'
This cleans up error logging and handling for cuda calls.
Diffstat (limited to 'cuda/2d/par_fp.cu')
-rw-r--r-- | cuda/2d/par_fp.cu | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/cuda/2d/par_fp.cu b/cuda/2d/par_fp.cu index 8c48280..e947428 100644 --- a/cuda/2d/par_fp.cu +++ b/cuda/2d/par_fp.cu @@ -305,8 +305,8 @@ bool FP_simple_internal(float* D_volumeData, unsigned int volumePitch, dim3 dimGrid((blockEnd-blockStart+g_anglesPerBlock-1)/g_anglesPerBlock, (dims.iProjDets+g_detBlockSize-1)/g_detBlockSize); // angle blocks, detector blocks - // TODO: check if we can't immediately - // destroy the stream after use + // TODO: consider limiting number of handle (chaotic) geoms + // with many alternating directions cudaStream_t stream; cudaStreamCreate(&stream); streams.push_back(stream); @@ -323,19 +323,16 @@ bool FP_simple_internal(float* D_volumeData, unsigned int volumePitch, } } - for (std::list<cudaStream_t>::iterator iter = streams.begin(); iter != streams.end(); ++iter) - cudaStreamDestroy(*iter); - - streams.clear(); - - cudaThreadSynchronize(); + bool ok = true; - cudaTextForceKernelsCompletion(); + for (std::list<cudaStream_t>::iterator iter = streams.begin(); iter != streams.end(); ++iter) { + ok &= checkCuda(cudaStreamSynchronize(*iter), "par_fp"); + cudaStreamDestroy(*iter); + } cudaFreeArray(D_dataArray); - - return true; + return ok; } bool FP_simple(float* D_volumeData, unsigned int volumePitch, |