Enable Platform-Appropriate Vectorization

Enable the use of vector registers as appropriate for your platform. Then check to see if the vectorization efficiency improves.

You use the /QxHost option to compile the matrix application using the best instruction set extension that is supported by your processor. To generate multiple code paths that enable your software to run on several microarchitectures, refer to the ax, Qax option of the Intel® oneAPI DPC++/C++ Compiler.

Enable Full Vectorization

To enable the use of a vector instruction set that is appropriate for your platform, instruct the compiler to use the same vector extension as the best one that is available for your processor.

Follow these steps to enable platform-appropriate vectorization using Visual Studio*:

  1. In the Solution Explorer pane, right-click the matrix project and select Properties.

  2. Open the C/C++ > Code Generation [Intel C++] menu.

  3. Set the Intel Processor-Specific Optimization option to Same as the host processor performing the compilation (/QxHost). This setting instructs the compiler to use the best instruction set extension that is available for your processor.

  4. Save the change.

  5. Build the application.

Check Vectorization with HPC Performance Characterization Analysis

Repeat the HPC Performance Characterization analysis to ensure that the matrix application is properly vectorized.

Once the analysis is finished, see the result in the Summary window.

Notice that:

Performance optimization is an iterative process. The matrix sample contains more techniques you can consider for performance improvement.