Developer Reference

Contents

VM Error Diagnostics

The VM mathematical functions incorporate the error handling mechanism, which is controlled by the following service functions:
 
vmlGetErrStatus
,
vmlSetErrStatus
,
vmlClearErrStatus
These functions operate with a global variable called VM Error Status. The VM Error Status flags an error, a warning, or a successful execution of a VM function.
vmlGetErrCallBack
,
vmlSetErrCallBack
,
vmlClearErrCallBack
These functions enable you to customize the error handling. For example, you can identify a particular argument in a vector where an error occurred or that caused a warning.
vmlSetMode
,
vmlGetMode
These functions get and set a VM mode. If you set a new VM mode using the
vmlSetMode
function, you can store the previous VM mode returned by the routine and restore it at any point of your application.
If both an error and a warning situation occur during the function call, the VM Error Status variable keeps only the value of the error code. for possible values. If a VM function does not encounter errors or warnings, it sets the VM Error Status to
VML_STATUS_OK
.
If you use incorrect input arguments to a VM function (
VML_STATUS_BADSIZE
and
VML_STATUS_BADMEM
), the function calls
xerbla
to report errors. .
You can use the
vmlSetMode
and
vmlGetMode
functions to modify error handling behavior. Depending on the VM mode, the error handling behavior includes the following operations:
  • setting the VM Error Status to a value corresponding to the observed error or warning
  • setting the
    errno
    variable to one of the values described in Table
    "Set Values of the
    errno
    Variable"
  • writing error text information to the
    stderr
    stream
  • raising the appropriate exception on an error, if necessary
  • calling the additional error handler callback function that is set by
    vmlSetErrorCallBack
    .
Set Values of the
errno
Variable
Value of
errno
Description
0
No errors are detected.
EINVAL
The array dimension is not positive.
EACCES
NULL
pointer is passed.
EDOM
At least one of array values is out of a range of definition.
ERANGE
At least one of array values caused a singularity, overflow or underflow.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.