Intel® Fortran Compiler 17.0 Developer Guide and Reference
The ATTRIBUTES directive option OPTIMIZATION_PARAMETER passes certain information about a procedure or main program to the optimizer.
!DIR$ ATTRIBUTES OPTIMIZATION_PARAMETER: string::{ procedure-name | named-main-program}
string |
Is a character constant that is passed to the optimizer. The constant must be delimited by apostrophes or quotation marks, and it may have one of the following values:
|
procedure-name |
Is the name of a procedure. |
named-main-program |
Is the name of a main program |
The characters in string can appear in any combination of uppercase and lowercase. The following rules also apply to string:
If string does not contain an equal sign (=), then the entire value of string is converted to lowercase before being passed to the optimizer.
If string contains an equal sign, then all characters to the left of the equal sign are converted to lowercase before all of string is passed to the optimizer.
Characters to the right of the equal sign are not converted to lowercase since their value may be case sensitive to the optimizer, for example “target_arch=AVX”.
You can specify multiple ATTRIBUTES OPTIMIZATION_PARAMETER directives for one procedure or one main program.
For the named procedure or main program, the values specified for ATTRIBUTES OPTIMIZATION_PARAMETER override any settings specified for the following compiler options:
[Q]x, -m, and /arch
[Q]inline-max-per-routine
[Q]inline-max-total-size
Consider the two attributes optimization_parameter directives in the following code:
function f (x)
!dir$ attributes optimization_parameter: “inline_max_per_routine=10” :: f
!dir$ attributes optimization_parameter: “inline_max_total_size=2000” :: f
real :: f, x
…
The two directives have the same effect as if the function F had been complied with "/Qinline-max-per-routine:10 /Qinline-max-total-size:2000" on Windows* or with "-inline-max-per-routine=10 -inline-max-total-size=2000" on Linux* or OS X*, that is, inlining will not increase the size of F by more than 2000 and the inliner will not inline routines into F more than 10 times.