Bewerken

Delen via


/Qpar (Auto-parallelizer)

Enables the Auto-parallelizer feature of the compiler to automatically parallelize loops in your code.

Syntax

/Qpar

Remarks

When the compiler automatically parallelizes loops in code, it spreads computation across multiple processor cores. The compiler parallelizes a loop only if it determines that it's legal to do so and that parallelization would improve performance.

The #pragma loop() directives are available to help the optimizer parallelize specific loops. For more information, see loop.

For information about how to enable output messages for the auto-parallelizer, see /Qpar-report (Auto-parallelizer reporting level).

To set the /Qpar compiler option in Visual Studio

  1. Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.

  2. Select the Configuration Properties > C/C++ > Code Generation property page.

  3. Modify the Enable Parallel Code Generation property. Choose OK or Apply to save your changes.

To set the /Qpar compiler option programmatically

See also

/Q options (Low-level operations)
/Qpar-report (Auto-parallelizer reporting level)
MSVC compiler options
MSVC compiler command-line syntax
#pragma loop()
Native code vectorization in Visual Studio