Insert Annotations in the Visual Studio* Code
Editor
Support for Microsoft* Visual Studio* 2017 is deprecated as of the Intel® oneAPI 2022.1 release, and will be removed in a future release.
To add
annotations into your source files, you can use the
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.
Intel® Advisor
Visual Studio* code editor
.
Intel® Advisor
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 Advisor
mark-up capabilities, which do not require you to recompile your application.
To add
annotations:
Intel® Advisor
- Open the source file into which you want to addannotations 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.Intel® Advisor
- 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:
- Within the highlighted code region, right-click the mouse to display the context menu. Selectand the type of annotation to be added, such asIntel Advisor [version]Intel Advisor [version]. For example:> Annotate Site
- This adds the selected type of annotations. For the begin site annotation,adds a unique annotation identifier as an argument.Intel® AdvisorYou should replace the added name with a name that helps you quickly identify its source location. For example, in place ofMySite1in the argument toANNOTATE_SITE_BEGIN()andANNOTATE_SITE_END()shown above, you might instead type the wordsolve(the function name). The added name must be unique amongst the annotations in this project. Annotation name arguments for:
- C/C++ code use an ASCII C++ identifier.
- Fortran code use a character constant.
- C# code use a string (Windows OS only)
Choose a string that you will easily remember when it appears inC# and .NET support is deprecated startingIntel® Advisor2021.1.Intel Advisortool reports. Other annotations use address or size arguments. - To add more annotations in the same file, repeat this process from step 2. To add annotations in a different file, repeat this process from step 1.
This enables you to quickly add annotations into the appropriate source
files.
This wizard provides only the more frequently used annotations, so some
annotations are not available in this wizard. Either use the Survey windows'
annotation assistant to copy other annotations or type the annotations into
your code editor.
If a C/C++ loop only executes a single statement and
does not contain an opening brace (
{
) to allow
multi-statement execution, add braces ({
and
}
) around the existing statement and the annotation.