Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of 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. See Table "Values of the VM Error Status" 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. See Table "Values of the VM Error Status" for details.

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.

See Also