Visible to Intel only — GUID: GUID-0B5B3589-8FF2-4C08-AEAF-4C93E3CE08F4
Visible to Intel only — GUID: GUID-0B5B3589-8FF2-4C08-AEAF-4C93E3CE08F4
ATTRIBUTES OPTIMIZATION_PARAMETER
The ATTRIBUTES directive option OPTIMIZATION_PARAMETER passes certain information about a procedure or main program to the optimizer.
Syntax
!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 |
Description
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
Example
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 macOS, 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.