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:
Intel Advisor installation package and license
Version 15.x or higher of the Intel® C++ Compiler Classic or a supported compiler
Use an Intel compiler to get more benefit (and version 17.x or higher to get the most benefit) from the Vectorization Advisor Survey Report. See the Release Notes for more information on supported compilers.
.zip file extraction utility
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:
Download both the sample code and sample results to a writable directory or share on your system.
Extract the sample code and sample results from the .zip files.
Open the Visual Studio* Solution
Launch the Visual Studio* IDE.
If necessary, choose View > Solution Explorer.
Choose File > Open > Project/Solution.
In the Open Project dialog box, open the roofline_demo_samples.sln file.
Prepare the Project
To follow along with this tutorial:
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++.
If the Solutions Configuration drop-down on the Visual Studio* Standard toolbar is set to Debug, change it to Release.
Right-click the roofline_demo_samples project in the Solution Explorer, then choose Properties.
Choose Configuration Properties > C/C++ > General. Ensure Debug Information Format is set to Program Database (/ZI).
Choose Configuration Properties > C/C++ > Optimization. Ensure Optimization is set to Maximum Optimization (Favor Speed) (/O2).
Choose Configuration Properties > C/C++ > Optimization [Intel C++]. Ensure Parallelization is set to No.
Choose Configuration Properties > C/C++ > Code Generation. Ensure Enable Enhanced Instruction Set is set to Intel(R) Advanced Vector Extensions 2 (/arch:CORE-AVX2).
Click the Apply button, then click the OK button.
Choose Build > Clean Solution.
Choose Build > Rebuild Solution.
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:
Microsoft Visual Studio* IDE:
|
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) |