These samples illustrate loops that can and cannot vectorize and explain how to use the vectorization report diagnostics.
See Included Samples for other samples included with the compiler.
Source |
Locations | ||||
---|---|---|---|---|---|
vec_sample novec_sample |
|
These samples are not meant to generate executable binaries. Instead, the samples are designed to illustrate loops the compiler will or will not vectorize.
You must include the -c (Linux and Mac OS) or /c (Windows) option when compiling the sample. This sample will not generate an valid executable.
Platform |
Commands |
---|---|
Linux and Mac OS |
ifort -c -xPT -vec-report3 vec_sample.f90 |
Windows |
ifort /c /QxPT /Qvec-report:3 vec_sample.f90 |
Because the compilation commands shown above includes the -vec-report (Linux and Mac OS) or /Qvec-report (Windows) option the compiler generates status message about the vectorization process. The following sample output shows typical vectorization diagnostics messages.
Sample Vectorization Messages |
---|
vec_sample.f90(101): (col. 3) remark: LOOP WAS VECTORIZED. vec_sample.f90(89): (col. 3) remark: LOOP WAS VECTORIZED. vec_sample.f90(71): (col. 3) remark: LOOP WAS VECTORIZED. vec_sample.f90(56): (col. 3) remark: loop was not vectorized: not inner loop. vec_sample.f90(57): (col. 5) remark: loop was not vectorized: not inner loop. vec_sample.f90(59): (col. 7) remark: LOOP WAS VECTORIZED. vec_sample.f90(45): (col. 3) remark: LOOP WAS VECTORIZED. vec_sample.f90(35): (col. 3) remark: LOOP WAS VECTORIZED. |
You must include the -c (Linux and Mac OS) or /c (Windows) when compiling the sample. This sample will not generate a valid executable.
Platform |
Commands |
---|---|
Linux and Mac OS |
ifort -c -xPT -vec-report3 novec_sample.f90 |
Windows |
ifort /c /QxPT /Qvec-report:3 novec_sample.f90 |
The following sample output shows typical vectorization diagnostics messages.
Sample Vectorization Messages |
---|
novec_sample.f90(44): (col. 3) remark: loop was not vectorized: vectorization possible but seems inefficient. novec_sample.f90(34): (col. 3) remark: loop was not vectorized: existence of vector dependence. novec_sample.f90(35): (col. 5) remark: vector dependence: proven FLOW dependence between y line 35, and y line 35. |