Explicit SIMD Vectorization with Modern C++

Loop vectorization remains a challenging task. While automatic vectorization from compilers can now handle a wide range of codes, the underlying dependency reasoning tends to fail when either data or control flow become too complex. Guided vectorization as, e. g., provided by OpenMP pragmas, allows the compiler to offload the reasoning to the developer and handle more code in turn. However, neither guided nor automatic vectorization has yet been able to generate suitable data structures for vectorized code. In this case, explicit vectorization remains the sole option for programmers. We present our general-purpose approach to explicitly vectorize complex loops based on C++ templates and the upcoming std::simd library. The core idea of this approach is the introduction of a SIMD index type, which allows loop bodies to be completely written in a simd-generic way. On top of that, we have developed the open source library SIMD_ACCESS, which complements std::simd. This library adds streamlined load and store expressions, residual and aligning loop handling and a framework for vectorizing data structures. We conclude the paper with a performance evaluation. We show that there is no performance overhead caused by our abstraction layer. Finally, we investigate and compare two different vectorization approaches of a loop in a Discontinous-Galerkin Spectral-Element Method in an industry-grade CFD code for unstructured meshes.

Authors

Institutions

Publication Details

Published
2025-08-13
DOI
https://doi.org/10.1109/hpcc67675.2025.00033
Primary Topic
Parallel Computing and Optimization Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Explicit SIMD Vectorization with Modern C++

Olaf Krzikalla, Johannes Wendler, Immo Huismann
Parallel Computing and Optimization Techniques
article

Explicit SIMD Vectorization with Modern C++

Olaf Krzikalla, Johannes Wendler, Immo Huismann
article en

Abstract

Loop vectorization remains a challenging task. While automatic vectorization from compilers can now handle a wide range of codes, the underlying dependency reasoning tends to fail when either data or control flow become too complex. Guided vectorization as, e. g., provided by OpenMP pragmas, allows the compiler to offload the reasoning to the developer and handle more code in turn. However, neither guided nor automatic vectorization has yet been able to generate suitable data structures for vectorized code. In this case, explicit vectorization remains the sole option for programmers. We present our general-purpose approach to explicitly vectorize complex loops based on C++ templates and the upcoming std::simd library. The core idea of this approach is the introduction of a SIMD index type, which allows loop bodies to be completely written in a simd-generic way. On top of that, we have developed the open source library SIMD_ACCESS, which complements std::simd. This library adds streamlined load and store expressions, residual and aligning loop handling and a framework for vectorizing data structures. We conclude the paper with a performance evaluation. We show that there is no performance overhead caused by our abstraction layer. Finally, we investigate and compare two different vectorization approaches of a loop in a Discontinous-Galerkin Spectral-Element Method in an industry-grade CFD code for unstructured meshes.

Institute of Virology of the Slovak Academy of Sciences (SK)
Openalex Percentile: Top 65%
Parallel Computing and Optimization Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.