From 71db6331f8dd0d5abbeee92977af01293be4f427 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 28 Nov 2016 15:54:07 +0100 Subject: Update headers (website+2016) --- cuda/3d/mem3d.cu | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cuda/3d/mem3d.cu') diff --git a/cuda/3d/mem3d.cu b/cuda/3d/mem3d.cu index cb15ab9..eae9676 100644 --- a/cuda/3d/mem3d.cu +++ b/cuda/3d/mem3d.cu @@ -1,10 +1,10 @@ /* ----------------------------------------------------------------------- -Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp - 2014-2015, CWI, Amsterdam +Copyright: 2010-2016, iMinds-Vision Lab, University of Antwerp + 2014-2016, CWI, Amsterdam Contact: astra@uantwerpen.be -Website: http://sf.net/projects/astra-toolbox +Website: http://www.astra-toolbox.com/ This file is part of the ASTRA Toolbox. @@ -23,7 +23,6 @@ You should have received a copy of the GNU General Public License along with the ASTRA Toolbox. If not, see . ----------------------------------------------------------------------- -$Id$ */ #include -- cgit v1.2.3 From 55dabbf035b55f71c4261c9de7ef572da46300ff Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 1 Dec 2016 14:03:56 +0100 Subject: Expose the density weighting option of cone_bp It is now exposed via the new DensityWeighting option of CudaProjector3D. --- cuda/3d/mem3d.cu | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cuda/3d/mem3d.cu') diff --git a/cuda/3d/mem3d.cu b/cuda/3d/mem3d.cu index eae9676..2b26fe1 100644 --- a/cuda/3d/mem3d.cu +++ b/cuda/3d/mem3d.cu @@ -249,7 +249,7 @@ bool FP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, con return ok; } -bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, int iVoxelSuperSampling) +bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, int iVoxelSuperSampling, bool bFDKWeighting) { SDimensions3D dims; SProjectorParams3D params; @@ -269,6 +269,8 @@ bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, con pParProjs, pConeProjs, params); + params.bFDKWeighting = bFDKWeighting; + if (pParProjs) ok &= Par3DBP(volData.d->ptr, projData.d->ptr, dims, pParProjs, params); else -- cgit v1.2.3 From d85a660f064e8130b27e11c7fd762221c754c315 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 26 Jan 2017 14:57:57 +0100 Subject: Start work on CFloat32Data3DGPU to allow persistent/external GPU memory --- cuda/3d/mem3d.cu | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'cuda/3d/mem3d.cu') diff --git a/cuda/3d/mem3d.cu b/cuda/3d/mem3d.cu index 2b26fe1..97be8a4 100644 --- a/cuda/3d/mem3d.cu +++ b/cuda/3d/mem3d.cu @@ -118,6 +118,13 @@ MemHandle3D allocateGPUMemory(unsigned int x, unsigned int y, unsigned int z, Me return ret; } +bool zeroGPUMemory(MemHandle3D handle, unsigned int x, unsigned int y, unsigned int z) +{ + SMemHandle3D_internal& hnd = *handle.d.get(); + cudaError_t err = cudaMemset3D(hnd.ptr, 0, make_cudaExtent(sizeof(float)*x, y, z)); + return err == cudaSuccess; +} + bool freeGPUMemory(MemHandle3D handle) { size_t free = availableGPUMemory(); @@ -307,6 +314,23 @@ bool FDK(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, co } +MemHandle3D wrapHandle(float *D_ptr, unsigned int x, unsigned int y, unsigned int z, unsigned int pitch) +{ + cudaPitchedPtr ptr; + ptr.ptr = D_ptr; + ptr.xsize = sizeof(float) * x; + ptr.pitch = sizeof(float) * pitch; + ptr.ysize = y; + + SMemHandle3D_internal h; + h.ptr = ptr; + + MemHandle3D hnd; + hnd.d = boost::shared_ptr(new SMemHandle3D_internal); + *hnd.d = h; + + return hnd; +} -- cgit v1.2.3 From aa325035704f932e29217274aeab26ae46847a7b Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 17 Feb 2017 15:56:36 +0100 Subject: Fix cuda3d geometry memory leaks --- cuda/3d/mem3d.cu | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'cuda/3d/mem3d.cu') diff --git a/cuda/3d/mem3d.cu b/cuda/3d/mem3d.cu index 97be8a4..ed779fa 100644 --- a/cuda/3d/mem3d.cu +++ b/cuda/3d/mem3d.cu @@ -253,6 +253,9 @@ bool FP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, con } } + delete[] pParProjs; + delete[] pConeProjs; + return ok; } @@ -283,6 +286,9 @@ bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, con else ok &= ConeBP(volData.d->ptr, projData.d->ptr, dims, pConeProjs, params); + delete[] pParProjs; + delete[] pConeProjs; + return ok; } @@ -303,11 +309,17 @@ bool FDK(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, co pParProjs, pConeProjs, params); - if (!ok || !pConeProjs) + if (!ok || !pConeProjs) { + delete[] pParProjs; + delete[] pConeProjs; return false; + } ok &= FDK(volData.d->ptr, projData.d->ptr, pConeProjs, dims, params, bShortScan, pfFilter); + delete[] pParProjs; + delete[] pConeProjs; + return ok; -- cgit v1.2.3