18
19
20
33
34
35
38
39
40
41
42
43
44
45
46
47
48
49
50 template <
template <
typename...>
class TMPLT,
typename T>
54 template <
template <
typename...>
class TMPLT,
typename... U>
58 template <
template <
typename...>
class TMPLT,
typename T>
62 template <
typename T,
typename...
Ts>
66 template <
typename...
Ts>
70 template <
typename...
Ts>
82
83
84
89
90
91
92 template <
typename S,
typename A>
101 template <
typename T>
107
108
109
112
113
114
115
116
117
118
119
120
121
122
123
124
125 template <
typename A>
129 template <
typename A>
130 requires(!std::is_same_v<A, std::remove_cvref_t<A>>)
131 inline constexpr char get_algebra<A> = get_algebra<std::remove_cvref_t<A>>;
134 template <
typename A>
144 template <
typename A>
148 template <
typename A>
149 requires(!std::is_same_v<A, std::remove_cvref_t<A>>)
150 inline constexpr bool is_regular_v<A> = is_regular_v<std::remove_cvref_t<A>>;
153 template <
typename A>
157 template <
typename A>
158 requires(!std::is_same_v<A, std::remove_cvref_t<A>>)
159 inline constexpr bool is_view_v<A> = is_view_v<std::remove_cvref_t<A>>;
162 template <
typename A>
166 template <
typename A>
170
171
172
173
174
175
176 template <
typename A>
178 if constexpr (is_scalar_v<A>) {
181 return [&a]<
auto... Is>(std::index_sequence<Is...>) ->
decltype(
auto) {
182 return a((0 * Is)...);
183 }(std::make_index_sequence<get_rank<A>>{});
188
189
190
191 template <
typename A>
192 using get_value_t = std::decay_t<
decltype(get_first_element(std::declval<A
const>()))>;
195 template <
typename A0,
typename...
As>
199 template <
typename A0,
typename...
As>
205
206
207
210
211
212
213
214
215
216
217
218
219
220
221
225 smallest_stride_is_one = 0x2,
226 contiguous = strided_1d | smallest_stride_is_one
230
231
232
233
234
235
236
243
244
245
246
247
248
252
253
254
255
256
257
261
262
263
264
265
269
270
271
272
273
277
278
279
280
281
286
287
288
289
290
291
292
293
294
304
305
306
307
308
309
310
311
320 template <
typename A>
324 template <
typename A>
325 requires(!std::is_same_v<A, std::remove_cvref_t<A>>)
326 inline constexpr layout_info_t get_layout_info<A> = get_layout_info<std::remove_cvref_t<A>>;
329 template <
typename A>
333 template <
typename A>
337 template <
typename A>
341
342
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
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.
constexpr bool is_matrix_or_view_v
Constexpr variable that is true if type A is a regular matrix or a view of a matrix.
constexpr bool have_same_value_type_v
Constexpr variable that is true if all types in As have the same value type as A0.
constexpr int get_rank
Constexpr variable that specifies the rank of an nda::Array or of a contiguous 1-dimensional range.
constexpr bool have_same_rank_v
Constexpr variable that is true if all types in As have the same rank as A0.
constexpr bool is_view_v
Constexpr variable that is true if type A is a view, i.e. an nda::basic_array_view.
constexpr bool is_regular_or_view_v
Constexpr variable that is true if type A is either a regular array or a view.
decltype(auto) get_first_element(A const &a)
Get the first element of an array/view or simply return the scalar if a scalar is given.
constexpr bool layout_property_compatible(layout_prop_e from, layout_prop_e to)
Checks if two layout properties are compatible with each other.
constexpr bool has_contiguous(layout_prop_e lp)
Checks if a layout property has the contiguous property.
constexpr bool has_layout_smallest_stride_is_one
Constexpr variable that is true if type A has the smallest_stride_is_one nda::layout_prop_e guarantee...
constexpr bool has_strided_1d(layout_prop_e lp)
Checks if a layout property has the strided_1d property.
constexpr bool has_layout_strided_1d
Constexpr variable that is true if type A has the strided_1d nda::layout_prop_e guarantee.
constexpr layout_prop_e operator&(layout_prop_e lhs, layout_prop_e rhs)
Bitwise AND operator for two layout properties.
constexpr layout_info_t operator&(layout_info_t lhs, layout_info_t rhs)
Bitwise AND operator for layout infos.
constexpr layout_prop_e operator|(layout_prop_e lhs, layout_prop_e rhs)
Bitwise OR operator for two layout properties.
constexpr layout_info_t get_layout_info
Constexpr variable that specifies the nda::layout_info_t of type A.
constexpr bool has_smallest_stride_is_one(layout_prop_e lp)
Checks if a layout property has the smallest_stride_is_one property.
constexpr bool has_contiguous_layout
Constexpr variable that is true if type A has the contiguous nda::layout_prop_e guarantee.
layout_prop_e
Compile-time guarantees of the memory layout of an array/view.
int get_ld(A const &a)
Get the leading dimension in LAPACK jargon of an nda::MemoryMatrix.
static constexpr bool has_C_layout
Constexpr variable that is true if the given nda::Array type has a C memory layout.
static constexpr bool is_conj_array_expr
Constexpr variable that is true if the given type is a conjugate lazy expression.
int get_ncols(A const &a)
Get the number of columns in LAPACK jargon of an nda::MemoryMatrix.
static constexpr bool is_conj_array_expr< expr_call< conj_f, A > >
Specialization of nda::blas::is_conj_array_expr for the conjugate lazy expressions.
static constexpr bool has_F_layout
Constexpr variable that is true if the given nda::Array type has a Fortran memory layout.
const char get_op
Variable template that determines the BLAS matrix operation tag ('N','T','C') based on the given bool...
AddressSpace
Enum providing identifiers for the different memory address spaces.
constexpr bool is_instantiation_of_v
Constexpr variable that is true if type T is an instantiation of TMPLT (see nda::is_instantiation_of)...
constexpr bool is_complex_v
Constexpr variable that is true if type T is a std::complex type.
constexpr bool is_blas_lapack_v
Alias for nda::is_double_or_complex_v.
static constexpr bool always_false
Constexpr variable that is always false regardless of the types in Ts (used to trigger static_assert)...
constexpr bool is_scalar_for_v
Constexpr variable used to check requirements when initializing an nda::basic_array or nda::basic_arr...
static constexpr bool is_any_of
Constexpr variable that is true if type T is contained in the parameter pack Ts.
constexpr bool is_double_or_complex_v
Constexpr variable that is true if type T is a std::complex type or a double type.
static constexpr bool always_true
Constexpr variable that is always true regardless of the types in Ts.
constexpr bool is_scalar_v
Constexpr variable that is true if type S is a scalar type, i.e. arithmetic or complex.
constexpr bool is_scalar_or_convertible_v
Constexpr variable that is true if type S is a scalar type (see nda::is_scalar_v) or if a std::comple...
A small wrapper around a single long integer to be used as a linear index.
Check if type T is of type TMPLT<...>.
Stores information about the memory layout and the stride order of an array/view.
uint64_t stride_order
Stride order of the array/view.
layout_prop_e prop
Memory layout properties of the array/view.
Memory block consisting of a pointer and its size.