LLAMA: The low‐level abstraction for memory access
Open Access
- 8 March 2022
- journal article
- research article
- Published by Wiley in Software: Practice and Experience
- Vol. 53 (1) , 115-141
Abstract
The performance gap between CPU and memory widens continuously. Choosing the best memory layout for each hardware architecture is increasingly important as more and more programs become memory bound. For portable codes that run across heterogeneous hardware architectures, the choice of the memory layout for data structures is ideally decoupled from the rest of a program. This can be accomplished via a zero‐runtime‐overhead abstraction layer, underneath which memory layouts can be freely exchanged. We present the low‐level abstraction of memory access (LLAMA), a C++ library that provides such a data structure abstraction layer with example implementations for multidimensional arrays of nested, structured data. LLAMA provides fully C++ compliant methods for defining and switching custom memory layouts for user‐defined data types. The library is extensible with third‐party allocators. Providing two close‐to‐life examples, we show that the LLAMA‐generated array of structs and struct of arrays layouts produce identical code with the same performance characteristics as manually written data structures. Integrations into the SPEC CPU® lbm benchmark and the particle‐in‐cell simulation PIConGPU demonstrate LLAMA's abilities in real‐world applications. LLAMA's layout‐aware copy routines can significantly speed up transfer and reshuffling of data between layouts compared with naive element‐wise copying. LLAMA provides a novel tool for the development of high‐performance C++ applications in a heterogeneous environment.Keywords
All Related Versions
Funding Information
- Horizon 2020 Framework Programme (654220)
This publication has 20 references indexed in Scilit:
- SoAx: A generic C++ Structure of Arrays for handling particles in HPC codesComputer Physics Communications, 2018
- In-Datacenter Performance Analysis of a Tensor Processing UnitACM SIGARCH Computer Architecture News, 2017
- Alpaka -- An Abstraction Library for Parallel Kernel Acceleration2016
- Kokkos: Enabling manycore performance portability through polymorphic memory access patternsJournal of Parallel and Distributed Computing, 2014
- Abstraction for AoS and SoA Layout in C++2012
- Vc: A C++ library for explicit vectorizationSoftware: Practice and Experience, 2011
- MultiArray: a C++ library for generic programming with arraysSoftware: Practice and Experience, 2005
- Reflections on the memory wall2004
- OPTIMIZATION AND PROFILING OF THE CACHE PERFORMANCE OF PARALLEL LATTICE BOLTZMANN CODESParallel Processing Letters, 2003
- Numerical solution of initial boundary value problems involving maxwell's equations in isotropic mediaIEEE Transactions on Antennas and Propagation, 1966