diff options
author | TomasKulhanek <tomas.kulhanek@stfc.ac.uk> | 2018-12-07 01:16:06 +0000 |
---|---|---|
committer | TomasKulhanek <tomas.kulhanek@stfc.ac.uk> | 2018-12-07 01:16:06 +0000 |
commit | 98fe4fbcf5ce35cff256b47da06da808e59ad4b0 (patch) | |
tree | e1ba5731cdca9876bd69d8dcde2eaeed71b6a5da | |
parent | 0d358fb1b78dd848bfa7d401c387abc4191edc14 (diff) | |
download | regularization-98fe4fbcf5ce35cff256b47da06da808e59ad4b0.tar.gz regularization-98fe4fbcf5ce35cff256b47da06da808e59ad4b0.tar.bz2 regularization-98fe4fbcf5ce35cff256b47da06da808e59ad4b0.tar.xz regularization-98fe4fbcf5ce35cff256b47da06da808e59ad4b0.zip |
tv return insteadd of exit
-rwxr-xr-x | Core/regularisers_GPU/TV_FGP_GPU_core.cu | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Core/regularisers_GPU/TV_FGP_GPU_core.cu b/Core/regularisers_GPU/TV_FGP_GPU_core.cu index 7466135..bde3afb 100755 --- a/Core/regularisers_GPU/TV_FGP_GPU_core.cu +++ b/Core/regularisers_GPU/TV_FGP_GPU_core.cu @@ -40,7 +40,19 @@ 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) { @@ -50,7 +62,7 @@ inline void __checkCudaErrors(cudaError err, const char *file, const int line) file, line, (int)err, cudaGetErrorString(err)); return; } -} +}*/ #define BLKXSIZE2D 16 #define BLKYSIZE2D 16 |