Parallel & Vectorized Execution
Explore the mechanics of parallel and vectorized execution in C++ Standard Template Library algorithms. Understand how CPU, OS, and compiler optimizations influence execution, and learn about common concurrency hazards like data races and how to avoid them.
We'll cover the following...
We'll cover the following...
Parallel & Vectorized Execution
Whether an algorithm runs in a parallel and vectorized way depends on many factors. For example, it depends on whether the CPU and the operating system support SIMD instructions. Additionally, it also depends on the compiler and the optimization level that you used to translate your code.
The following example shows a simple loop for creating a new vector.
Line 8 is the key line in this small example. Thanks to the compiler explorer, we can have a closer look at the ...