Introduction to Auto-vectorization

For the Intel® Fortran Compiler, vectorization is the unrolling of a loop combined with the generation of packed SIMD instructions. Because the packed instructions operate on more than one data element at a time, the loop can execute more efficiently. It is sometimes referred to as auto-vectorization to emphasize that the compiler automatically identifies and optimizes suitable loops on its own.

Using the -vec (Linux* OS) or the /Qvec (Windows* OS) option enables vectorization at default optimization levels for both Intel® microprocessors and non-Intel microprocessors. Vectorization may call library routines that can result in additional performance gain on Intel microprocessors than on non-Intel microprocessors. The vectorization can also be affected by certain options, such as /arch or /Qx (Windows) or -m or -x (Linux and Mac OS X).

Vectorization is enabled with the Intel Fortran Compiler at optimization levels of -O2 and higher. Many loops are vectorized automatically, but in cases where this doesn't happen, you may be able to vectorize loops by making simple code modifications. In this tutorial, you will:

Locating the Samples

To begin this tutorial, locate the source files in the product's Samples directory:
<install-dir>/Samples/<locale>/Fortran/vec_samples/

Use these files for this tutorial:

Next: Establishing a Performance Baseline


Submit feedback on this help topic

Copyright © 2011, Intel Corporation. All rights reserved.