mdspan for discontinuous Galerkin data: zero-cost views and memory layouts on the CPU and the GPU

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.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-13
DOI
https://doi.org/10.5281/zenodo.24202745
Primary Topic
Parallel Computing and Optimization Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

mdspan for discontinuous Galerkin data: zero-cost views and memory layouts on the CPU and the GPU

Dan Vassilev
1 links
Zenodo (CERN European Organization for Nuclear Research)
Parallel Computing and Optimization Techniques
article

mdspan for discontinuous Galerkin data: zero-cost views and memory layouts on the CPU and the GPU

Dan Vassilev
article en

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.

Zenodo (CERN European Organization for Nuclear Research)
Parallel Computing and Optimization Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon