summaryrefslogtreecommitdiffstats
path: root/cuda/2d/util.cu
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-03-10 15:11:15 +0100
committerDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-03-10 15:11:15 +0100
commit150951875c236f95a64fd132c26576bd19daca80 (patch)
treeecafe5eed21bc15e577be9cb16702d1e03d31162 /cuda/2d/util.cu
parent535564ccd8b9563fb52be0dff247b99495942f51 (diff)
downloadastra-150951875c236f95a64fd132c26576bd19daca80.tar.gz
astra-150951875c236f95a64fd132c26576bd19daca80.tar.bz2
astra-150951875c236f95a64fd132c26576bd19daca80.tar.xz
astra-150951875c236f95a64fd132c26576bd19daca80.zip
Use new logging API internally instead of printf / iostream
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..6ced557 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::CLogger::error(__FILE__,__LINE__,"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::CLogger::error(__FILE__,__LINE__,"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::CLogger::error(__FILE__,__LINE__,"CUDA error %d: %s.", err, cudaGetErrorString(err));
}