Error Handling#
2026-03-13
4 min read time
Exceptions#
#include <raft/core/error.hpp>
namespace raft
-
struct cublas_error : public raft::exception#
- #include <cublas_macros.hpp>
Exception thrown when a cuBLAS error is encountered.
-
struct cusolver_error : public raft::exception#
- #include <cusolver_macros.hpp>
Exception thrown when a cuSOLVER error is encountered.
-
struct cusparse_error : public raft::exception#
- #include <cusparse_macros.hpp>
Exception thrown when a cuSparse error is encountered.
-
class exception : public std::exception#
- #include <error.hpp>
base exception class for the whole of raft
Subclassed by raft::cublas_error, raft::cuda_error, raft::cusolver_error, raft::cusparse_error, raft::cutlass_error, raft::interrupted_exception, raft::logic_error, raft::non_cuda_build_error
Assertion Macros#
#include <raft/core/error.hpp>
-
RAFT_CUSOLVER_TRY(call)#
Error checking macro for cuSOLVER runtime API functions.
Invokes a cuSOLVER runtime API function call, if the call does not return CUSolver_STATUS_SUCCESS, throws an exception detailing the cuSOLVER error that occurred
-
CUSOLVER_TRY(call)#
Error checking macro for cuSOLVER runtime API functions.
Invokes a cuSOLVER runtime API function call, if the call does not return CUSolver_STATUS_SUCCESS, throws an exception detailing the cuSOLVER error that occurred
-
RAFT_CUSOLVER_TRY_NO_THROW(call)#
Error checking macro for cuSOLVER runtime API functions.
Invokes a cuSOLVER runtime API function call, if the call does not return CUSolver_STATUS_SUCCESS, throws an exception detailing the cuSOLVER error that occurred
-
RAFT_CUSPARSE_TRY(call)#
Error checking macro for cuSparse runtime API functions.
Invokes a cuSparse runtime API function call, if the call does not return CUSPARSE_STATUS_SUCCESS, throws an exception detailing the cuSparse error that occurred
-
RAFT_CUSPARSE_TRY_NO_THROW(call)#
check for cusparse runtime API errors but do not assert
-
RAFT_CUBLAS_TRY(call)#
Error checking macro for cuBLAS runtime API functions.
Invokes a cuBLAS runtime API function call, if the call does not return CUBLAS_STATUS_SUCCESS, throws an exception detailing the cuBLAS error that occurred
-
CUBLAS_TRY(call)#
-
RAFT_CUBLAS_TRY_NO_THROW(call)#
-
RAFT_EXPECTS(cond, fmt, ...)#
Macro for checking (pre-)conditions that throws an exception when a condition is false.
- Parameters:
cond – [in] Expression that evaluates to true or false
fmt – [in] String literal description of the reason that cond is expected to be true with optional format tagas
- Throws raft::logic_error:
if the condition evaluates to false.
-
RAFT_FAIL(fmt, ...)#
Indicates that an erroneous code path has been taken.
- Parameters:
fmt – [in] String literal description of the reason that this code path is erroneous with optional format tagas
- Throws always:
throws raft::logic_error