Generating a Vectorization Report
A vectorization report shows what loops in your code were vectorized and explains why other loops were not vectorized. To generate a vectorization report, use the Qopt-report and Qopt-report-phase:vec compiler options.
Together with Qopt-report-phase:vec, Qopt-report:1 generates a report with the loops in your code that were vectorized while Qopt-report:2 generates a report with both the loops in your code that were vectorized and the reason that other loops were not vectorized.
To use these options:
In your project's property pages select Configuration Properties > Fortran > Diagnostics.
For Optimization Diagnostics Level, select Level 1 (/Qopt-report:1).
For Optimization Diagnostics Phase, select Vectorization (/Qopt-report-phase:vec).
Because vectorization is turned off with the O1 option, the compiler does not generate a vectorization report. To generate a vectorization report, build your project with the O2 option:
To set the O2 option:
In your project's property pages select Configuration Properties > Fortran > Optimization .
For Optimization, select Maximize Speed.
For the purpose of showing the report, we'll also replace the call to matvec() in driver.f90 with the equivalent Fortran code by defining the preprocessor macro NOFUNCCALL. To do this, add NOFUNCCALL with a semicolon to the list of user defined macros at Project > Properties > Fortran > Preprocessor > Preprocessor Definitions.
Rebuild your project and then run the executable (Debug > Start Without Debugging). Record the new execution time. The reduction in time is mostly due to auto-vectorization of the inner loop at line 32 in matvec.f90 noted in the Compiler Optimization Report window, as well as in the *.optrpt files in the object directory.
For example, the following message appears in matvec.optrpt and driver.optrpt:
LOOP BEGIN at matvec.f90(26,3) matvec.f90(26,3):remark #15300: LOOP WAS VECTORIZED LOOP END
The Qopt-report:2 option returns a list that also includes loops that were not vectorized, along with the reason why the compiler did not vectorize them. Add the Qopt-report:2 option in the same way you added Qopt-report:1 above, instead selecting Level 2 (/Qopt-report:2).
Rebuild your project.
The vectorization report indicates that the loop at line 33 in matvec.f90 did not vectorize because it is not the innermost loop of the loop nest..
Your line and column numbers may be different.
For more information on the Qopt-report and Qopt-report-phase compiler options, see the Compiler Options section in the Compiler User and Reference Guide.
Did you find the information on this page useful?