From 521825da92af4d3a08609241353517b8ec7e780c Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 18 Oct 2017 23:00:25 +0200 Subject: Fix output initialization for MODE_ADD CGM jobs --- src/CompositeGeometryManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CompositeGeometryManager.cpp b/src/CompositeGeometryManager.cpp index a4dace2..184144c 100644 --- a/src/CompositeGeometryManager.cpp +++ b/src/CompositeGeometryManager.cpp @@ -1386,6 +1386,12 @@ static bool doJob(const CCompositeGeometryManager::TJobSet::const_iterator& iter bool ok = dstMem->allocateGPUMemory(outx, outy, outz, zero ? astraCUDA3d::INIT_ZERO : astraCUDA3d::INIT_NO); if (!ok) ASTRA_ERROR("Error allocating GPU memory"); + if (!zero) { + // instead of zeroing output memory, copy from host + ok = dstMem->copyToGPUMemory(dstdims); + if (!ok) ASTRA_ERROR("Error copying output data to GPU"); + } + for (CCompositeGeometryManager::TJobList::const_iterator i = L.begin(); i != L.end(); ++i) { const CCompositeGeometryManager::SJob &j = *i; -- cgit v1.2.3