Visual Studio* IDE: Prepare the Sample Application

This topic is part of a tutorial that shows how to use the automated Roofline chart to make prioritized optimization decisions.

Follow these initial steps if you prefer to use the Intel Advisor plug-in to the Visual Studio* IDE try out the roofline_demo_samples sample application.

Get Software Tools and Unpack the Sample Application

You need the following tools:

If you do not already have the Intel Advisor or the Intel® C++ Compiler Classic, download it from https://software.intel.com/content/www/us/en/develop/tools.html.

To set up the roofline_demo_samples sample application:

  1. Download both the sample code and sample results to a writable directory or share on your system.

  2. Extract the sample code and sample results from the .zip files.

Open the Visual Studio* Solution

  1. Launch the Visual Studio* IDE.

  2. If necessary, choose View > Solution Explorer.

  3. Choose File > Open > Project/Solution.

  4. In the Open Project dialog box, open the roofline_demo_samples.sln file.

Prepare the Project

To follow along with this tutorial:

  1. Make sure the project name in the Solution Explorer says roofline_demo_samples (Intel C++ [version]). If not, right-click the roofline_demo_samples project in the Solution Explorer, then choose Intel Compiler > Use Intel C++.

  2. If the Solutions Configuration drop-down on the Visual Studio* Standard toolbar is set to Debug, change it to Release.

  3. Right-click the roofline_demo_samples project in the Solution Explorer, then choose Properties.

  4. Choose Configuration Properties > C/C++ > General. Ensure Debug Information Format is set to Program Database (/ZI).

  5. Choose Configuration Properties > C/C++ > Optimization. Ensure Optimization is set to Maximum Optimization (Favor Speed) (/O2).

  6. Choose Configuration Properties > C/C++ > Optimization [Intel C++]. Ensure Parallelization is set to No.

  7. Choose Configuration Properties > C/C++ > Code Generation. Ensure Enable Enhanced Instruction Set is set to Intel® Advanced Vector Extensions 2 (/arch:CORE-AVX2).

  8. Click the Apply button, then click the OK button.

  9. Choose Build > Clean Solution.

  10. Choose Build > Rebuild Solution.

Note

To display the Intel Advisor Workflow and Analysis Results, click the icon on the Intel Advisor toolbar or click Tools > Intel Advisor [version] > Vectorization and Threading Advisor Analysis.

To build your own applications to produce the most accurate and complete Vectorization Advisor analysis results, build an optimized binary in release mode using the following settings.

To Do This

Optimal C/C++ Settings

Request full debug information (compiler and linker).

Linux* OS command line: -g

Windows* OS command line:

  • /ZI

  • /DEBUG

Microsoft Visual Studio* IDE:

  • C/C++ > General > Debug Information Format > Program Database (/Zi)

  • Linker > Debugging > Generate Debug Info > Yes (/DEBUG)

Request moderate optimization.

Linux* OS command line: -O2 or higher

Windows* OS command line: /O2 or higher

Visual Studio* IDE: C/C++ > Optimization > Optimization > Maximum Optimization (Favor Speed) (/O2) or higher

Produce compiler diagnostics (necessary for version 15.0 of the Intel compiler; unnecessary for version 16.0 and higher).

Linux* OS command line: -qopt-report=5

Windows* OS command line: /Qopt-report:5

Visual Studio* IDE: C/C++ > Diagnostics [Intel C++] > Optimization Diagnostic Level > Level 5 (/Qopt-report:5)

Enable vectorization

Linux* OS command line: -vec

Windows* OS command line: /Qvec

Enable SIMD directives

Linux command line: -simd

Windows* OS command line: /Qsimd

Enable generation of multi-threaded code based on OpenMP* directives.

Linux* OS command line: -qopenmp

Windows* OS command line: /Qopenmp

Visual Studio* IDE: C/C++ > Language [Intel C++] > OpenMP Support > Generate Parallel Code (/Qopenmp)