The original Netlib BLAS defined an error handling function XERBLA,
which is called within BLAS2 and BLAS3 routines if an incorrect input
argument is detected. Only incorrect matrix, vector sizes, and
options for specifying transpose matrix, upper or lower in a
symmetric matrix, and so on can be detected. BLAS does not detect
extreme values (such as Inf or NaNs) within the supplied matrices and
vectors, it is the user’s responsibility to check for these if
required.
The functionality of Netlib’s XERBLA is to print a message to
standard output and stop execution of the process. Stopping is
extremely unhelpful in many applications and usage scenarios. Thus,
AOCL-BLAS, in common with other similar libraries, has traditionally
disabled the stop statement. In AOCL 4.2, the functionality of
AOCL-BLAS has been enhanced to give users more choice over both
stopping the application on error and printing a message on error.
In AOCL 5.0 this functionality was added to the similar cblas_xerbla
error handling function.
The choices are specified by setting each of the environment
variables BLIS_STOP_ON_ERROR and BLIS_PRINT_ON_ERROR to 0 or 1 to
respectively disable or enable the functionality. The default values
for each are:
Environment Variable |
Default Value |
|---|---|
|
0 |
|
1 |
When the stop on error is disabled, no error code is passed back to
the user application through the BLAS interface arguments, unlike the
INFO argument used in LAPACK routines. Therefore, AOCL-BLAS has also
added an extra function to return the value of INFO from the previous
call to a BLAS routine made by the same thread. The function can be
called as follows:
**In C/C++:**
#include <blis.h>
...
gint_t info_value = bli_info_get_info_value();
**In Fortran:**
integer :: info_value
integer, external :: bli_info_get_info_value
...
info_value = bli_info_get_info_value()
If the returned value is not zero, the value indicates the argument
in the preceding BLAS call that was incorrect.
Note
Errors from an incorrect setting of the BLIS_ARCH_TYPE
environment variable (used to override the default choice in dynamic
dispatch, refer to Using Dynamic Dispatch for
details) are handled by a separate error mechanism and will not be
affected by the environment variables BLIS_STOP_ON_ERROR and
BLIS_PRINT_ON_ERROR.