The VML 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 VML Error Status. The VML Error Status flags an error, a warning, or a successful execution of a VML 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 VML mode. If you set a new VML mode using the vmlSetMode function, you can store the previous VML 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 VML Error Status variable keeps only the value of the error code. See Table "Values of the VML Error Status" for possible values. If a VML function does not encounter errors or warnings, it sets the VML Error Status to VML_STATUS_OK.
If you use the Fortran interface, call the error reporting function XERBLA to receive information about correctness of input arguments (VML_STATUS_BADSIZE and VML_STATUS_BADMEM). See Table "Values of the VML Error Status" for details.
You can use the vmlSetMode and vmlGetMode functions to modify error handling behavoir. Depending on the VML mode, the error handling behavior includes the following operations:
setting the VML 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.
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. |
Copyright © 1994 - 2010, Intel Corporation. All rights reserved.