![]() |
MAGMA 2.9.0
Matrix Algebra for GPU and Multicore Architectures
|
Macros | |
#define | check_error(err) |
Checks if err is not success, and prints an error message. | |
#define | check_xerror(err, func, file, line) |
Checks if err is not success, and prints an error message. | |
#define | CHECK(err) |
Macro checks the return code of a function; if non-zero, sets info to err, then does goto cleanup. | |
#define | CHECK_CUSPARSE(err) |
Macro checks the return code of a cusparse function; if non-zero, maps the cusparse error to a magma error and sets info, then does goto cleanup. | |
Functions | |
const char * | magma_cublasGetErrorString (cublasStatus_t err) |
void | magma_xerror (cudaError_t err, const char *func, const char *file, int line) |
Prints error message to stderr. | |
void | magma_xerror (cublasStatus_t err, const char *func, const char *file, int line) |
void | magma_xerror (magma_int_t err, const char *func, const char *file, int line) |
magma_int_t | cusparse2magma_error (cusparseStatus_t status) |
Maps a cuSPARSE error to a MAGMA error. | |
#define check_error | ( | err | ) |
Checks if err is not success, and prints an error message.
Similar to assert(), if NDEBUG is defined, this does nothing. This version adds the current func, file, and line to the error message.
[in] | err | Error code. |
#define check_xerror | ( | err, | |
func, | |||
file, | |||
line ) |
Checks if err is not success, and prints an error message.
Similar to assert(), if NDEBUG is defined, this does nothing. This version takes func, file, and line as arguments to add to error message.
[in] | err | Error code. |
[in] | func | Function where error occurred. |
[in] | file | File where error occurred. |
[in] | line | Line where error occurred. |
#define CHECK | ( | err | ) |
Macro checks the return code of a function; if non-zero, sets info to err, then does goto cleanup.
err is evaluated only once. Assumes variable info and label cleanup exist. Usually, all paths (successful and error) exit through the cleanup code. Example:
magma_int_t function() { magma_int_t info = 0; double *A=NULL, *B=NULL; CHECK( magma_malloc( &A, sizeA )); CHECK( magma_malloc( &B, sizeB )); ... cleanup: magma_free( A ); magma_free( B ); return info; }
#define CHECK_CUSPARSE | ( | err | ) |
Macro checks the return code of a cusparse function; if non-zero, maps the cusparse error to a magma error and sets info, then does goto cleanup.
const char * magma_cublasGetErrorString | ( | cublasStatus_t | err | ) |
[in] | err | Error code. |
void magma_xerror | ( | cudaError_t | err, |
const char * | func, | ||
const char * | file, | ||
int | line ) |
Prints error message to stderr.
C++ function overloaded for different error types (CUDA, cuBLAS, MAGMA errors). Note CUDA and cuBLAS errors are enums, so can be differentiated. Used by the check_error() and check_xerror() macros.
[in] | err | Error code. |
[in] | func | Function where error occurred; inserted by check_error(). |
[in] | file | File where error occurred; inserted by check_error(). |
[in] | line | Line where error occurred; inserted by check_error(). |
void magma_xerror | ( | cublasStatus_t | err, |
const char * | func, | ||
const char * | file, | ||
int | line ) |
void magma_xerror | ( | magma_int_t | err, |
const char * | func, | ||
const char * | file, | ||
int | line ) |
magma_int_t cusparse2magma_error | ( | cusparseStatus_t | status | ) |
Maps a cuSPARSE error to a MAGMA error.
[in] | status | cuSPARSE error |