Intel® Advisor User Guide

ID 766448
Date 12/16/2022

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Insert Annotations in the Visual Studio* Code Editor

In Visual Studio* 2022, Intel Advisor provides lightweight integration. You can configure and compile your application and open the standalone Intel Advisor interface from the Visual Studio for further analysis. All your settings will be inherited by the standalone Intel Advisor project.

To add Intel® Advisor annotations into your source files, you can use the Visual Studio* code editor. Intel® Advisor simplifies the process of adding annotations so you do not need to type the annotation names. Alternatively, you can use the annotation assistant in the Survey Report or Survey Source windows, or when using the Visual Studio code editor, the Annotation Wizard (on Windows* OS systems). Alternatively, you can type the exact macro name and its arguments manually.

In most cases, you do not need source annotations when using Intel® Advisor, except for the Suitability analysis of the Threading perspective. When analyzing your application with other perspectives, such as Vectorization and Code Insights or Offload Modeling, you can analyze all parts of your code automatically or use Intel Advisormark-up capabilities, which do not require you to recompile your application.

To add Intel® Advisor annotations:

  1. Open the source file into which you want to add Intel® Advisor annotations in your code editor. You should start with the outermost code regions, such as a parallel site, and then add the tasks within the boundaries of the enclosing site.

  2. Select the code region around which you will add your first annotation, such as a parallel site. Carefully include the correct group of lines, including any opening and closing braces ({ and }) needed. For example:

    Select the code region by dragging the mouse pointer

  3. Within the highlighted code region, right-click the mouse to display the context menu. Select Intel Advisor [version] and the type of annotation to be added, such as Intel Advisor [version]> Annotate Site. For example:

  4. This adds the selected type