Developer Guide and Reference

  • 2021.2
  • 04/07/2021
  • Public Content
  • Download as PDF
Contents

fimf-use-svml, Qimf-use-svml

Instructs the compiler to use the Short Vector Math Library (SVML) rather than the Intel® Math Library (LIBM) to implement math library functions.
This content is specific to C++; it does not apply to
DPC++
.

Syntax

Linux:
-fimf-use-svml
=
value
[
:
funclist
]
Windows:
/Qimf-use-svml
:
value
[
:
funclist
]
Arguments
funclist
Is an optional list of one or more math library functions to which the attribute should be applied. If you specify more than one function, they must be separated with commas.
Precision-specific variants like sin and sinf are considered different functions, so you would need to use
-fimf-use-svmlt=true:sin,sinf
(or
/Qimf-use-svml:true:sin,sinf
) to specify that both the single-precision and double-precision sine functions should use SVML.
Default
false
Math library functions are implemented using the Intel® Math Library, though other compiler options may give the compiler the flexibility to implement math library functions with either LIBM or SVML.
Description
This option instructs the compiler to implement math library functions using the Short Vector Math Library (SVML). When you specify
-fimf-use-svml=true
or
/Qimf-use-svml:true
, the specific SVML variant chosen is influenced by other compiler options such as
-fimf-precision
(Linux*) or
/Qimf-precision
(Windows*) and
-fp-model
(Linux) or
/fp
(Windows). This option has no effect on math library functions that are implemented in LIBM but not in SVML.
In value-safe settings of option
-fp-model
(Linux) or option
/fp
(Windows) such as precise, this option causes a slight decrease in the accuracy of math library functions, because even the high accuracy SVML functions are slightly less accurate than the corresponding functions in LIBM. Additionally, the SVML functions might not accurately raise floating-point exceptions, do not maintain errno, and are designed to work correctly only in round-to-nearest-even rounding mode.
The benefit of using
-fimf-use-svml=true
or
/Qimf-use-svml:true
with value-safe settings of
-fp-model
(Linux) or /fp (Windows) is that it can significantly improve performance by enabling the compiler to efficiently vectorize loops containing calls to math library functions.
If you need to use SVML for a specific math function of a certain precision, specify the function name of the precision that you need. For example, if you want double precision, you can specify :sin; if you want single precision, you can specify :sqrtf, as in
-fimf-use-svml=true:sin
or
/Qimf-use-svml:true:sin
, or
-fimf-use-svml =false:sqrtf
or
/Qimf-use-svml:false:sqrt
f.
If you do not specify any function names, then the setting applies to all functions (and to all precisions). However, as soon as you specify an individual function name, the setting applies only to the function of corresponding precision. So, for example, sinf applies only to the single-precision sine function, sin applies only to the double-precision sine function, sinl applies only to the extended-precision sine function, etc.
Since SVML functions may raise unexpected floating-point exceptions, be cautious about using features that enable trapping on floating-point exceptions.
Product and Performance Information
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.
Notice revision #20201201
IDE Equivalent
None
Alternate Options
None

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.