Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 3/22/2024
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

  • 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.

See Also