From: Bruno Turcksin Date: Wed, 28 Mar 2018 20:24:04 +0000 (-0400) Subject: Fix warnings from AssertCuda and AssertCusparse X-Git-Tag: v9.0.0-rc1~266^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6111%2Fhead;p=dealii.git Fix warnings from AssertCuda and AssertCusparse --- 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;