FleCSI User API Version: 2.3.0
 
Loading...
Searching...
No Matches
mdbase< T, D > Struct Template Reference

A multi-dimensional view of an array. More...

Public Member Functions

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.
 

Detailed Description

template<class T, Dimension D>
struct flecsi::util::detail::mdbase< T, D >

A multi-dimensional view of an array.

This class is supported for GPU execution.

Constructor & Destructor Documentation

◆ mdbase()

template<class T , Dimension D>
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 
)
constexprnoexcept

Construct a view of a one-dimensional array.

Here, x and y are analogous:

int x[2][3][4],y0[2*3*4];
mdbase<int,3> y(y0,{4,3,2});
A multi-dimensional view of an array.
Definition array_ref.hh:157
Parameters
ppointer to first element of (sub)array
szsizes, least significant first

Member Function Documentation

◆ length()

template<class T , Dimension D>
constexpr size_type length ( Dimension  i) const
constexprnoexcept

Get one size of the view.

Parameters
idimension (0 for least significant)