32 template <
int Rank, u
int64_t StaticExtents, u
int64_t Str
ideOrder, layout_prop_e LayoutProp>
35 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename ContainerPolicy>
38 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra =
'A',
39 typename AccessorPolicy = nda::default_accessor,
40 typename OwningPolicy = nda::borrowed<>>
43 template <
char OP, Array A>
46 template <
char OP, ArrayOrScalar L, ArrayOrScalar R>
63 template <
typename ValueType,
int Rank,
typename Layout = C_layout,
typename ContainerPolicy = heap<>>
74 template <
typename ValueType,
int Rank,
typename Layout = C_str
ide_layout>
84 template <
typename ValueType,
int Rank,
typename Layout = C_str
ide_layout>
94 template <
typename ValueType,
int Rank,
typename Layout = C_layout>
95 requires(
has_contiguous(Layout::template mapping<Rank>::layout_prop))
105 template <
typename ValueType,
int Rank,
typename Layout = C_layout>
106 requires(
has_contiguous(Layout::template mapping<Rank>::layout_prop))
116 template <
typename ValueType,
typename Layout = C_layout,
typename ContainerPolicy = heap<>>
126 template <
typename ValueType,
typename Layout = C_str
ide_layout>
135 template <
typename ValueType,
typename Layout = C_str
ide_layout>
144 template <
typename ValueType,
typename ContainerPolicy = heap<>>
154 template <
typename ValueType,
typename Layout = C_str
ide_layout>
163 template <
typename ValueType,
typename Layout = C_str
ide_layout>
175 template <
typename... Is>
177 if (i0 > 15)
throw std::runtime_error(
"Error in nda::static_extents: Only 16 dimensions are supported!");
178 return encode(std::array<
int,
sizeof...(Is) + 1>{i0,
static_cast<int>(is)...});
189 template <
typename ValueType,
int N0,
int... Ns>
203 template <
typename ValueType,
int N,
int M>
215 template <
typename ValueType,
int N>
227 template <
typename ValueType,
int Rank,
typename Layout = C_layout>
237 template <
typename ValueType,
int Rank,
typename Layout = C_str
ide_layout>
247 template <
typename ValueType,
int Rank,
typename Layout = C_str
ide_layout>
257 template <
typename ValueType,
typename Layout = C_layout,
typename ContainerPolicy = heap<mem::Device>>
266 template <
typename ValueType,
typename Layout = C_str
ide_layout>
275 template <
typename ValueType,
typename Layout = C_str
ide_layout>
283 template <
typename ValueType>
292 template <
typename ValueType,
typename Layout = C_str
ide_layout>
301 template <
typename ValueType,
typename Layout = C_str
ide_layout>
312 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename ContainerPolicy>
316 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename AccessorPolicy,
typename OwningPolicy>
320 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename ContainerPolicy>
324 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename AccessorPolicy,
typename OwningPolicy>
328 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename ContainerPolicy>
333 template <
typename ValueType,
int Rank,
typename Layout,
char Algebra,
typename AccessorPolicy,
typename OwningPolicy>
341 template <
typename T,
typename T2 = std::remove_reference_t<T> >
348 template <
typename T,
typename T2 = std::remove_reference_t<T> >
357 template <
typename T,
typename RT = get_regular_t<T>>
359 std::conditional_t<mem::on_host<RT>, RT,
369 template <
typename T,
typename RT = get_regular_t<T>>
371 std::conditional_t<mem::on_device<RT>, RT,
381 template <
typename T,
typename RT = get_regular_t<T>>
383 std::conditional_t<mem::on_unified<RT>, RT,
388 template <
char OP, Array A>
392 template <
char OP, Array A>
396 template <
char OP,
typename L,
typename R>
400 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.