Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

A new mode for setting denormals to zero

Gennady_F_Intel
Moderator
354 Views

Intel MKL VML accuracy setting mode variable is extended with a new setting from Intel MKL 10.3 beta onwards.

Users can turn ON or OFF this settingby using VML_FTZDAZ_ON / VML_FTZDAZ_OFF (default) in VML functions.

VML_FTZDAZ_ON mode improves performance of computations that involve denormalized numbers at the cost of reasonable accuracy loss.

Enabling this mode changes numerical behavior of the functions: denormalized input values may be treated as zeros and denormalized results may flush to zero. Accuracy loss may occur if input and/or output values are close to denormal range.

Usage example:

vmlSetMode( VML_LA | VML_FTZDAZ_ON)

or

vmdExp(1000, a, r, VML_LA | VML_FTZDAZ_ON);

These new functions can allows using VML functions with different accuracy at the same time.

Checkhereto register for MKL 10.3 Beta, and provide us the feedback via the forum.

0 Kudos
1 Reply
barragan_villanueva_
Valued Contributor I
355 Views
There are other ways in case of using Intel compilers

1) use option -ftz to compile main() program

2) use special intrinsics on Intel compiler. Eg. in C/C++

#if defined(__INTEL_COMPILER)
// for flush to zero
#include
#endif

#if defined(__INTEL_COMPILER)
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
#endif

See also MKL User Guide: Managing Performance | Operating on Denormals
0 Kudos
Reply