README: Intel® Advisor Roofline Demo Sample
The sample code in this package is intended for use with the “Roofline Analysis in Intel® Advisor 2017” tutorial video, available online at the Intel® Developer Zone.
This code is largely conceptual rather than functional in nature. It performs meaningless operations on meaningless data in various layouts, abstractly representing various types of scenarios and optimization problems (such as being memory bound or inefficiently vectorized) at different arithmetic intensities, for the purpose of demonstrating specific effects in the Roofline Analysis feature of Intel® Advisor.
System Requirements:
- Hardware:
- Any Intel® processor with AVX2 instruction set support †
- Software:
- Linux* or Microsoft* Windows* operating system
- Intel® Advisor 2017 Update 2 or later
- Intel® C++ Compiler (version 17.0) ‡
† Because Roofline Analysis is highly system-dependent, processors other than an Intel® Core™ i5-6300U processor may produce different results than those seen in the tutorial video.
‡ This sample code was designed and tested with this compiler. The build scripts included with this code do not include support for other compilers; manual compilation with other compilers (or earlier versions of the Intel® C++ compiler) may or may not produce the expected results.
Build Instructions
Microsoft* Visual Studio* 2015:
- Open roofline_demo_samples.sln in Visual Studio*.
- Change the configuration to Release using the dropdown on the toolbar.
- Set the project to use the Intel® C++ Compiler.
- Project → Intel Compiler → Use Intel C++
- Set the project properties appropriately and click the OK button.
- Project → Properties → C/C++
- → General → Debug Information Format = Program Database (/Zi)
- → Optimization → Optimization = Maximize Speed (/O2)
- → Code Generation → Enable Enhanced Instruction Set = Intel(R) Advanced Vector Extensions 2 (/arch:CORE-AVX2)
- → Optimization [Intel C++] → Parallelization = No
- Select desired loops to run.
- Open roofline.cpp and comment/uncomment the
#define
lines for the desired loops and groups.
- Compile the project.
- Build → Build roofline_demo_samples
Microsoft* Windows* Command Line:
- Ensure that the Intel® C++ Compiler environment variables are set by using the Intel® C++ Compiler terminal, or by running the compilervars.bat file that comes with the compiler. By default it is located at C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin\compilervars.bat.
- Select the desired loops to run.
- Edit roofline.cpp and comment/uncomment the
#define
lines for the desired loops and groups.
- Run the build.bat file that is included in this sample package.
Linux* Command Line:
- Ensure that the Intel® C++ Compiler environment variables are set by sourcing the compilervars.sh file that comes with the compiler. By default it is located at /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh.
- Select the desired loops to run.
- Edit roofline.cpp and comment/uncomment the
#define
lines for the desired loops and groups.
- Build the sample application with the make command.
Roofline Analysis Instructions
Graphical Interface (Standalone or Integrated):
- Compile the project. The project must be compiled after every modification to the code in order to analyze the altered code.
- Start Intel® Advisor.
- In the standalone GUI, you will need to create a new project and set the path to the executable.
- In the Microsoft* Visual Studio* integrated GUI, settings will be inherited automatically from the solution. Open the integrated Advisor with this button on the toolbar:

- Click the
button under “Roofline” on the vectorization workflow panel OR collect a survey analysis, followed by a trip counts with FLOPs analysis.
Microsoft* Windows* Command Line:
- Ensure that Intel® Advisor’s variables are set up by running the advixe-vars.bat file that comes with the tool. By default, this is located at C:\Program Files (x86)\IntelSWTools\Advisor 2017\advixe-vars.bat.
- Compile the project. The project must be compiled after every modification to the code in order to analyze the altered code.
- Run a survey collection, followed by a trip counts collection. In the commands below, replace {YOURPATH} with the path to the roofline_demo_samples folder.
advixe-cl --collect survey -no-auto-finalize --search-dir all:r={YOURPATH} --project-dir {YOURPATH}\release\results -- {YOURPATH}\release\roofline_demo.exe
advixe-cl --collect tripcounts -flop -no-auto-finalize --search-dir all:r={YOURPATH} --project-dir {YOURPATH}\release\results -- {YOURPATH}\release\roofline_demo.exe
Note that the -flop flag only exists in Advisor 2018 Update 1 and later. In older versions, -flops-and-masks must be used instead.
- Open the project, located at {YOURPATH}\release\results\results.advixeproj, in the Intel® Advisor GUI.
- Before opening the analysis result, check that the source and binary searches are set correctly. If not, set them.
- File → Project Properties… → Binary/Symbol Search: should contain one entry, {YOURPATH}, and have the “Search recursively” checkbox checked.
- File → Project Properties… → Source Search: should contain one entry, {YOURPATH}, and have the “Search recursively” checkbox checked.
- Open the result.
Linux* Command Line:
- Ensure that Intel® Advisor’s variables are set up by sourcing the advixe-vars.sh file that comes with the tool. By default, this is located at /opt/intel/advisor_2017/advixe-vars.sh.
- Compile the project. The project must be compiled after every modification to the code in order to analyze the altered code.
- Run a survey collection, followed by a trip counts collection. In the commands below, replace {YOURPATH} with the path to the roofline_demo_samples folder.
advixe-cl --collect survey -no-auto-finalize --search-dir all:r={YOURPATH} --project-dir {YOURPATH}/release/results -- {YOURPATH}/release/roofline_demo
advixe-cl --collect tripcounts -flops -no-auto-finalize --search-dir all:r={YOURPATH} --project-dir {YOURPATH}/release/results -- {YOURPATH}/release/roofline_demo
Note that the -flop flag only exists in Advisor 2018 Update 1 and later. In older versions, -flops-and-masks must be used instead.
- Open the project, located at {YOURPATH}/release/results/results.advixeproj, in the Intel® Advisor GUI.
- Before opening the analysis result, check that the source and binary searches are set correctly. If not, set them.
- File → Project Properties… → Binary/Symbol Search: should contain one entry, {YOURPATH}, and have the “Search recursively” checkbox checked.
- File → Project Properties… → Source Search: should contain one entry, {YOURPATH}, and have the “Search recursively” checkbox checked.
- Open the result.