LLAMA: The Low-Level Abstraction For Memory Access

06/08/2021
by   Bernhard Manfred Gruber, et al.
0

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 AoS (Array of Structs) and SoA (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.

READ FULL TEXT
research
02/16/2023

Updates on the Low-Level Abstraction of Memory Access

Choosing the best memory layout for each hardware architecture is increa...
research
11/30/2017

An Instrumenting Compiler for Enforcing Confidentiality in Low-Level Code

We present an instrumenting compiler for enforcing data confidentiality ...
research
10/28/2018

SoaAlloc: A Lock-free Hierarchical Bitmap-based Object Allocator for GPUs

Designing dynamic memory allocators for GPUs is challenging because appl...
research
10/24/2019

Leveraging access mode declarations in a model for memory consistency in heterogeneous systems

On a system that exposes disjoint memory spaces to the software, a progr...
research
07/20/2021

PandaPy: A Wrapper Around Structured Arrays to Mimic ‘Structs’ in the C Language

Similar to the original Pandas project, PandaPy is developed to improve ...
research
05/19/2021

Pure Tensor Program Rewriting via Access Patterns (Representation Pearl)

Tensor kernels in machine learning (ML) often correspond to pure mathema...
research
04/19/2021

Accelerating key bioinformatics tasks 100-fold by improving memory access

Most experimental sciences now rely on computing, and biological science...

Please sign up or login with your details

Forgot password? Click here to reset