diff options
Diffstat (limited to 'cuda')
-rw-r--r-- | cuda/2d/util.cu | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cuda/2d/util.cu b/cuda/2d/util.cu index 2a47472..ce652cb 100644 --- a/cuda/2d/util.cu +++ b/cuda/2d/util.cu @@ -274,5 +274,14 @@ void reportCudaError(cudaError_t err) ASTRA_ERROR("CUDA error %d: %s.", err, cudaGetErrorString(err)); } +bool checkCuda(cudaError_t err, const char *msg) +{ + if (err != cudaSuccess) { + ASTRA_ERROR("%s: CUDA error %d: %s.", msg, err, cudaGetErrorString(err)); + return false; + } else { + return true; + } +} } |