From 3eb12494c4fa5dd693e80d824ebe20f538aaf700 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 18 May 2015 23:20:18 -0500 Subject: [PATCH] removed CUDA dependence in colormap.h --- cuda/error.h | 44 ++++++++++++++++++++++---------------------- visualization/colormap.h | 2 ++ 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/cuda/error.h b/cuda/error.h index 77221a8..b49cf4b 100644 --- a/cuda/error.h +++ b/cuda/error.h @@ -1,24 +1,24 @@ #include #include -using namespace std; -#include "cuda_runtime.h" +using namespace std; +#include "cuda_runtime.h" #include "device_launch_parameters.h" -#include "cufft.h" - -#ifndef CUDA_HANDLE_ERROR_H -#define CUDA_HANDLE_ERROR_H - -//handle error macro -static void HandleError( cudaError_t err, const char *file, int line ) { - if (err != cudaSuccess) { - //FILE* outfile = fopen("cudaErrorLog.txt", "w"); - //fprintf(outfile, "%s in %s at line %d\n", cudaGetErrorString( err ), file, line ); - //fclose(outfile); - printf("%s in %s at line %d\n", cudaGetErrorString( err ), file, line ); - //exit( EXIT_FAILURE ); - - } -} +#include "cufft.h" + +#ifndef CUDA_HANDLE_ERROR_H +#define CUDA_HANDLE_ERROR_H + +//handle error macro +static void HandleError( cudaError_t err, const char *file, int line ) { + if (err != cudaSuccess) { + //FILE* outfile = fopen("cudaErrorLog.txt", "w"); + //fprintf(outfile, "%s in %s at line %d\n", cudaGetErrorString( err ), file, line ); + //fclose(outfile); + printf("%s in %s at line %d\n", cudaGetErrorString( err ), file, line ); + //exit( EXIT_FAILURE ); + + } +} #define HANDLE_ERROR( err ) (HandleError( err, __FILE__, __LINE__ )) static void CufftError( cufftResult err ) @@ -41,8 +41,8 @@ static void CufftError( cufftResult err ) cout<<"Unknown error: "< #include +#ifdef __CUDACC__ #include "../cuda/error.h" +#endif //saving an image to a file uses the CImg library //this currently throws a lot of "unreachable" warnings (as of GCC 4.8.2, nvcc 6.5.12) -- libgit2 0.21.4