---
description: "Learn more about: Auto-Parallelization and Auto-Vectorization"
title: "Auto-Parallelization and Auto-Vectorization"
ms.date: "11/04/2016"
ms.assetid: ec71583a-287b-4599-8767-1d255e080fe3
---
# Auto-Parallelization and Auto-Vectorization
Auto-Parallelizer and Auto-Vectorizer are designed to provide automatic performance gains for loops in your code.
## Auto-Parallelizer
The [/Qpar](../build/reference/qpar-auto-parallelizer.md) compiler switch enables *automatic parallelization* of loops in your code. When you specify this flag without changing your existing code, the compiler evaluates the code to find loops that might benefit from parallelization. Because it might find loops that don't do much work and therefore won't benefit from parallelization, and because every unnecessary parallelization can engender the spawning of a thread pool, extra synchronization, or other processing that would tend to slow performance instead of improving it, the compiler is conservative in selecting the loops that it parallelizes. For example, consider the following example in which the upper bound of the loop is not known at compile time:
```cpp
void loop_test(int u) {
for (int i=0; i
[Parallel Programming in Native Code](/archive/blogs/nativeconcurrency)
[/Qpar (Auto-Parallelizer)](../build/reference/qpar-auto-parallelizer.md)
[/Qpar-report (Auto-Parallelizer Reporting Level)](../build/reference/qpar-report-auto-parallelizer-reporting-level.md)
[/Qvec-report (Auto-Vectorizer Reporting Level)](../build/reference/qvec-report-auto-vectorizer-reporting-level.md)
[Vectorizer and Parallelizer Messages](../error-messages/tool-errors/vectorizer-and-parallelizer-messages.md)