From 2895e27613dab0815e9f0f2f0ed7853d31f856b4 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 2 Apr 2014 14:21:59 +0000 Subject: Add global astra_set_gpu_index function --- src/CudaForwardProjectionAlgorithm3D.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/CudaForwardProjectionAlgorithm3D.cpp') diff --git a/src/CudaForwardProjectionAlgorithm3D.cpp b/src/CudaForwardProjectionAlgorithm3D.cpp index e9289f1..f64620f 100644 --- a/src/CudaForwardProjectionAlgorithm3D.cpp +++ b/src/CudaForwardProjectionAlgorithm3D.cpp @@ -54,7 +54,7 @@ std::string CCudaForwardProjectionAlgorithm3D::type = "FP3D_CUDA"; CCudaForwardProjectionAlgorithm3D::CCudaForwardProjectionAlgorithm3D() { m_bIsInitialized = false; - m_iGPUIndex = 0; + m_iGPUIndex = -1; m_iDetectorSuperSampling = 1; m_pProjector = 0; m_pProjections = 0; @@ -107,7 +107,7 @@ bool CCudaForwardProjectionAlgorithm3D::initialize(const Config& _cfg) CC.markNodeParsed("ProjectorId"); // GPU number - m_iGPUIndex = (int)_cfg.self->getOptionNumerical("GPUindex", 0); + m_iGPUIndex = (int)_cfg.self->getOptionNumerical("GPUindex", -1); CC.markOptionParsed("GPUindex"); m_iDetectorSuperSampling = (int)_cfg.self->getOptionNumerical("DetectorSuperSampling", 1); CC.markOptionParsed("DetectorSuperSampling"); @@ -160,7 +160,7 @@ bool CCudaForwardProjectionAlgorithm3D::check() ASTRA_CONFIG_CHECK(m_pVolume->isInitialized(), "FP3D_CUDA", "Volume Data Object Not Initialized."); ASTRA_CONFIG_CHECK(m_iDetectorSuperSampling >= 1, "FP3D_CUDA", "DetectorSuperSampling must be a positive integer."); - ASTRA_CONFIG_CHECK(m_iGPUIndex >= 0, "FP3D_CUDA", "GPUIndex must be a non-negative integer."); + ASTRA_CONFIG_CHECK(m_iGPUIndex >= -1, "FP3D_CUDA", "GPUIndex must be a non-negative integer."); // check compatibility between projector and data classes // ASTRA_CONFIG_CHECK(m_pSinogram->getGeometry()->isEqual(m_pProjector->getProjectionGeometry()), "SIRT_CUDA", "Projection Data not compatible with the specified Projector."); -- cgit v1.2.3