FleCSI Core API Version: 2.4.2
Loading...
Searching...
No Matches
mdspan< T, D > Struct Template Reference

A small, approximate subset of mdspan from C++23. More...

Public Member Functions

template<class T, class U, std::size_t D>
 mdspan (T *, std::array< U, D >) -> mdspan< T, D >
 Deduction guide (needed in C++20 only).
constexpr decltype(auto) operator[] (size_type i) const noexcept
 Select a subset of the view.
Public Member Functions inherited from mdbase< T, D >
constexpr size_type length (Dimension i) const noexcept
 Get one size of the view.
template<typename U = size_type, typename = std::enable_if_t<std::is_convertible_v<U, size_type>>>
constexpr mdbase (T *p, std::array< U, D > sz) noexcept
 Construct a view of a one-dimensional array.

Additional Inherited Members

Public Types inherited from mdbase< T, D >
using element_type
 The element type.
using value_type
 The unqualified value type.

Detailed Description

template<class T, unsigned short D>
struct flecsi::util::mdspan< T, D >

A small, approximate subset of mdspan from C++23.

This class is supported for GPU execution.

Template Parameters
Ddimension

Constructor & Destructor Documentation

◆ mdspan()

template<class T, class U, std::size_t D>
mdspan ( T * ,
std::array< U, D >  ) -> mdspan< T, D >

Deduction guide (needed in C++20 only).

Member Function Documentation

◆ operator[]()

template<class T, unsigned short D>
decltype(auto) operator[] ( size_type i) const
constexprnoexcept

Select a subset of the view.

Parameters
iindex (must be smaller than length(D-1))
Returns
mdspan<T,D-1> or T& if D is 1