HP MLIB User's Guide Vol. 2 7th Ed.
Chapter 12 VMATH 803
Set and get the mode for VMATH functions vmlSetMode, vmlGetMode
Name vmlSetMode, vmlGetMode
Set and get the mode for VMATH functions
Purpose vmlSetMode sets the new mode for VMATH functions according to the mode
parameter and returns the mode in effect at the time of the call.
vmlGetMode returns the current VMATH mode (as does vmlSetMode).
The mode for the VMATH library comprises an accuracy mode, an error mode,
and an FPU mode.
The accuracy mode is specified by one of the macros:
The error mode is specified by one of the macros:
The FPU mode has no effect in VMATH. However, for user source compatibility
with Intel’s MKL vector math library, an FPU mode can be specified by one of
the macros:
VML_FLOAT_CONSISTENT
VML_DOUBLE_CONSISTENT
VML_RESTORE
The mode parameter for vmlSetMode is interpreted as a bitwise of OR one or
more of an accuracy mode macro, and error mode macro, and an FPU mode
macro. If an accuracy mode, error mode, or FPU mode is not represented in the
mode parameter, then that mode is unchanged by the call.
For example, the following saves the current mode, installs the modes for lower
accuracy and ignoring errors, while leaving the FPU mode unchanged, and
then restores the saved mode:
savemode = vmlSetMode(VML_LA | VML_ERRMODE_IGNORE);
VML_HA Higher accuracy versions of VMATH functions
are used (default)
VML_LA Lower accuracy versions of VMATH functions
may be used to increase throughput
VML_ERRMODE_EXCEPT Floating-point exceptions, in the style of the
IEEE 754 and C99 standards, are signaled
VML_ERRMODE_IGNORE No error reporting is in effect
VML_ERRMODE_DEFAULT Floating-point exceptions are raised