#include <ostream>
#ifdef DEAL_II_WITH_CUDA
+#include <cusolverSp.h>
#include <cusparse.h>
#endif
* function but there is no equivalent function for cuSPARSE.
*/
std::string get_cusparse_error_string(const cusparseStatus_t error_code);
+
+ /**
+ * Return a string given an error code. This is similar to the cudaGetErrorString
+ * function but there is no equivalent function for cuSOLVER.
+ */
+ std::string get_cusolver_error_string(const cusolverStatus_t error_code);
#endif
} /*namespace internals*/
#define AssertCusparse(error_code) { (void) (error_code); }
#endif
+#ifdef DEBUG
+#define AssertCusolver(error_code) Assert(error_code == CUSOLVER_STATUS_SUCCESS, \
+ dealii::ExcCusparseError( \
+ dealii::deal_II_exceptions::internals:: \
+ get_cusolver_error_string(error_code)))
+#else
+#define AssertCusolver(error_code) { (void) (error_code); }
+#endif
+
#endif
using namespace StandardExceptions;
}
}
}
+
+
+
+ std::string get_cusolver_error_string(cusolverStatus_t error_code)
+ {
+ std::string message;
+ switch (error_code)
+ {
+ case CUSOLVER_STATUS_NOT_INITIALIZED:
+ {
+ return "The cuSolver library was not initialized";
+ }
+ case CUSOLVER_STATUS_ALLOC_FAILED:
+ {
+ return "Resource allocation failed inside the cuSolver library";
+ }
+ case CUSOLVER_STATUS_INVALID_VALUE:
+ {
+ return "An unsupported value of a parameter was passed to the function";
+ }
+ case CUSOLVER_STATUS_ARCH_MISMATCH:
+ {
+ return "The function requires a feature absent from the device architecture";
+ }
+ case CUSOLVER_STATUS_EXECUTION_FAILED:
+ {
+ return "The GPU program failed to execute";
+ }
+ case CUSOLVER_STATUS_INTERNAL_ERROR:
+ {
+ return "An internal cuSolver operation failed";
+ }
+ case CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED:
+ {
+ return "The matrix type is not supported by this function";
+ }
+ default:
+ {
+ return "Unknown error";
+ }
+ }
+ }
#endif
} /*namespace internals*/