Data layout and SIMD abstraction layers: decoupling interfaces from implementations - Laboratoire Interdisciplinaire des Sciences du Numérique Access content directly
Conference Papers Year : 2018

Data layout and SIMD abstraction layers: decoupling interfaces from implementations


From a high level point of view, developers define objects they manipulate in terms of structures or classes. For example, a pixel may be represented as a structure of three color components : red, green, blue and an image as an array of pixels. In such cases, the data layout is said to be organized as an array of structures (AoS). However, developing efficient applications on modern processors and accelerators often require to organize data in different ways. An image may also be stored as a structure of three arrays, one for each component. This data layout is called a structure of array (SoA) and is also mandatory to take advantage of SIMD units embedded in all modern processors. In this paper, we propose a lightweight C++ template-based framework to provide the high level representation most programmers use (AoS) on different data layouts fitted for SIMD vectorization. Some templated containers are provided for each proposed layout with a uniform AoS-like interface to access elements. Containers are transformed into different combinations of tuples and vectors from the C++ Standard Template Library (STL) at compile time. This way, we provide more optimization opportunities for the code, especially automatic vectorization. We study the performance of our data-layouts and compare them to their explicit versions, based on structures and vectors, for different algorithms and architectures (x86 and ARM). Results show that compilers do not always perform automatic vectorization on our data-layouts as with their explicit versions even if underlying containers and access patterns are similar. Thus, we investigate the use of SIMD intrinsics and of Boost.SIMD 1 /bSIMD libraries to vectorize the codes. We show that combining our approach with Boost.SIMD/bSIMD libraries ensures a similar performance as with a manual vectorization using intrinsics, and in almost all cases better performance than with automatic vectorization without increasing the code complexity.
Fichier principal
Vignette du fichier
datalayouts.pdf (175.19 Ko) Télécharger le fichier
Origin : Files produced by the author(s)

Dates and versions

hal-01915529 , version 1 (07-11-2018)



Sylvain Jubertie, Ian Masliah, Joel Falcou. Data layout and SIMD abstraction layers: decoupling interfaces from implementations. The 2018 International Conference on High Performance Computing & Simulation (HPCS 2018) - HPCS 2018, Jul 2018, Orléans, France. pp.531-538, ⟨10.1109/HPCS.2018.00089⟩. ⟨hal-01915529⟩
180 View
1035 Download



Gmail Facebook X LinkedIn More