Inserting Annotations in the Visual Studio* Code Editor

To insert Intel Advisor XE annotations into your source files, use the Visual Studio* code editor. Intel Advisor XE simplifies the process of inserting annotations so you do not need to type the macro names by using the annotation assistant in the Survey Report window. Alternatively, you can type the exact macro name and its arguments manually, as described in this topic.

To insert Intel Advisor XE annotations:

  1. Open the source file into which you want to add Intel Advisor XE 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 insert 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 XE 2013 and the type of annotation to be inserted, such as Intel Advisor XE 2013 > Annotate Site. For example, with C/C++ code:


    Select the type of annotations to insert from the context menu.

  4. This inserts the selected type of annotations. For the begin annotation, Intel Advisor XE adds a unique annotation identifier as an argument.
    Replace the placeholder (<site_name>) with a unique identifier (solve)

    If needed, you can replace the inserted name with a name unique to the annotations in this project. For example, in place of MySite1 in the argument to ANNOTATE_SITE_BEGIN() and ANNOTATE_SITE_END() shown above, you might instead type the word solve (the function name). Annotation name arguments for:

    • C/C++ code, use an ASCII C++ identifier.

    • Fortran code, use a character constant.

    • C# code, use a string

    Choose a string that you will easily remember when it appears in Intel Advisor XE tool reports. Other annotations use address or size arguments.

  5. To insert more annotations in the same file, repeat this process from step 2. To insert annotations in a different file, repeat this process from step 1.

This enables you to quickly insert annotations into the appropriate source files.

If a C/C++ loop only executes a single statement and does not contain an opening brace ({) to allow multi-statement execution, insert braces ({ and }) around the existing statement and the inserted annotation.

See Also


Submit feedback on this help topic