From e79a3c5b3de9485e860f26b6cf5cca2b39f6b45d Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Wed, 28 Mar 2018 16:24:04 -0400 Subject: [PATCH] Fix warnings from AssertCuda and AssertCusparse --- include/deal.II/base/exceptions.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index 2132351efa..9e8847304b 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -1278,8 +1278,12 @@ namespace internal * @ingroup Exceptions * @author Bruno Turcksin, 2016 */ +#ifdef DEBUG #define AssertCuda(error_code) Assert(error_code == cudaSuccess, \ dealii::ExcCudaError(cudaGetErrorString(error_code))) +#else +#define AssertCuda(error_code) { (void) (error_code); } +#endif /** * An assertion that checks that the error code produced by calling a cuSPARSE @@ -1288,10 +1292,15 @@ namespace internal * @ingroup Exceptions * @author Bruno Turcksin, 2018 */ +#ifdef DEBUG #define AssertCusparse(error_code) Assert(error_code == CUSPARSE_STATUS_SUCCESS, \ dealii::ExcCusparseError( \ dealii::deal_II_exceptions::internals:: \ get_cusparse_error_string(error_code))) +#else +#define AssertCusparse(error_code) { (void) (error_code); } +#endif + #endif using namespace StandardExceptions; -- 2.39.5