diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2021-11-16 14:07:55 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2021-11-16 14:07:55 +0100 |
commit | c6e203411abf3dad3e677aaa1186b927086f8ba7 (patch) | |
tree | 6c728e1125961fc04ba6f77bf9af637925825f5b /include | |
parent | 231dd3e5e28319aa16155efd9ec7fdc69834666b (diff) | |
parent | 39582115bc93b5435d25e56891815ae7cb1898fd (diff) | |
download | astra-c6e203411abf3dad3e677aaa1186b927086f8ba7.tar.gz astra-c6e203411abf3dad3e677aaa1186b927086f8ba7.tar.bz2 astra-c6e203411abf3dad3e677aaa1186b927086f8ba7.tar.xz astra-c6e203411abf3dad3e677aaa1186b927086f8ba7.zip |
Merge branch 'checkCuda'
This cleans up error logging and handling for cuda calls.
Diffstat (limited to 'include')
-rw-r--r-- | include/astra/cuda/2d/util.h | 16 | ||||
-rw-r--r-- | include/astra/cuda/3d/util3d.h | 4 |
2 files changed, 6 insertions, 14 deletions
diff --git a/include/astra/cuda/2d/util.h b/include/astra/cuda/2d/util.h index 49079ef..0fab9b1 100644 --- a/include/astra/cuda/2d/util.h +++ b/include/astra/cuda/2d/util.h @@ -40,9 +40,6 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>. #define M_PI 3.14159265358979323846 #endif -#define ASTRA_CUDA_ASSERT(err) do { if (err != cudaSuccess) { astraCUDA::reportCudaError(err); assert(err == cudaSuccess); } } while(0) - - namespace astraCUDA { bool copyVolumeToDevice(const float* in_data, unsigned int in_pitch, @@ -59,22 +56,17 @@ bool copySinogramToDevice(const float* in_data, unsigned int in_pitch, float* outD_data, unsigned int out_pitch); bool allocateVolume(float*& D_ptr, unsigned int width, unsigned int height, unsigned int& pitch); -void zeroVolume(float* D_data, unsigned int pitch, unsigned int width, unsigned int height); +bool zeroVolume(float* D_data, unsigned int pitch, unsigned int width, unsigned int height); bool allocateVolumeData(float*& D_ptr, unsigned int& pitch, const SDimensions& dims); bool allocateProjectionData(float*& D_ptr, unsigned int& pitch, const SDimensions& dims); -void zeroVolumeData(float* D_ptr, unsigned int pitch, const SDimensions& dims); -void zeroProjectionData(float* D_ptr, unsigned int pitch, const SDimensions& dims); +bool zeroVolumeData(float* D_ptr, unsigned int pitch, const SDimensions& dims); +bool zeroProjectionData(float* D_ptr, unsigned int pitch, const SDimensions& dims); 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 cudaTextForceKernelsCompletion(); -void reportCudaError(cudaError_t err); - - +bool checkCuda(cudaError_t err, const char *msg); float dotProduct2D(float* D_data, unsigned int pitch, unsigned int width, unsigned int height); diff --git a/include/astra/cuda/3d/util3d.h b/include/astra/cuda/3d/util3d.h index 5f805df..e147e42 100644 --- a/include/astra/cuda/3d/util3d.h +++ b/include/astra/cuda/3d/util3d.h @@ -38,6 +38,8 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>. namespace astraCUDA3d { +using astraCUDA::checkCuda; + cudaPitchedPtr allocateVolumeData(const SDimensions3D& dims); cudaPitchedPtr allocateProjectionData(const SDimensions3D& dims); bool zeroVolumeData(cudaPitchedPtr& D_data, const SDimensions3D& dims); @@ -58,8 +60,6 @@ bool zeroVolumeArray(cudaArray* array, const SDimensions3D& dims); cudaArray* allocateProjectionArray(const SDimensions3D& dims); cudaArray* allocateVolumeArray(const SDimensions3D& dims); -bool cudaTextForceKernelsCompletion(); - float dotProduct3D(cudaPitchedPtr data, unsigned int x, unsigned int y, unsigned int z); int calcNextPowerOfTwo(int _iValue); |