From 475b1746c133b0286871b7414918704557f1abcc Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Mon, 9 Mar 2015 15:53:07 +0100 Subject: Remove old Logging code (only used in fft.cu) --- cuda/2d/astra.cu | 3 +-- cuda/2d/fft.cu | 10 +++------- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'cuda') diff --git a/cuda/2d/astra.cu b/cuda/2d/astra.cu index 0b5be06..bcc1a50 100644 --- a/cuda/2d/astra.cu +++ b/cuda/2d/astra.cu @@ -42,7 +42,6 @@ $Id$ #include #include -#include "../../include/astra/Logger.h" #include "../../include/astra/VolumeGeometry2D.h" #include "../../include/astra/ParallelProjectionGeometry2D.h" #include "../../include/astra/FanFlatProjectionGeometry2D.h" @@ -538,7 +537,7 @@ bool AstraFBP::setFilter(E_FBPFILTER _eFilter, const float * _pfHostFilter /* = int iMaxFilterIndex = iStartFilterIndex + iUsedFilterWidth; int iFilterShiftSize = _iFilterWidth / 2; - + for(int iDetectorIndex = iStartFilterIndex; iDetectorIndex < iMaxFilterIndex; iDetectorIndex++) { int iFFTInFilterIndex = (iDetectorIndex + iFFTRealDetCount - iFilterShiftSize) % iFFTRealDetCount; diff --git a/cuda/2d/fft.cu b/cuda/2d/fft.cu index d105e29..5fef360 100644 --- a/cuda/2d/fft.cu +++ b/cuda/2d/fft.cu @@ -34,7 +34,6 @@ $Id$ #include #include -#include "../../include/astra/Logger.h" using namespace astra; @@ -45,7 +44,6 @@ using namespace astra; if( cudaSuccess != err) { \ fprintf(stderr, "Cuda error: %s in file '%s' in line %i : %s.\n", \ errorMessage, __FILE__, __LINE__, cudaGetErrorString( err) );\ - CLogger::writeTerminalCUDAError(__FILE__, __LINE__, cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) @@ -54,14 +52,12 @@ using namespace astra; if( cudaSuccess != err) { \ fprintf(stderr, "Cuda error in file '%s' in line %i : %s.\n", \ __FILE__, __LINE__, cudaGetErrorString( err) ); \ - CLogger::writeTerminalCUDAError(__FILE__, __LINE__, cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } \ err = cudaThreadSynchronize(); \ if( cudaSuccess != err) { \ fprintf(stderr, "Cuda error in file '%s' in line %i : %s.\n", \ __FILE__, __LINE__, cudaGetErrorString( err) ); \ - CLogger::writeTerminalCUDAError(__FILE__, __LINE__, cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) @@ -460,7 +456,7 @@ void genFilter(E_FBPFILTER _eFilter, float _fD, int _iProjectionCount, const float fA1 = 0.48f; const float fA2 = 0.38f; float fNMinusOne = (float)(_iFFTFourierDetectorCount) - 1.0f; - + for(int iDetectorIndex = 1; iDetectorIndex < _iFFTFourierDetectorCount; iDetectorIndex++) { float fSmallN = (float)iDetectorIndex; @@ -746,7 +742,7 @@ void testCudaFFT() { for(int iDetectorIndex = 0; iDetectorIndex < iDetectorCount; iDetectorIndex++) { -// int +// int // pfHostProj[iIndex] = (float)rand() / (float)RAND_MAX; } @@ -787,7 +783,7 @@ void testCudaFFT() float * pfHostFourProjImaginary = new float[iTotalElementCount]; convertComplexToRealImg(pHostFourProj, iTotalElementCount, pfHostFourProjReal, pfHostFourProjImaginary); - + writeToMatlabFile("proj_four_real.mat", pfHostFourProjReal, iProjectionCount, iDetectorCount); writeToMatlabFile("proj_four_imaginary.mat", pfHostFourProjImaginary, iProjectionCount, iDetectorCount); -- cgit v1.2.3 From 150951875c236f95a64fd132c26576bd19daca80 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Tue, 10 Mar 2015 15:11:15 +0100 Subject: Use new logging API internally instead of printf / iostream --- cuda/2d/astra.cu | 4 +++- cuda/2d/fft.cu | 31 ++++++++++++++++--------------- cuda/2d/util.cu | 8 +++++--- cuda/3d/util3d.cu | 12 +++++++----- 4 files changed, 31 insertions(+), 24 deletions(-) (limited to 'cuda') diff --git a/cuda/2d/astra.cu b/cuda/2d/astra.cu index bcc1a50..71fd089 100644 --- a/cuda/2d/astra.cu +++ b/cuda/2d/astra.cu @@ -47,6 +47,8 @@ $Id$ #include "../../include/astra/FanFlatProjectionGeometry2D.h" #include "../../include/astra/FanFlatVecProjectionGeometry2D.h" +#include "../../include/astra/Logging.h" + // For fan beam FBP weighting #include "../3d/fdk.h" @@ -562,7 +564,7 @@ bool AstraFBP::setFilter(E_FBPFILTER _eFilter, const float * _pfHostFilter /* = } default: { - fprintf(stderr, "AstraFBP::setFilter: Unknown filter type requested"); + astra::CLogger::error(__FILE__,__LINE__,"AstraFBP::setFilter: Unknown filter type requested"); delete [] pHostFilter; return false; } diff --git a/cuda/2d/fft.cu b/cuda/2d/fft.cu index 5fef360..468c7c2 100644 --- a/cuda/2d/fft.cu +++ b/cuda/2d/fft.cu @@ -34,6 +34,7 @@ $Id$ #include #include +#include "../../include/astra/Logging.h" using namespace astra; @@ -42,22 +43,22 @@ using namespace astra; #define CHECK_ERROR(errorMessage) do { \ cudaError_t err = cudaThreadSynchronize(); \ if( cudaSuccess != err) { \ - fprintf(stderr, "Cuda error: %s in file '%s' in line %i : %s.\n", \ - errorMessage, __FILE__, __LINE__, cudaGetErrorString( err) );\ + astra::CLogger::error(__FILE__,__LINE__,"Cuda error %s : %s", \ + errorMessage,cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) #define SAFE_CALL( call) do { \ cudaError err = call; \ if( cudaSuccess != err) { \ - fprintf(stderr, "Cuda error in file '%s' in line %i : %s.\n", \ - __FILE__, __LINE__, cudaGetErrorString( err) ); \ + astra::CLogger::error(__FILE__,__LINE__,"Cuda error: %s ", \ + cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } \ err = cudaThreadSynchronize(); \ if( cudaSuccess != err) { \ - fprintf(stderr, "Cuda error in file '%s' in line %i : %s.\n", \ - __FILE__, __LINE__, cudaGetErrorString( err) ); \ + astra::CLogger::error(__FILE__,__LINE__,"Cuda error: %s : ", \ + cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) @@ -136,7 +137,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_R2C, _iProjectionCount); if(result != CUFFT_SUCCESS) { - std::cerr << "Failed to plan 1d r2c fft" << std::endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d r2c fft"); return false; } @@ -145,7 +146,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, if(result != CUFFT_SUCCESS) { - std::cerr << "Failed to exec 1d r2c fft" << std::endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d r2c fft"); return false; } @@ -162,7 +163,7 @@ static bool invokeCudaIFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_C2R, _iProjectionCount); if(result != CUFFT_SUCCESS) { - std::cerr << "Failed to plan 1d c2r fft" << std::endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d c2r fft"); return false; } @@ -173,7 +174,7 @@ static bool invokeCudaIFFT(int _iProjectionCount, int _iDetectorCount, if(result != CUFFT_SUCCESS) { - std::cerr << "Failed to exec 1d c2r fft" << std::endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d c2r fft"); return false; } @@ -629,7 +630,7 @@ void genFilter(E_FBPFILTER _eFilter, float _fD, int _iProjectionCount, } default: { - std::cerr << "Cannot serve requested filter" << std::endl; + astra::CLogger::error(__FILE__,__LINE__,"Cannot serve requested filter"); } } @@ -763,13 +764,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_R2C, iProjectionCount); if(result != CUFFT_SUCCESS) { - cerr << "Failed to plan 1d r2c fft" << endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d r2c fft"); } result = cufftExecR2C(plan, pfDevProj, pDevFourProj); if(result != CUFFT_SUCCESS) { - cerr << "Failed to exec 1d r2c fft" << endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d r2c fft"); } cufftDestroy(plan); @@ -793,13 +794,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_C2R, iProjectionCount); if(result != CUFFT_SUCCESS) { - cerr << "Failed to plan 1d c2r fft" << endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d c2r fft"); } result = cufftExecC2R(plan, pDevFourProj, pfDevInFourProj); if(result != CUFFT_SUCCESS) { - cerr << "Failed to exec 1d c2r fft" << endl; + astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d c2r fft"); } cufftDestroy(plan); 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 #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)); } diff --git a/cuda/3d/util3d.cu b/cuda/3d/util3d.cu index d85a928..f2d16b3 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::CLogger::error(__FILE__,__LINE__,"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::CLogger::error(__FILE__,__LINE__,"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::CLogger::error(__FILE__,__LINE__,"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::CLogger::error(__FILE__,__LINE__,"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::CLogger::error(__FILE__,__LINE__,"Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); return false; } -- cgit v1.2.3 From c5507b6ef2abfab169150528a374526bb348bf62 Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 13 Mar 2015 12:18:21 +0100 Subject: Adds ASTRA_*** defines for easier logging, and changes internal calls to these defines --- cuda/2d/astra.cu | 2 +- cuda/2d/fft.cu | 24 ++++++++++++------------ cuda/2d/util.cu | 6 +++--- cuda/3d/util3d.cu | 10 +++++----- 4 files changed, 21 insertions(+), 21 deletions(-) (limited to 'cuda') diff --git a/cuda/2d/astra.cu b/cuda/2d/astra.cu index 71fd089..2f72db0 100644 --- a/cuda/2d/astra.cu +++ b/cuda/2d/astra.cu @@ -564,7 +564,7 @@ bool AstraFBP::setFilter(E_FBPFILTER _eFilter, const float * _pfHostFilter /* = } default: { - astra::CLogger::error(__FILE__,__LINE__,"AstraFBP::setFilter: Unknown filter type requested"); + ASTRA_ERROR("AstraFBP::setFilter: Unknown filter type requested"); delete [] pHostFilter; return false; } diff --git a/cuda/2d/fft.cu b/cuda/2d/fft.cu index 468c7c2..49c696c 100644 --- a/cuda/2d/fft.cu +++ b/cuda/2d/fft.cu @@ -43,7 +43,7 @@ using namespace astra; #define CHECK_ERROR(errorMessage) do { \ cudaError_t err = cudaThreadSynchronize(); \ if( cudaSuccess != err) { \ - astra::CLogger::error(__FILE__,__LINE__,"Cuda error %s : %s", \ + ASTRA_ERROR("Cuda error %s : %s", \ errorMessage,cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) @@ -51,13 +51,13 @@ using namespace astra; #define SAFE_CALL( call) do { \ cudaError err = call; \ if( cudaSuccess != err) { \ - astra::CLogger::error(__FILE__,__LINE__,"Cuda error: %s ", \ + ASTRA_ERROR("Cuda error: %s ", \ cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } \ err = cudaThreadSynchronize(); \ if( cudaSuccess != err) { \ - astra::CLogger::error(__FILE__,__LINE__,"Cuda error: %s : ", \ + ASTRA_ERROR("Cuda error: %s : ", \ cudaGetErrorString( err)); \ exit(EXIT_FAILURE); \ } } while (0) @@ -137,7 +137,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_R2C, _iProjectionCount); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d r2c fft"); + ASTRA_ERROR("Failed to plan 1d r2c fft"); return false; } @@ -146,7 +146,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d r2c fft"); + ASTRA_ERROR("Failed to exec 1d r2c fft"); return false; } @@ -163,7 +163,7 @@ static bool invokeCudaIFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_C2R, _iProjectionCount); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d c2r fft"); + ASTRA_ERROR("Failed to plan 1d c2r fft"); return false; } @@ -174,7 +174,7 @@ static bool invokeCudaIFFT(int _iProjectionCount, int _iDetectorCount, if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d c2r fft"); + ASTRA_ERROR("Failed to exec 1d c2r fft"); return false; } @@ -630,7 +630,7 @@ void genFilter(E_FBPFILTER _eFilter, float _fD, int _iProjectionCount, } default: { - astra::CLogger::error(__FILE__,__LINE__,"Cannot serve requested filter"); + ASTRA_ERROR("Cannot serve requested filter"); } } @@ -764,13 +764,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_R2C, iProjectionCount); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d r2c fft"); + ASTRA_ERROR("Failed to plan 1d r2c fft"); } result = cufftExecR2C(plan, pfDevProj, pDevFourProj); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d r2c fft"); + ASTRA_ERROR("Failed to exec 1d r2c fft"); } cufftDestroy(plan); @@ -794,13 +794,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_C2R, iProjectionCount); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to plan 1d c2r fft"); + ASTRA_ERROR("Failed to plan 1d c2r fft"); } result = cufftExecC2R(plan, pDevFourProj, pfDevInFourProj); if(result != CUFFT_SUCCESS) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to exec 1d c2r fft"); + ASTRA_ERROR("Failed to exec 1d c2r fft"); } cufftDestroy(plan); diff --git a/cuda/2d/util.cu b/cuda/2d/util.cu index 6ced557..a4f8f3e 100644 --- a/cuda/2d/util.cu +++ b/cuda/2d/util.cu @@ -93,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); - astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%d GPU buffer", width, height); + ASTRA_ERROR("Failed to allocate %dx%d GPU buffer", width, height); return false; } @@ -261,7 +261,7 @@ bool cudaTextForceKernelsCompletion() cudaError_t returnedCudaError = cudaThreadSynchronize(); if(returnedCudaError != cudaSuccess) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); + ASTRA_ERROR("Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); return false; } @@ -271,7 +271,7 @@ bool cudaTextForceKernelsCompletion() void reportCudaError(cudaError_t err) { if(err != cudaSuccess) - astra::CLogger::error(__FILE__,__LINE__,"CUDA error %d: %s.", err, cudaGetErrorString(err)); + ASTRA_ERROR("CUDA error %d: %s.", err, cudaGetErrorString(err)); } diff --git a/cuda/3d/util3d.cu b/cuda/3d/util3d.cu index f2d16b3..537ed69 100644 --- a/cuda/3d/util3d.cu +++ b/cuda/3d/util3d.cu @@ -48,7 +48,7 @@ cudaPitchedPtr allocateVolumeData(const SDimensions3D& dims) cudaError err = cudaMalloc3D(&volData, extentV); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU buffer", 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? } @@ -67,7 +67,7 @@ cudaPitchedPtr allocateProjectionData(const SDimensions3D& dims) cudaError err = cudaMalloc3D(&projData, extentP); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU buffer", 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? } @@ -305,7 +305,7 @@ cudaArray* allocateVolumeArray(const SDimensions3D& dims) cudaError err = cudaMalloc3DArray(&cuArray, &channelDesc, extentA); if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU array", dims.iVolX, dims.iVolY, dims.iVolZ); + ASTRA_ERROR("Failed to allocate %dx%dx%d GPU array", dims.iVolX, dims.iVolY, dims.iVolZ); return 0; } @@ -323,7 +323,7 @@ cudaArray* allocateProjectionArray(const SDimensions3D& dims) if (err != cudaSuccess) { astraCUDA::reportCudaError(err); - astra::CLogger::error(__FILE__,__LINE__,"Failed to allocate %dx%dx%d GPU array", dims.iProjU, dims.iProjAngles, dims.iProjV); + ASTRA_ERROR("Failed to allocate %dx%dx%d GPU array", dims.iProjU, dims.iProjAngles, dims.iProjV); return 0; } @@ -399,7 +399,7 @@ bool cudaTextForceKernelsCompletion() cudaError_t returnedCudaError = cudaThreadSynchronize(); if(returnedCudaError != cudaSuccess) { - astra::CLogger::error(__FILE__,__LINE__,"Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); + ASTRA_ERROR("Failed to force completion of cuda kernels: %d: %s.", returnedCudaError, cudaGetErrorString(returnedCudaError)); return false; } -- cgit v1.2.3 From 10d35e96221675fc62299ba0cfdb0d731c9c7531 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 20 Mar 2015 14:03:44 +0100 Subject: Fix indentation --- cuda/2d/fft.cu | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'cuda') diff --git a/cuda/2d/fft.cu b/cuda/2d/fft.cu index 49c696c..2bfd493 100644 --- a/cuda/2d/fft.cu +++ b/cuda/2d/fft.cu @@ -137,7 +137,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_R2C, _iProjectionCount); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to plan 1d r2c fft"); + ASTRA_ERROR("Failed to plan 1d r2c fft"); return false; } @@ -146,7 +146,7 @@ static bool invokeCudaFFT(int _iProjectionCount, int _iDetectorCount, if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to exec 1d r2c fft"); + ASTRA_ERROR("Failed to exec 1d r2c fft"); return false; } @@ -163,18 +163,18 @@ static bool invokeCudaIFFT(int _iProjectionCount, int _iDetectorCount, result = cufftPlan1d(&plan, _iDetectorCount, CUFFT_C2R, _iProjectionCount); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to plan 1d c2r fft"); + ASTRA_ERROR("Failed to plan 1d c2r fft"); return false; } // todo: why do we have to get rid of the const qualifier? result = cufftExecC2R(plan, (cufftComplex *)_pDevSourceComplex, - (cufftReal *)_pfDevTarget); + (cufftReal *)_pfDevTarget); cufftDestroy(plan); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to exec 1d c2r fft"); + ASTRA_ERROR("Failed to exec 1d c2r fft"); return false; } @@ -254,7 +254,7 @@ bool runCudaIFFT(int _iProjectionCount, const cufftComplex* _pDevSourceComplex, } rescaleInverseFourier(_iProjectionCount, _iFFTRealDetectorCount, - pfDevRealFFTTarget); + pfDevRealFFTTarget); SAFE_CALL(cudaMemset(_pfRealTarget, 0, sizeof(float) * _iProjectionCount * _iTargetPitch)); @@ -630,7 +630,7 @@ void genFilter(E_FBPFILTER _eFilter, float _fD, int _iProjectionCount, } default: { - ASTRA_ERROR("Cannot serve requested filter"); + ASTRA_ERROR("Cannot serve requested filter"); } } @@ -764,13 +764,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_R2C, iProjectionCount); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to plan 1d r2c fft"); + ASTRA_ERROR("Failed to plan 1d r2c fft"); } result = cufftExecR2C(plan, pfDevProj, pDevFourProj); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to exec 1d r2c fft"); + ASTRA_ERROR("Failed to exec 1d r2c fft"); } cufftDestroy(plan); @@ -794,13 +794,13 @@ void testCudaFFT() result = cufftPlan1d(&plan, iDetectorCount, CUFFT_C2R, iProjectionCount); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to plan 1d c2r fft"); + ASTRA_ERROR("Failed to plan 1d c2r fft"); } result = cufftExecC2R(plan, pDevFourProj, pfDevInFourProj); if(result != CUFFT_SUCCESS) { - ASTRA_ERROR("Failed to exec 1d c2r fft"); + ASTRA_ERROR("Failed to exec 1d c2r fft"); } cufftDestroy(plan); -- cgit v1.2.3