]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add Nothrow variants to CUDA and CUSPARSE assert
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 18 Aug 2018 21:29:40 +0000 (23:29 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 19 Aug 2018 22:53:29 +0000 (00:53 +0200)
include/deal.II/base/exceptions.h

index 0c20aacc573b37127463ec42131709385725828d..7c0369f33f1b0638541f6e681f4b77736b8ef8fc 100644 (file)
@@ -1466,6 +1466,23 @@ namespace internal
       }
 #  endif
 
+/**
+ * The non-throwing equivalent of AssertCuda.
+ *
+ * @ingroup Exceptions
+ * @author Daniel Arndt, 2018
+ */
+#  ifdef DEBUG
+#    define AssertNothrowCuda(error_code)      \
+      AssertNothrow(error_code == cudaSuccess, \
+                    dealii::ExcCudaError(cudaGetErrorString(error_code)))
+#  else
+#    define AssertNothrowCuda(error_code) \
+      {                                   \
+        (void)(error_code);               \
+      }
+#  endif
+
 /**
  * An assertion that checks that the error code produced by calling a cuSPARSE
  * routine is equal to CUSPARSE_STATUS_SUCCESS.
@@ -1487,6 +1504,33 @@ namespace internal
       }
 #  endif
 
+/**
+ * The non-throwing equivalent of AssertCusparse.
+ *
+ * @ingroup Exceptions
+ * @author Daniel Arndt, 2018
+ */
+#  ifdef DEBUG
+#    define AssertNothrowCusparse(error_code)                               \
+      AssertNothrow(                                                        \
+        error_code == CUSPARSE_STATUS_SUCCESS,                              \
+        dealii::ExcCusparseError(                                           \
+          dealii::deal_II_exceptions::internals::get_cusparse_error_string( \
+            error_code)))
+#  else
+#    define AssertNothrowCusparse(error_code) \
+      {                                       \
+        (void)(error_code);                   \
+      }
+#  endif
+
+/**
+ * An assertion that checks that the error code produced by calling a cuSOLVER
+ * routine is equal to CUSOLVER_STATUS_SUCCESS.
+ *
+ * @ingroup Exceptions
+ * @author Bruno Turcksin, 2018
+ */
 #  ifdef DEBUG
 #    define AssertCusolver(error_code)                                      \
       Assert(                                                               \

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.