Data layout and SIMD abstraction layers: decoupling interfaces from implementations

Abstract : 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.
Liste complète des métadonnées

https://hal.archives-ouvertes.fr/hal-01915529
Contributor : Sylvain Jubertie <>
Submitted on : Wednesday, November 7, 2018 - 4:40:52 PM
Last modification on : Wednesday, March 27, 2019 - 1:35:32 AM
Document(s) archivé(s) le : Friday, February 8, 2019 - 3:17:31 PM

File

datalayouts.pdf
Files produced by the author(s)

Identifiers

Citation

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⟩

Share

Metrics

Record views

65

Files downloads

86