Annotation-guided AoS-to-SoA conversions and GPU offloading with data views in C++
Pawel K. Radtke, Tobias Weinzierl

TL;DR
This paper introduces a C++ language extension with annotations that enable automatic selection and conversion between array-of-structs and structure-of-arrays data layouts, optimizing performance across CPU and GPU architectures.
Contribution
It proposes a novel C++ extension allowing developers to guide memory layout choices, with automatic data conversions handled by the compiler for improved performance.
Findings
Effective data layout optimization demonstrated on SPH code
Performance improvements observed across CPU and GPU
Annotations challenge traditional performance engineering approaches
Abstract
The C++ programming language provides classes and structs as fundamental modeling entities. Consequently, C++ code tends to favour array-of-structs (AoS) for encoding data sequences, even though structure-of-arrays (SoA) yields better performance for some calculations. We propose a C++ language extension based on attributes that allows developers to guide the compiler in selecting memory arrangements, i.e.~to select the optimal choice between AoS and SoA dynamically depending on both the execution context and algorithm step. The compiler can then automatically convert data into the preferred format prior to the calculations and convert results back afterward. The compiler handles all the complexity of determining which data to convert and how to manage data transformations. Our implementation realises the compiler-extension for the new annotations in Clang and demonstrates their…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
