From d4645875801d29402b1e3f2a42a5d9902a37a718 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 22 Nov 2021 14:14:55 +0100 Subject: De-duplicate 3D texture object creation --- include/astra/cuda/3d/util3d.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/astra/cuda/3d/util3d.h b/include/astra/cuda/3d/util3d.h index 9fa254d..210d944 100644 --- a/include/astra/cuda/3d/util3d.h +++ b/include/astra/cuda/3d/util3d.h @@ -60,6 +60,8 @@ bool zeroVolumeArray(cudaArray* array, const SDimensions3D& dims); cudaArray* allocateProjectionArray(const SDimensions3D& dims); cudaArray* allocateVolumeArray(const SDimensions3D& dims); +bool createTextureObject3D(cudaArray* array, cudaTextureObject_t& texObj); + float dotProduct3D(cudaPitchedPtr data, unsigned int x, unsigned int y, unsigned int z); int calcNextPowerOfTwo(int _iValue); -- cgit v1.2.3 From be2da43a560a7241c56e727fb481f1389e9f7fdf Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 22 Nov 2021 14:43:07 +0100 Subject: De-duplicate 2D texture object creation --- include/astra/cuda/2d/util.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/astra/cuda/2d/util.h b/include/astra/cuda/2d/util.h index 0fab9b1..cacf0a9 100644 --- a/include/astra/cuda/2d/util.h +++ b/include/astra/cuda/2d/util.h @@ -66,6 +66,10 @@ bool zeroProjectionData(float* D_ptr, unsigned int pitch, const SDimensions& dim void duplicateVolumeData(float* D_dst, float* D_src, unsigned int pitch, const SDimensions& dims); void duplicateProjectionData(float* D_dst, float* D_src, unsigned int pitch, const SDimensions& dims); +bool createTextureObject2D(float* data, cudaArray*& dataArray, cudaTextureObject_t& texObj, unsigned int pitch, unsigned int width, unsigned int height); +bool createTextureObjectPitch2D(float* data, cudaTextureObject_t& texObj, unsigned int pitch, unsigned int width, unsigned int height, cudaTextureAddressMode mode = cudaAddressModeBorder); + + bool checkCuda(cudaError_t err, const char *msg); float dotProduct2D(float* D_data, unsigned int pitch, -- cgit v1.2.3 From 7cad7b813838ed2ddb65a4c9ea1c08c625c50043 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 22 Nov 2021 14:44:50 +0100 Subject: Fix memleak in error handling --- include/astra/cuda/2d/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/astra/cuda/2d/util.h b/include/astra/cuda/2d/util.h index cacf0a9..2cf0639 100644 --- a/include/astra/cuda/2d/util.h +++ b/include/astra/cuda/2d/util.h @@ -66,7 +66,7 @@ bool zeroProjectionData(float* D_ptr, unsigned int pitch, const SDimensions& dim void duplicateVolumeData(float* D_dst, float* D_src, unsigned int pitch, const SDimensions& dims); void duplicateProjectionData(float* D_dst, float* D_src, unsigned int pitch, const SDimensions& dims); -bool createTextureObject2D(float* data, cudaArray*& dataArray, cudaTextureObject_t& texObj, unsigned int pitch, unsigned int width, unsigned int height); +bool createArrayAndTextureObject2D(float* data, cudaArray*& dataArray, cudaTextureObject_t& texObj, unsigned int pitch, unsigned int width, unsigned int height); bool createTextureObjectPitch2D(float* data, cudaTextureObject_t& texObj, unsigned int pitch, unsigned int width, unsigned int height, cudaTextureAddressMode mode = cudaAddressModeBorder); -- cgit v1.2.3