43 template <
int Rank, u
int64_t StaticExtents, u
int64_t Str
ideOrder, layout_prop_e LayoutProp>
46 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename ContainerPolicy>
49 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra =
'A',
52 class basic_array_view;
54 template <
char OP, Array A>
57 template <
char OP, ArrayOrScalar L, ArrayOrScalar R>
74 template <
typename ValueType,
int Rank,
typename Layout = C_layout,
typename ContainerPolicy = heap<>>
85 template <
typename ValueType,
int Rank,
typename Layout = C_str
ide_layout>
95 template <
typename ValueType,
int Rank,
typename Layout = C_str
ide_layout>
105 template <
typename ValueType,
int Rank,
typename Layout = C_layout>
106 requires(
has_contiguous(Layout::template mapping<Rank>::layout_prop))
116 template <
typename ValueType,
int Rank,
typename Layout = C_layout>
117 requires(
has_contiguous(Layout::template mapping<Rank>::layout_prop))
127 template <
typename ValueType,
typename Layout = C_layout,
typename ContainerPolicy = heap<>>
137 template <
typename ValueType,
typename Layout = C_str
ide_layout>
146 template <
typename ValueType,
typename Layout = C_str
ide_layout>
155 template <
typename ValueType,
typename ContainerPolicy = heap<>>
165 template <
typename ValueType,
typename Layout = C_str
ide_layout>
174 template <
typename ValueType,
typename Layout = C_str
ide_layout>
186 template <
typename... Is>
188 if (i0 > 15)
throw std::runtime_error(
"Error in nda::static_extents: Only 16 dimensions are supported!");
189 return encode(std::array<
int,
sizeof...(Is) + 1>{i0,
static_cast<int>(is)...});
200 template <
typename ValueType,
int N0,
int... Ns>
214 template <
typename ValueType,
int N,
int M>
226 template <
typename ValueType,
int N>
238 template <
typename ValueType,
int Rank,
typename Layout = C_layout>
248 template <
typename ValueType,
int Rank,
typename Layout = C_str
ide_layout>
258 template <
typename ValueType,
int Rank,
typename Layout = C_str
ide_layout>
268 template <
typename ValueType,
typename Layout = C_layout,
typename ContainerPolicy = heap<mem::Device>>
277 template <
typename ValueType,
typename Layout = C_str
ide_layout>
286 template <
typename ValueType,
typename Layout = C_str
ide_layout>
294 template <
typename ValueType>
303 template <
typename ValueType,
typename Layout = C_str
ide_layout>
312 template <
typename ValueType,
typename Layout = C_str
ide_layout>
323 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename ContainerPolicy>
327 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename AccessorPolicy,
typename OwningPolicy>
331 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename ContainerPolicy>
335 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename AccessorPolicy,
typename OwningPolicy>
339 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename ContainerPolicy>
344 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename AccessorPolicy,
typename OwningPolicy>
352 template <
typename T,
typename T2 = std::remove_reference_t<T> >
359 template <
typename T,
typename T2 = std::remove_reference_t<T> >
368 template <
typename T,
typename RT = get_regular_t<T>>
370 std::conditional_t<mem::on_host<RT>, RT,
380 template <
typename T,
typename RT = get_regular_t<T>>
382 std::conditional_t<mem::on_device<RT>, RT,
392 template <
typename T,
typename RT = get_regular_t<T>>
394 std::conditional_t<mem::on_unified<RT>, RT,
399 template <
char OP, Array A>
403 template <
char OP, Array A>
407 template <
char OP,
typename L,
typename R>
411 template <
char OP,
typename L,
typename R>
Defines accessors for nda::array objects (cf. std::default_accessor).
Provides definitions and type traits involving the different memory address spaces supported by nda.
A generic view of a multi-dimensional array.
A generic multi-dimensional array.
Provides concepts for the nda library.
constexpr bool is_regular_v
Constexpr variable that is true if type A is a regular array, i.e. an nda::basic_array.
constexpr char get_algebra
Constexpr variable that specifies the algebra of a type.
std::conditional_t< mem::on_device< RT >, RT, basic_array< get_value_t< RT >, get_rank< RT >, get_contiguous_layout_policy< get_rank< RT >, get_layout_info< RT >.stride_order >, get_algebra< RT >, heap< mem::Device > > > get_regular_device_t
Get the type of the nda::basic_array that would be obtained by constructing an array on device memory...
decltype(basic_array{std::declval< T >()}) get_regular_t
Get the type of the nda::basic_array that would be obtained by constructing an array from a given typ...
std::conditional_t< mem::on_unified< RT >, RT, basic_array< get_value_t< RT >, get_rank< RT >, get_contiguous_layout_policy< get_rank< RT >, get_layout_info< RT >.stride_order >, get_algebra< RT >, heap< mem::Unified > > > get_regular_unified_t
Get the type of the nda::basic_array that would be obtained by constructing an array on unified memor...
std::conditional_t< mem::on_host< RT >, RT, basic_array< get_value_t< RT >, get_rank< RT >, get_contiguous_layout_policy< get_rank< RT >, get_layout_info< RT >.stride_order >, get_algebra< RT >, heap< mem::Host > > > get_regular_host_t
Get the type of the nda::basic_array that would be obtained by constructing an array on host memory f...
constexpr uint64_t static_extents(int i0, Is... is)
Encode the given shape into a single integer using the nda::encode function.
constexpr int get_rank
Constexpr variable that specifies the rank of an nda::Array or of a contiguous 1-dimensional range.
std::remove_reference_t< decltype(basic_array_view{std::declval< T >()})> get_view_t
Get the type of the nda::basic_array_view that would be obtained by constructing a view from a given ...
constexpr bool is_view_v
Constexpr variable that is true if type A is a view, i.e. an nda::basic_array_view.
constexpr uint64_t C_stride_order
C/Row-major stride order.
std::conditional_t< StrideOrder==C_stride_order< Rank >, C_layout, std::conditional_t< StrideOrder==Fortran_stride_order< Rank >, F_layout, contiguous_layout_with_stride_order< StrideOrder > > > get_contiguous_layout_policy
Get the contiguous layout policy for a given rank and stride order.
constexpr bool has_contiguous(layout_prop_e lp)
Checks if a layout property has the contiguous property.
constexpr layout_info_t get_layout_info
Constexpr variable that specifies the nda::layout_info_t of type A.
constexpr uint64_t encode(std::array< int, N > const &a)
Encode a std::array<int, N> in a uint64_t.
Provides a class that maps multi-dimensional indices to a linear index and vice versa.
Provides definitions of various layout policies.
Defines various memory handling policies.
Provides utilities to work with permutations and to compactly encode/decode std::array objects.
Contiguous layout policy with C-order (row-major order).
Generic layout policy with arbitrary order.
Memory policy using an nda::mem::handle_borrowed.
Default accessor for various array and view types.
Lazy binary expression for nda::ArrayOrScalar types.
static constexpr layout_info_t compute_layout_info()
Compute the layout information of the expression.
Memory policy using an nda::mem::handle_heap.
Stores information about the memory layout and the stride order of an array/view.
uint64_t stride_order
Stride order of the array/view.
Memory policy using an nda::mem::handle_stack.
Provides type traits for the nda library.