Logo Sciencesconf

Multidimensional data offsets in C++ through variadic templates

Luca Cirrottola  1@  

1 : Centre Inria de l'Université de Bordeaux
Institut National de Recherche en Informatique et en Automatique

Data in high performance computing are typically stored contiguously for performance considerations. In computational sciences, these data are often associated to an underlying unstructured mesh, and the stride of the data associated with each mesh element is not uniform. These data offsets are typically stored as a graph adjacency, in a dedicated array. Moreover, the developer may need to do some further sub-indexing on the data associated to one mesh element (e.g. the index of the variable on the element, the index of the degree of freedom of the variable on the element...), raising the need for storing also these arrays of sub-offsets. This presentation shows how variadic templates in modern C++ can be used to write a general, compact template class allowing to generate multidimensional offsets with an arbitrary number of indices.

Type : : Présentation

Thématiques : La programmation d’aujourd’hui et de demain

Chargement... Chargement...