A vectorization report tells you whether the loops in your code were vectorized, and if not, explains why not.
Because vectorization is off at -O1, the compiler does not generate a vectorization report, so recompile at -O2 (default optimization):
ifort -real-size 64 -vec-report1 matvec.f90 driver.f90 -o MatVector
Record the new execution time. The reduction in time is mostly due to auto-vectorization of the inner loop at line 32 noted in the vectorization report:
matvec.f90(32) (col. 3): remark: LOOP WAS VECTORIZED. matvec.f90(38) (col. 6): remark: LOOP WAS VECTORIZED. driver.f90(59) (col. 5): remark: LOOP WAS VECTORIZED. driver.f90(61) (col. 5): remark: LOOP WAS VECTORIZED. driver.f90(80) (col. 29): remark: LOOP WAS VECTORIZED.
The -vec-report2 option returns a list that also includes loops that were not vectorized, along with the reason why the compiler did not vectorize them.
ifort -real-size 64 -vec-report2 matvec.f90 driver.f90 -o MatVector
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.
matvec.f90(32) (col. 3): remark: LOOP WAS VECTORIZED. matvec.f90(33) (col. 3): remark: loop was not vectorized: not inner loop. matvec.f90(38) (col. 6): remark: LOOP WAS VECTORIZED. driver.f90(59) (col. 5): remark: loop was not vectorized: not inner loop. driver.f90(59) (col. 5): remark: loop was not vectorized: vectorization possible but seems inefficient. driver.f90(59) (col. 5): remark: loop was not vectorized: not inner loop. driver.f90(59) (col. 5): remark: loop was not vectorized: subscript too complex. driver.f90(59) (col. 5): remark: loop was not vectorized: not inner loop. driver.f90(59) (col. 5): remark: LOOP WAS VECTORIZED. driver.f90(61) (col. 5): remark: loop was not vectorized: vectorization possible but seems inefficient. driver.f90(61) (col. 5): remark: LOOP WAS VECTORIZED. driver.f90(80) (col. 29): remark: LOOP WAS VECTORIZED. driver.f90(74) (col. 7): remark: loop was not vectorized: nonstandard loop is not a vectorization candidate.
For more information on the -vec-report compiler option, see the Compiler Options section in the Compiler User and Reference Guide.
Copyright © 2011, Intel Corporation. All rights reserved.