Computing Library › Glossary
Glossary

Vectorization

Restructuring computation so a processor performs one operation on many data elements at once.

Definition

Vectorization uses a processor's single-instruction-multiple-data (SIMD) units to apply one operation to several data elements simultaneously. It exploits fine-grained parallelism within a single core.

Auto-vectorization can be fragile, silently failing when the compiler cannot prove that memory regions do not overlap or that a loop has no cross-iteration dependence. Restructuring loops and giving the compiler hints, or using explicit vector intrinsics, recovers the lost performance.

Vectorization exploits parallelism within a single core, and it is usually the first optimization to pursue because it multiplies throughput without the complexity of multiple threads or nodes. Compilers vectorize simple loops automatically, but the process is fragile, defeated by unclear memory aliasing or cross-iteration dependencies. Writing loops that the compiler can prove are safe to vectorize, or using explicit vector instructions, recovers performance that would otherwise sit unused.

How to achieve it

Why it matters

Vectorized code can run several times faster than scalar code on the same hardware by using the wide arithmetic units that would otherwise sit idle. It is often the first optimization applied to numerical kernels before reaching for multiple cores.

Fusion connection

Vectorized inner loops in Kronos numerical kernels make full use of the wide floating-point units in the arithmetic units of modern processors, a key factor in simulation throughput.