Multidimensional arrays are a foundational data structure for science and engineering codes - a data structure which unfortunately lacks proper representation in the C++ standard library.
In this talk, we will introduce and discuss array_ref, a performance-oriented multidimensional array reference which has been proposed for inclusion in a future C++ standard or a in the C++ Library TS. An array_ref is a reference to a memory extent through a layout mapping from a multi-index space (domain) to that extent (range). array_ref is a powerful and generic abstraction which supports user-defined layouts and access semantics. This flexibility makes array_ref ideal for:
- interoperating with existing applications and other programming languages (such as Fortran and Matlab) and
- addressing "special" memory regions (e.g. GPU memory and high-throughput scratchpad memory such as HBM and HMC).
array_ref has a powerful subarray interface designed to facilitate performant iteration of multi-dimensional arrays - an area where previous C++ array libraries have struggled.
This presentation will present the proposed array_ref library that is being advanced through the C++ standards committee, and discuss the challenges we've faced in our quest for an elegant and expressive interface that does not sacrifice performance or break the zero-overhead principle. We'll demonstrate how array_ref can be used to work with multi-dimensional data structures and to manage "special" memory exposed by new architectures.
Those interested in using array_ref can get started today with a stand-alone C++-14 implementation of array_ref developed by Bryce, which is available under the Boost Software License.