MDSPAN: A Deep Dive Spanning C++, Kokkos & SYCL
Details
## Location
In Person:
Microsoft Redmond Reactor | 3709 157th Ave NE, Redmond, WA 98052
Conf Room 20/1034 (14) Alder Reactor
Map
Remote:
On Line Using Microsoft Teams
Click here to join the meeting
Meeting ID: 221 084 547 694
Passcode: zRSbFd
Call in (audio only)
+1 323-849-4874,,731463717#<tel:+13238494874,,731463717#> United States, Los Angeles
Phone Conference ID: 731 463 717#
## Abstract
This talk is a deep dive into the history behind MDSPAN (it’s roots being in Kokkos::View), the C++ standardization effort behind it (current status, various tradeoffs made over time, and language changes to help support it) and how SYCL is looking to leverage it in the future. MDSPAN is a non-owning multidimensional array reference, currently slated to be one of the flagship libraries added to C++23. View/reference vocabulary types first entered C++17 with string_view (a non-owning string reference), followed by span (a non-owning single dimension contiguous memory reference) and the ranges library. MDSPAN is the natural progression of this, and one that is critical to distributed (eg. CPU/GPU programming) and high-performance computing.
MDSPAN got its roots from Kokkos::View, One key difference between Kokkos::View & MDSPAN: Kokkos::View may be owning (reference-counted reference semantics) or non-owning. The former is also being standardized for C++26 as MDARRAY, although with value and not reference-counted semantics. Separately, in 2014 Microsoft proposed a similar type, array_view, be added to the standard. After a year and a half and seven revisions, it was ultimately abandoned in favor of what is now MDSPAN because it did not provide a zero-overhead abstraction.
The MDSPAN proposal itself has taken seven years and has been through 19+ revisions, with input from many different companies as well as the C++ Committee. What changed over the years and why did it change? In parallel, two key language changes were made which ultimately improved the interface: deprecating the comma operator inside square brackets, and the addition of the multidimensional subscript operator. This allows the natural syntax of a[I, j, k] instead of inferior alternatives like a(i, j, k), a[I][j][k] or even a[Index(i), j, k].
## A Word From Our Sponsor
Please thank JFrog and Conan for sponsoring the our Meetup account!
Please thank Microsoft for sponsoring our meeting room and Teams account!
