]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix warnings from AssertCuda and AssertCusparse 6111/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Wed, 28 Mar 2018 20:24:04 +0000 (16:24 -0400)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Wed, 28 Mar 2018 20:51:23 +0000 (16:51 -0400)
include/deal.II/base/exceptions.h

index 2132351efa5a4c53a6da7ffb972cd61bb0d25313..9e8847304b0e806db111460da00986fd3642a9fb 100644 (file)
@@ -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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.