Visual Studio* IDE:
Prepare the Sample Application
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 Advisorinstallation package and license
- Version 15.x or higher of theIntel® C++ Compiler Classicor a supported compilerUse an Intel compiler to get more benefit (and version 17.x or higher to get the most benefit) from theVectorization AdvisorSurvey Report. See theRelease Notesfor more information on supported compilers.
- .zipfile 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.zipfiles.
Open the Visual Studio* Solution
- Launch the Visual Studio* IDE.
- If necessary, choose.
- Choose.
- In theOpen Projectdialog box, open theroofline_demo_samples.slnfile.
Prepare the Project
To follow along with this
tutorial
:
- Make sure the project name in theSolution Explorersaysroofline_demo_samples (Intel C++ [version]). If not, right-click theroofline_demo_samplesproject in theSolution Explorer, then choose .
- If theSolutions Configurationdrop-down on the Visual Studio*Standardtoolbar is set toDebug, change it toRelease.
- Right-click theroofline_demo_samplesproject in theSolution Explorer, then chooseProperties.
- Choose. EnsureDebug Information Formatis set toProgram Database (/ZI).
- Choose. EnsureOptimizationis set toMaximum Optimization (Favor Speed) (/O2).
- Choose. EnsureParallelizationis set toNo.
- Choose. EnsureEnable Enhanced Instruction Setis set toIntel(R) Advanced Vector Extensions 2 (/arch:CORE-AVX2).
- Click theApplybutton, then click theOKbutton.
- Choose.
- Choose.
To display the
icon on the
Intel Advisor
Workflow and Analysis Results, click 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:
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:
|
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:
|