# Use Guided Auto Parallelism in Microsoft Visual Studio*

The Guided Auto Parallelism (GAP) feature helps you locate portions of your serial code that can be parallelized. When you enable analysis using GAP, the compiler guides you to places in your code where you can increase efficiency through automatic parallelization and vectorization.

### Note

GAP is not supported for `ifx`.

## Run Analysis on a Project

You can start analysis from the Microsoft Visual Studio* IDE in several ways:

- From the Tools menu: Select Intel Compiler > Guided Auto Parallelism > Run Analysis...

  Starting analysis in this way results in a one-time run for the current project. The default values are taken from Tools > Options unless you have chosen to override them in the dialog box.

- From the Diagnostics property page: Use the Guided Auto Parallelism Analysis property.

  Specifically, choose Project > Properties > Fortran > Diagnostics and enable analysis using the Guided Auto Parallelism Analysis property. Enabling analysis in the property page allows you to run an analysis as part of a normal project Build request in Microsoft Visual Studio*. In this mode, GAP-related settings in Tools > Options are ignored, in favor of other GAP-related settings available in the property page.

- From the context menu: Right-click and select Intel Compiler > Guided Auto Parallelism > Run Analysis....

  This is equivalent to using the Guided Auto Parallelism > Run Analysis option on the Tools menu.

To receive advice for auto parallelization, be sure that certain property page settings are correct. Select Project > Properties > Fortran > Optimization and set Parallelization to Yes to enable auto-parallelization optimization. You may also need to set the Optimization level at option O2 or higher.

## GAP Scenarios

To illustrate how the various GAP settings work together, consider the following scenarios:

Scenario | Result
--- | ---
The GAP analysis setting in the property pages is set to Enabled. | Analysis always occurs for the project, whenever a regular project build occurs. Other analysis settings specified in the property pages are used. Analysis setting in Tools > Options are ignored.
The Gap analysis setting in the property pages is set to Disabled, and GAP is run from the Tools menu. | Analysis occurs for this one run. The default values for this analysis are taken from Tools > Options and can be overridden in the dialog box. Options specified in the property pages are also used, but will be overridden by any specified analysis option.
The GAP analysis setting in the property pages is set to Disabled, and GAP options are set in Tools > Options. | No analysis occurs, unless analysis is explicitly run from the Tools menu.

## Run Analysis on a File or within a File

Right-click on Guided Auto Parallelism context menu item to run analysis on the following:

- Single file: Select a file and right-click.

- Function (routine):Right-click within the function scope.

- Range of lines: Select one or more lines for analysis and right-click.

Parent topic: Use Microsoft Visual Studio

## See Also

Options: Guided Auto Parallelism dialog box
Guided Auto Parallelism
Using Guided Auto Parallelism