Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
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

fimf-use-svml, Qimf-use-svml

Instructs the compiler to use the Short Vector Math Library (SVML) rather than the Intel® Fortran Compiler Classic and Intel® Fortran Compiler Math Library (LIBM) to implement math library functions.

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. Do not specify the standard Fortran name of the math function; you must specify the actual math library name. 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® Fortran Compiler Classic and Intel® Fortran Compiler Math Library, though other compiler options such as -fast-transcendentals or /Qfast-transcendentals 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).

Linux

When you specify option -fimf-use-svml=true, the specific SVML variant chosen is influenced by other compiler options such as -fimf-precision and -fp-model.

Windows

When you specify option /Qimf-use-svml:true, the specific SVML variant chosen is influenced by other compiler options such as /Qimf-precision and /fp.

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:sqrtf.

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.

NOTE:

Linux

If you specify option -mia32, vector instructions cannot be used. Therefore, you cannot use option -mia32 with option -fimf-use-svml=true.

Windows

If you specify option /arch:IA32 (Windows*), vector instructions cannot be used. Therefore, you cannot use option /arch:IA32 with option /Qimf-use-svml:true.

NOTE:

Since SVML functions may raise unexpected floating-point exceptions, be cautious about using features that enable trapping on floating-point exceptions. For example, be cautious about specifying option -fimf-use-svml=true with option -fp-trap, or option /Qimf-use-svml:true with option /Qfp-trap. For some inputs to some math library functions, such option combinations may cause your program to trap unexpectedly.

NOTE:

The standard Fortran names for the various math intrinsic functions do not match the math library names of the math intrinsic functions. You must find the actual math library name that is generated for the relevant Fortran math intrinsic.

One way to do this is to generate assembly code by using one of the following options:

Linux

-S

Windows

/Fa or /S

The assembly code will show the actual math library name.

For example, if you create a program that contains a call to SIN(x) where x is declared as REAL(KIND=4) and then use option S to produce assembly code for the program, the assembly code will show a call to sinf.

To request the use of SVML for the single-precision sine function, you should specify:

Linux

-fimf-use-svml=true:sinf

Windows

/Qimf-use-svml:true:sinf

NOTE:

This option only applies to host compilation. When offloading is enabled, it does not impact device-specific compilation. Offloading can only be enabled when using ifx.

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

See Also