diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-04-15 14:27:52 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-04-15 14:27:52 +0200 |
commit | 66968b3886b3800afcecf8f089962f87243cf4b1 (patch) | |
tree | 7b162a87427c18eb37446d7f98a1e376ef5da73d /cuda/3d/util3d.cu | |
parent | 9458268a8b9192af98fc1b88bf0a5fbbc7696a77 (diff) | |
parent | 40475404d83d74d7b5db3f71ea1488a6de10ccc5 (diff) | |
download | astra-66968b3886b3800afcecf8f089962f87243cf4b1.tar.gz astra-66968b3886b3800afcecf8f089962f87243cf4b1.tar.bz2 astra-66968b3886b3800afcecf8f089962f87243cf4b1.tar.xz astra-66968b3886b3800afcecf8f089962f87243cf4b1.zip |
Merge branch 'master' into volgeom3d
Diffstat (limited to 'cuda/3d/util3d.cu')
-rw-r--r-- | cuda/3d/util3d.cu | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cuda/3d/util3d.cu b/cuda/3d/util3d.cu index d85a928..537ed69 100644 --- a/cuda/3d/util3d.cu +++ b/cuda/3d/util3d.cu @@ -31,6 +31,8 @@ $Id$ #include "util3d.h" #include "../2d/util.h" +#include "../../include/astra/Logging.h" + namespace astraCUDA3d { @@ -46,7 +48,7 @@ cudaPitchedPtr allocateVolumeData(const SDimensions3D& dims) cudaError err = cudaMalloc3D(&volData, extentV); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - fprintf(stderr, "Failed to allocate %dx%dx%d GPU buffer\n", dims.iVolX, dims.iVolY, dims.iVolZ); + ASTRA_ERROR("Failed to allocate %dx%dx%d GPU buffer", dims.iVolX, dims.iVolY, dims.iVolZ); volData.ptr = 0; // TODO: return 0 somehow? } @@ -65,7 +67,7 @@ cudaPitchedPtr allocateProjectionData(const SDimensions3D& dims) cudaError err = cudaMalloc3D(&projData, extentP); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - fprintf(stderr, "Failed to allocate %dx%dx%d GPU buffer\n", dims.iProjU, dims.iProjAngles, dims.iProjV); + ASTRA_ERROR("Failed to allocate %dx%dx%d GPU buffer", dims.iProjU, dims.iProjAngles, dims.iProjV); projData.ptr = 0; // TODO: return 0 somehow? } @@ -303,7 +305,7 @@ cudaArray* allocateVolumeArray(const SDimensions3D& dims) cudaError err = cudaMalloc3DArray(&cuArray, &channelDesc, extentA); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - fprintf(stderr, "Failed to allocate %dx%dx%d GPU array\n", dims.iVolX, dims.iVolY, dims.iVolZ); + ASTRA_ERROR("Failed to allocate %dx%dx%d GPU array", dims.iVolX, dims.iVolY, dims.iVolZ); return 0; } @@ -321,7 +323,7 @@ cudaArray* allocateProjectionArray(const SDimensions3D& dims) if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - fprintf(stderr, "Failed to allocate %dx%dx%d GPU array\n", dims.iProjU, dims.iProjAngles, dims.iProjV); + ASTRA_ERROR("Failed to allocate %dx%dx%d GPU array", dims.iProjU, dims.iProjAngles, dims.iProjV); return 0; } @@ -397,7 +399,7 @@ bool cudaTextForceKernelsCompletion() cudaError_t returnedCudaError = cudaThreadSynchronize(); if(returnedCudaError != cudaSuccess) { - fprintf(stderr, "Failed to force completion of cuda kernels: %d: %s.\n", returnedCudaError, cudaGetErrorString(returnedCudaError)); + ASTRA_ERROR("Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); return false; } |