summaryrefslogtreecommitdiffstats
path: root/src/CudaReconstructionAlgorithm2D.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-03-23 15:29:43 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-03-23 16:03:16 +0100
commit495903529d473a9968c1333d5a515e3b94732f0b (patch)
treea64a970fc3b5f0193df56348e7dd3c4e9161f26f /src/CudaReconstructionAlgorithm2D.cpp
parent37e1c06154362e26acdb4b09c4a251ec2ad0a316 (diff)
downloadastra-495903529d473a9968c1333d5a515e3b94732f0b.tar.gz
astra-495903529d473a9968c1333d5a515e3b94732f0b.tar.bz2
astra-495903529d473a9968c1333d5a515e3b94732f0b.tar.xz
astra-495903529d473a9968c1333d5a515e3b94732f0b.zip
Move CUDA algorithm initialization to its own function
Diffstat (limited to 'src/CudaReconstructionAlgorithm2D.cpp')
-rw-r--r--src/CudaReconstructionAlgorithm2D.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/CudaReconstructionAlgorithm2D.cpp b/src/CudaReconstructionAlgorithm2D.cpp
index 5a1910c..2798434 100644
--- a/src/CudaReconstructionAlgorithm2D.cpp
+++ b/src/CudaReconstructionAlgorithm2D.cpp
@@ -329,6 +329,20 @@ bool CCudaReconstructionAlgorithm2D::setupGeometry()
}
//----------------------------------------------------------------------------------------
+
+void CCudaReconstructionAlgorithm2D::initCUDAAlgorithm()
+{
+ bool ok;
+
+ ok = setupGeometry();
+ ASTRA_ASSERT(ok);
+
+ ok = m_pAlgo->allocateBuffers();
+ ASTRA_ASSERT(ok);
+}
+
+
+//----------------------------------------------------------------------------------------
// Iterate
void CCudaReconstructionAlgorithm2D::run(int _iNrIterations)
{
@@ -339,13 +353,7 @@ void CCudaReconstructionAlgorithm2D::run(int _iNrIterations)
const CVolumeGeometry2D& volgeom = *m_pReconstruction->getGeometry();
if (!m_bAlgoInit) {
-
- ok = setupGeometry();
- ASTRA_ASSERT(ok);
-
- ok = m_pAlgo->allocateBuffers();
- ASTRA_ASSERT(ok);
-
+ initCUDAAlgorithm();
m_bAlgoInit = true;
}