From 0d358fb1b78dd848bfa7d401c387abc4191edc14 Mon Sep 17 00:00:00 2001 From: TomasKulhanek Date: Fri, 7 Dec 2018 01:02:23 +0000 Subject: return insteadd of exit --- Core/regularisers_GPU/dTV_FGP_GPU_core.cu | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Core/regularisers_GPU/dTV_FGP_GPU_core.cu b/Core/regularisers_GPU/dTV_FGP_GPU_core.cu index 6040648..e2c6ecf 100644 --- a/Core/regularisers_GPU/dTV_FGP_GPU_core.cu +++ b/Core/regularisers_GPU/dTV_FGP_GPU_core.cu @@ -46,7 +46,18 @@ limitations under the License. // This will output the proper CUDA error strings in the event that a CUDA host call returns an error -#define checkCudaErrors(err) __checkCudaErrors (err, __FILE__, __LINE__) +#define checkCudaErrors(call) \ +{ \ + const cudaError_t error = call; \ + if (error != cudaSuccess) \ + { \ + fprintf(stderr, "Error: %s:%d, ", __FILE__, __LINE__); \ + fprintf(stderr, "code: %d, reason: %s\n", error, \ + cudaGetErrorString(error)); \ + return; \ + } \ +} +/*#define checkCudaErrors(err) __checkCudaErrors (err, __FILE__, __LINE__) inline void __checkCudaErrors(cudaError err, const char *file, const int line) { @@ -57,7 +68,7 @@ inline void __checkCudaErrors(cudaError err, const char *file, const int line) return; } } - +*/ #define BLKXSIZE2D 16 #define BLKYSIZE2D 16 -- cgit v1.2.3