mdspan for discontinuous Galerkin data: zero-cost views and memory layouts on the CPU and the GPU
Year: 2026
Type: article
Abstract: Discontinuous Galerkin methods store a few coefficients per element and apply small element-local matrices, so their performance depends on how that data lies in memory. mdspan, the C++23 multidimensional view, is also part of CUDA, and it makes the memory layout part of the type. This report applies it to the data of the local discontinuous Galerkin (LDG) method on a CPU and a GPU. One kernel source runs as fast as hand-written indexing, and changing the layout is a one-word edit. When an operation uses 2 of the 8 coefficients of each element, that edit makes it 3.0× faster on the CPU and 2.8× faster on the GPU. Further experiments cover batches of element-local matrices and a 5-point stencil.
Author: Vassilev, Dan
Language: English
Subfield: Hardware and Architecture
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7226020169
