top of page

C++23's std::mdspan

Today I would like to introduce C++23's std::mdspan; this feature will let us use multi-dimensional spans, e.g., views and slices of our multi-dimensional vectors or arrays, without copying the data.

This will also help with data access and layouts because we can program to span how we would like. So those are the first steps of implementing the linear algebra library in STL.


In this example, I'll show how to implement a convolution on a two-dimensional monochromatic image with a 3x3 filter.


I must say that this new feature makes our lives easier.


p.s if you can't wait for C++23, you may find an implementation of mdspan at kokkos repository on GitHub. I will add a link in the comments.


Happy learning, everyone.


C++

C++

C++


Comments


bottom of page