Enable Platform-Appropriate Vectorization

At this point in the Tutorial, you enable the use of vector registers appropriate for the platform and check vectorization efficiency.

Note

Enable Full Vectorization

To enable the use of a vector instruction set appropriate for the platform, one possible way is to instruct the compiler to use the same vector extension as the best one available in the processor performing the compilation.

Follow these steps to enable platform-appropriate vectorization:

  1. Open the Makefile located in ../matrix/linux with a text editor.

  2. Change line 43 from:

    OPTFLAGS = 

    To:

    OPTFLAGS = -xHost

    This option instructs the compiler to use the best instruction set extension that the processor performing the compilation supports.

  3. Save and close the Makefile and recompile the application using command:

    make icc

Check Vectorization with Performance Snapshot

Run the Performance Snapshot analysis to ensure that the application is properly vectorized.

Once the application exits, Intel® VTune™ Profiler opens the Performance Snapshot Summary window.

Observe these main indicators:

Next step: Analyze Microarchitecture Usage.