summaryrefslogtreecommitdiffstats
path: root/cuda/2d/util.cu
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2015-03-20 15:32:25 +0100
committerWillem Jan Palenstijn <wjp@usecode.org>2015-03-20 15:32:25 +0100
commit8d9ddc51076ce0da3d0a4216b1bc495783f3733c (patch)
tree200d43d0356f052fe23da463330e43b37138386e /cuda/2d/util.cu
parent2d55fd38b4a8ef5076c0591ae4147f81c1107ee3 (diff)
parent9ba78fcfa3dec88928df33be26821e3fd5a10727 (diff)
downloadastra-8d9ddc51076ce0da3d0a4216b1bc495783f3733c.tar.gz
astra-8d9ddc51076ce0da3d0a4216b1bc495783f3733c.tar.bz2
astra-8d9ddc51076ce0da3d0a4216b1bc495783f3733c.tar.xz
astra-8d9ddc51076ce0da3d0a4216b1bc495783f3733c.zip
Merge pull request #30 from dmpelt/logging
New logging API
Diffstat (limited to 'cuda/2d/util.cu')
-rw-r--r--cuda/2d/util.cu8
1 files changed, 5 insertions, 3 deletions
diff --git a/cuda/2d/util.cu b/cuda/2d/util.cu
index 81e368f..a4f8f3e 100644
--- a/cuda/2d/util.cu
+++ b/cuda/2d/util.cu
@@ -30,6 +30,8 @@ $Id$
#include <cassert>
#include "util.h"
+#include "../../include/astra/Logging.h"
+
namespace astraCUDA {
bool copyVolumeToDevice(const float* in_data, unsigned int in_pitch,
@@ -91,7 +93,7 @@ bool allocateVolume(float*& ptr, unsigned int width, unsigned int height, unsign
cudaError_t ret = cudaMallocPitch((void**)&ptr, &p, sizeof(float)*width, height);
if (ret != cudaSuccess) {
reportCudaError(ret);
- fprintf(stderr, "Failed to allocate %dx%d GPU buffer\n", width, height);
+ ASTRA_ERROR("Failed to allocate %dx%d GPU buffer", width, height);
return false;
}
@@ -259,7 +261,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;
}
@@ -269,7 +271,7 @@ bool cudaTextForceKernelsCompletion()
void reportCudaError(cudaError_t err)
{
if(err != cudaSuccess)
- fprintf(stderr, "CUDA error %d: %s.\n", err, cudaGetErrorString(err));
+ ASTRA_ERROR("CUDA error %d: %s.", err, cudaGetErrorString(err));
}