Heuristic for profitable AoS-to-SoA conversion

Develop a practical heuristic that predicts, for a given compute kernel, data footprint, particle count, thread configuration, and target architecture, whether applying the proposed compiler-supported temporary out-of-place conversion from array-of-structs (AoS) to structure-of-arrays (SoA) with optional attribute-limited views will yield a net performance benefit compared to leaving the data in AoS.

Background

The paper proposes a guided, local approach in C++ where developers annotate loops to trigger compiler-driven, temporary out-of-place AoS-to-SoA conversions (and optional partial views), redirecting memory accesses during the loop and synchronizing specified outputs afterward. This enables experimentation with data layouts while keeping the global AoS structure for code simplicity.

Benchmark data show that conversions can benefit compute-intensive kernels (e.g., force calculation) and sometimes even lighter kernels, but not universally. The authors explicitly state they cannot yet provide a heuristic for when conversions pay off, highlighting the need for a decision procedure that accounts for kernel characteristics, vectorization, cache/TLB behavior, and conversion overheads.

References

We cannot yet provide a heuristic when conversions pay off.

Compiler support for semi-manual AoS-to-SoA conversions with data views  (2405.12507 - Radtke et al., 2024) in Section 1 (Introduction)