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',
50 typename AccessorPolicy = nda::default_accessor,
51 typename OwningPolicy = nda::borrowed<>>
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.
Layout that specifies how to map multi-dimensional indices to a linear/flat index.
Provides concepts for the nda library.
basic_array_view< ValueType, 1, Layout, 'V', default_accessor, borrowed<> > vector_view
Alias template of an nda::basic_array_view with rank 1, a 'V' algebra, nda::default_accessor and nda:...
basic_array_view< ValueType, Rank, Layout, 'A', default_accessor, borrowed<> > array_view
Alias template of an nda::basic_array_view with an 'A' algebra, nda::default_accessor and nda::borrow...
nda::basic_array< ValueType, 2, nda::basic_layout< nda::static_extents(N, M), nda::C_stride_order< 2 >, nda::layout_prop_e::contiguous >, 'M', nda::stack< static_cast< size_t >(N *M)> > stack_matrix
Alias template of an nda::basic_array with rank 2, static extents, contiguous C layout,...
basic_array_view< ValueType, 1, Layout, 'V', default_accessor, borrowed< mem::Device > > cuvector_view
Similar to nda::vector_view except the memory is stored on the device.
basic_array< ValueType, 1, C_layout, 'V', heap< mem::Device > > cuvector
Similar to nda::vector except the memory is stored on the device.
basic_array_view< ValueType const, 2, Layout, 'M', default_accessor, borrowed< mem::Device > > cumatrix_const_view
Similar to nda::matrix_const_view except the memory is stored on the device.
basic_array_view< ValueType, Rank, Layout, 'A', default_accessor, borrowed<> > array_contiguous_view
Same as nda::array_view except for contiguous memory layouts.
basic_array_view< ValueType, 2, Layout, 'M', default_accessor, borrowed<> > matrix_view
Alias template of an nda::basic_array_view with rank 2, an 'M' algebra, nda::default_accessor and nda...
basic_array_view< ValueType const, Rank, Layout, 'A', default_accessor, borrowed<> > array_contiguous_const_view
Same as nda::array_const_view except for contiguous memory layouts.
basic_array_view< ValueType const, Rank, Layout, 'A', default_accessor, borrowed<> > array_const_view
Same as nda::array_view except for const value types.
basic_array< ValueType, Rank, Layout, 'A', ContainerPolicy > array
Alias template of an nda::basic_array with an 'A' algebra.
nda::basic_array< ValueType, 1, nda::basic_layout< nda::static_extents(N), nda::C_stride_order< 1 >, nda::layout_prop_e::contiguous >, 'V', nda::stack< N > > stack_vector
Alias template of an nda::basic_array with rank 1, static extents, contiguous C layout,...
basic_array< ValueType, Rank, Layout, 'A', heap< mem::Device > > cuarray
Similar to nda::array except the memory is stored on the device.
basic_array_view< ValueType const, Rank, Layout, 'A', default_accessor, borrowed< mem::Device > > cuarray_const_view
Similar to nda::array_const_view except the memory is stored on the device.
basic_array< ValueType, 2, Layout, 'M', ContainerPolicy > cumatrix
Similar to nda::matrix except the memory is stored on the device.
basic_array_view< ValueType const, 1, Layout, 'V', default_accessor, borrowed<> > vector_const_view
Same as nda::vector_view except for const value types.
basic_array< ValueType, 1, C_layout, 'V', ContainerPolicy > vector
Alias template of an nda::basic_array with rank 1 and a 'V' algebra.
basic_array_view< ValueType const, 2, Layout, 'M', default_accessor, borrowed<> > matrix_const_view
Same as nda::matrix_view except for const value types.
basic_array_view< ValueType, 2, Layout, 'M', default_accessor, borrowed< mem::Device > > cumatrix_view
Similar to nda::matrix_view except the memory is stored on the device.
basic_array< ValueType, 2, Layout, 'M', ContainerPolicy > matrix
Alias template of an nda::basic_array with rank 2 and an 'M' algebra.
basic_array_view< ValueType, Rank, Layout, 'A', default_accessor, borrowed< mem::Device > > cuarray_view
Similar to nda::array_view except the memory is stored on the device.
basic_array_view< ValueType const, 1, Layout, 'V', default_accessor, borrowed< mem::Device > > cuvector_const_view
Similar to nda::vector_const_view except the memory is stored on the device.
nda::basic_array< ValueType, 1+sizeof...(Ns), nda::basic_layout< nda::static_extents(N0, Ns...), nda::C_stride_order< 1+sizeof...(Ns)>, nda::layout_prop_e::contiguous >, 'A', nda::stack< N0 *(Ns *... *1)> > stack_array
Alias template of an nda::basic_array with static extents, contiguous C layout, 'A' algebra and nda::...
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.
heap_basic< mem::mallocator< AdrSp > > heap
Alias template of the nda::heap_basic policy using an nda::mem::mallocator.
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 unary expression for nda::Array types.
Lazy binary expression for nda::ArrayOrScalar types.
static constexpr layout_info_t compute_layout_info()
Compute the layout information of the expression.
static constexpr char algebra
Constexpr variable specifying the algebra of one of the non-scalar operands.
Stores information about the memory layout and the stride order of an array/view.
Memory policy using an nda::mem::handle_stack.
Provides type traits for the nda library.