16 #include "etl/concepts_base.hpp" 33 template <vector_mode_t V>
57 static constexpr
bool linear =
false;
65 template <vector_mode_t V>
71 template <
typename Expr>
90 template <
typename Sub>
92 static constexpr
bool linear = Sub::linear;
102 template <vector_mode_t V>
108 template <
typename E>
125 template <
typename T, expr_or_scalar<T> Expr,
typename UnaryOp>
148 template <
typename V = default_vec>
159 unary_expr(
const unary_expr& rhs) =
default;
160 unary_expr(unary_expr&& rhs) noexcept =
default;
163 unary_expr& operator=(
const unary_expr& rhs) =
delete;
164 unary_expr& operator=(unary_expr&& rhs) =
delete;
172 return UnaryOp::apply(value[i]);
182 return UnaryOp::apply(value.read_flat(i));
191 template <
typename V = default_vec>
193 return UnaryOp::template load<V>(value.template load<V>(i));
202 template <
typename V = default_vec>
204 return UnaryOp::template load<V>(value.template loadu<V>(i));
212 template <size_c... S>
214 return UnaryOp::apply(value(args...));
222 template <
typename E>
223 bool alias(
const E& rhs)
const noexcept {
224 return value.alias(rhs);
231 template <
typename Y>
240 template <
typename Y>
241 decltype(
auto) gpu_compute(Y& y)
const {
242 return UnaryOp::gpu_compute(value, y);
251 template <
typename L>
260 template <
typename L>
269 template <
typename L>
278 template <
typename L>
287 template <
typename L>
296 template <
typename L>
308 value.visit(visitor);
317 value.ensure_cpu_up_to_date();
326 value.ensure_gpu_up_to_date();
335 friend std::ostream&
operator<<(std::ostream& os,
const unary_expr& expr) {
336 return os << UnaryOp::desc() <<
'(' << expr.value <<
')';
345 template <
typename T, expr_or_scalar<T> Expr>
347 assignable<unary_expr<T, Expr, identity_op>, T>,
350 iterable<unary_expr<T, Expr, identity_op>, is_dma<Expr>> {
355 static constexpr
bool dma = is_dma<Expr>;
360 static constexpr
bool non_const_return_ref =
361 std::is_lvalue_reference_v<decltype(value[0])> && !std::is_const_v<std::remove_reference_t<decltype(value[0])>>;
366 static constexpr
bool const_return_ref = std::is_lvalue_reference_v<decltype(value[0])>;
379 using return_type = std::conditional_t<non_const_return_ref, value_type&, value_type>;
382 using iterator = std::conditional_t<dma, value_type*, etl::iterator<this_type>>;
383 using const_iterator = std::conditional_t<dma, const value_type*, etl::iterator<const this_type>>;
388 template <
typename V = default_vec>
391 using assignable_base_type::operator=;
397 explicit unary_expr(Expr l) noexcept : value(std::forward<Expr>(l)) {
404 unary_expr(
const unary_expr& rhs) =
default;
409 unary_expr(unary_expr&& rhs) noexcept =
default;
436 return value.read_flat(i);
445 template <
typename V = default_vec>
447 return value.template store<V>(in, i);
456 template <
typename V = default_vec>
458 return value.template storeu<V>(in, i);
467 template <
typename V = default_vec>
469 return value.template stream<V>(in, i);
478 template <
typename V = default_vec>
480 load(
size_t i) const noexcept {
481 return value.template load<V>(i);
490 template <
typename V = default_vec>
493 return value.template loadu<V>(i);
504 return value.unsafe_dimension_access(i);
513 return sub(*
this, i);
522 return sub(*
this, i);
531 auto slice(
size_t first,
size_t last) noexcept {
541 auto slice(
size_t first,
size_t last)
const noexcept {
550 template <size_c... S>
552 operator()(S... args) noexcept(noexcept(value(args...)))
requires (
sizeof...(S) == safe_dimensions<this_type>) {
553 return value(args...);
561 template <size_c... S>
563 operator()(S... args)
const noexcept(noexcept(value(args...)))
requires(
sizeof...(S) == safe_dimensions<this_type>) {
564 return value(args...);
572 template <
typename E>
573 bool alias(
const E& rhs)
const noexcept {
574 if constexpr (all_dma<E, Expr>) {
575 return memory_alias(memory_start(), memory_end(), rhs.memory_start(), rhs.memory_end());
577 return value.alias(rhs);
586 return value.memory_start();
594 return value.memory_start();
602 return value.memory_end();
610 return value.memory_end();
618 static constexpr
size_t dim()
requires fast<this_type> {
635 template <
size_t... I>
636 std::array<size_t, decay_traits<this_type>::dimensions()> dim_array(std::index_sequence<I...>)
const {
637 return {{this->
template dim<I>()...}};
646 template <
typename L>
655 template <
typename L>
664 template <
typename L>
673 template <
typename L>
682 template <
typename L>
691 template <
typename L>
703 value.visit(visitor);
711 return _gpu.gpu_memory();
725 _gpu.invalidate_cpu();
732 _gpu.invalidate_gpu();
754 _gpu.ensure_gpu_allocated(
etl::size(value));
761 if constexpr (is_dma<Expr>) {
762 _gpu.ensure_gpu_up_to_date(memory_start(),
etl::size(value));
764 value.ensure_gpu_up_to_date();
773 if constexpr (is_dma<Expr>) {
774 _gpu.ensure_cpu_up_to_date(memory_start(),
etl::size(value));
776 value.ensure_cpu_up_to_date();
793 return _gpu.is_cpu_up_to_date();
801 return _gpu.is_gpu_up_to_date();
811 return os << expr.value;
820 if constexpr (is_dma<Expr>) {
823 for (
size_t i = 0; i < size(*
this); ++i) {
833 template <
typename T,
typename Expr>
862 unary_expr(
const unary_expr& rhs) =
default;
863 unary_expr(unary_expr&& rhs) noexcept =
default;
866 unary_expr& operator=(
const unary_expr& e) =
delete;
867 unary_expr& operator=(unary_expr&& e) =
delete;
885 return value.read_flat(i);
894 return sub(*
this, i);
902 template <size_c... S>
904 return value(args...);
912 template <
typename E>
913 bool alias(
const E& rhs)
const noexcept {
914 return value.alias(rhs);
921 template <
typename Y>
923 return value.gpu_compute_hint(y);
930 template <
typename Y>
931 decltype(
auto) gpu_compute(Y& y)
const {
932 return value.gpu_compute(y);
941 template <
typename L>
950 template <
typename L>
959 template <
typename L>
968 template <
typename L>
977 template <
typename L>
986 template <
typename L>
998 value.visit(visitor);
1007 value.ensure_cpu_up_to_date();
1016 value.ensure_gpu_up_to_date();
1025 friend std::ostream&
operator<<(std::ostream& os,
const unary_expr& expr) {
1026 return os << expr.value;
1035 template <
typename T,
typename Expr,
typename Op>
1038 iterable<unary_expr<T, Expr, stateful_op<Op>>> {
1061 template <
typename V = default_vec>
1069 template <
typename... Args>
1070 explicit unary_expr(Expr l, Args&&... args) : value(std::forward<Expr>(l)), op(std::forward<Args>(args)...) {
1074 unary_expr(
const unary_expr& rhs) =
default;
1075 unary_expr(unary_expr&& rhs) noexcept =
default;
1078 unary_expr& operator=(
const unary_expr& e) =
delete;
1079 unary_expr& operator=(unary_expr&& e) =
delete;
1087 return op.apply(value[i]);
1097 return op.apply(value.read_flat(i));
1106 template <
typename V = default_vec>
1108 return op.template load<V>(value.template load<V>(i));
1117 template <
typename V = default_vec>
1119 return op.template load<V>(value.template loadu<V>(i));
1126 template <
typename Y>
1128 return op.gpu_compute_hint(value, y);
1135 template <
typename Y>
1136 decltype(
auto) gpu_compute(Y& y)
const {
1137 return op.gpu_compute(value, y);
1145 template <size_c... S>
1147 return op.apply(value(args...));
1155 template <
typename E>
1156 bool alias(
const E& rhs)
const noexcept {
1157 return value.alias(rhs);
1166 template <
typename L>
1175 template <
typename L>
1184 template <
typename L>
1193 template <
typename L>
1202 template <
typename L>
1211 template <
typename L>
1223 value.visit(visitor);
1232 value.ensure_cpu_up_to_date();
1241 value.ensure_gpu_up_to_date();
1250 friend std::ostream&
operator<<(std::ostream& os,
const unary_expr& expr) {
1251 return os << Op::desc() <<
'(' << expr.value <<
')';
1258 template <
typename T,
typename Expr,
typename UnaryOp>
1265 static constexpr
bool is_etl =
true;
1269 static constexpr
bool is_fast = sub_traits::is_fast;
1270 static constexpr
bool is_value =
false;
1271 static constexpr
bool is_direct =
1272 std::is_same_v<UnaryOp, identity_op> && sub_traits::is_direct;
1273 static constexpr
bool is_linear = sub_traits::is_linear && UnaryOp::linear;
1274 static constexpr
bool is_thread_safe = sub_traits::is_thread_safe && UnaryOp::thread_safe;
1275 static constexpr
bool is_generator = sub_traits::is_generator;
1276 static constexpr
bool is_temporary = sub_traits::is_temporary;
1277 static constexpr
bool is_padded = is_linear && sub_traits::is_padded;
1278 static constexpr
bool is_aligned = is_linear && sub_traits::is_aligned;
1279 static constexpr
order storage_order = sub_traits::storage_order;
1284 static constexpr
bool gpu_computable = is_gpu_computable<Expr> && UnaryOp::template gpu_computable<Expr> && (is_floating<Expr> || is_complex<Expr>);
1291 template <vector_mode_t V>
1292 static constexpr
bool vectorizable = sub_traits::template vectorizable<V>&& UnaryOp::template vectorizable<V>;
1300 return sub_traits::size(v.value);
1318 return sub_traits::size();
1327 static constexpr
size_t dim() {
1328 return sub_traits::template dim<D>();
1336 return sub_traits::dimensions();
1344 return UnaryOp::complexity() + sub_traits::complexity();
bool is_cpu_up_to_date() const noexcept requires(etl_dma< Expr >)
Indicates if the CPU memory is up to date.
Definition: unary_expr.hpp:792
friend std::ostream & operator<<(std::ostream &os, const unary_expr &expr)
Prints the type of the unary expression to the stream.
Definition: unary_expr.hpp:810
CRTP class to inject iterators functions.
Definition: iterable.hpp:23
std::conditional_t< dma, const value_type *, etl::iterator< const this_type > > const_iterator
The const iterator type.
Definition: unary_expr.hpp:383
Specialization of unary expression for stateful op.
Definition: unary_expr.hpp:1036
void assign_add_to(L &&lhs) const
Add to the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:217
bool alias(const E &rhs) const noexcept
Test if this expression aliases with the given expression.
Definition: unary_expr.hpp:223
vec_type< V > load(size_t i) const
Load several elements of the matrix at once.
Definition: unary_expr.hpp:192
unary_expr(Expr l) noexcept
Construct a new unary expression.
Definition: unary_expr.hpp:397
std::conditional_t< const_return_ref, const value_type &, value_type > const_return_type
The const type returned by the const functions.
Definition: unary_expr.hpp:380
void stream(vec_type< V > in, size_t i) noexcept
Store several elements in the matrix at once, using non-temporal store.
Definition: unary_expr.hpp:468
Simple unary op for identity operations.
Definition: unary_expr.hpp:24
unary_expr(Expr l, Args &&... args)
Construct a new unary_expr from the given sub-expression and construct the op by forwarding it the gi...
Definition: unary_expr.hpp:1070
std::decay_t< Expr > sub_expr_t
The sub expression type.
Definition: unary_expr.hpp:1261
T value_type
The value type.
Definition: unary_expr.hpp:1051
static constexpr size_t dimensions()
Returns the number of expressions for this type.
Definition: unary_expr.hpp:1335
auto slice(E &&value, size_t first, size_t last) -> slice_view< detail::build_identity_type< E >>
Returns view representing a slice view of the given expression.
Definition: view_expression_builder.hpp:112
std::conditional_t< dma, value_type *, etl::iterator< this_type > > iterator
The iterator type.
Definition: unary_expr.hpp:382
void std_assign_evaluate(Expr &&expr, Result &&result)
Evaluation of the expr into result.
Definition: evaluator.hpp:1176
Expr expr_t
The sub expression type.
Definition: unary_expr.hpp:1054
Sub op
The sub operator type.
Definition: unary_expr.hpp:95
bool alias(const E &rhs) const noexcept
Test if this expression aliases with the given expression.
Definition: dyn_matrix_view.hpp:197
void assign_div_to(L &&lhs) const
Divide the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:244
void validate_gpu() const noexcept requires(etl_dma< Expr >)
Validates the GPU memory.
Definition: unary_expr.hpp:745
vec_type< V > loadu(size_t i) const
Load several elements of the matrix at once.
Definition: unary_expr.hpp:203
void assign_mul_to(L &&lhs) const
Multiply the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:235
void memory_type
The memory type.
Definition: unary_expr.hpp:1052
void assign_to(L &&lhs) const
Assign to the given left-hand-side expression.
Definition: unary_expr.hpp:252
constexpr bool is_magic_view
Traits indicating if the given ETL type is a magic view expression.
Definition: traits.hpp:311
static constexpr int complexity()
Estimate the complexity of operator.
Definition: unary_expr.hpp:115
const_memory_t< Expr > const_memory_type
The const memory type.
Definition: unary_expr.hpp:378
void invalidate_cpu() const noexcept requires(etl_dma< Expr >)
Invalidates the CPU memory.
Definition: unary_expr.hpp:724
bool is_gpu_up_to_date() const noexcept requires(etl_dma< Expr >)
Indicates if the GPU memory is up to date.
Definition: unary_expr.hpp:800
T value_type
The value type.
Definition: unary_expr.hpp:138
auto operator()(size_t i) const requires sub_capable< this_type >
Creates a sub view of the matrix, effectively removing the first dimension and fixing it to the given...
Definition: unary_expr.hpp:521
value_type operator()(S... args) const
Returns the value at the position (args...)
Definition: unary_expr.hpp:213
void assign_to(L &&lhs) const
Assign to the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:208
memory_t< Expr > memory_type
The memory type.
Definition: unary_expr.hpp:377
static constexpr size_t size()
Returns the size of an expression of this fast type.
Definition: unary_expr.hpp:1317
vec_type< V > loadu(size_t i) const
Load several elements of the matrix at once.
Definition: unary_expr.hpp:1118
order
Storage order of a matrix.
Definition: order.hpp:15
void const_memory_type
The const memory type.
Definition: unary_expr.hpp:1053
static constexpr bool gpu_computable
Indicates if the operator can be computed on GPU.
Definition: unary_expr.hpp:40
value_type operator[](size_t i) const
Returns the element at the given index.
Definition: unary_expr.hpp:1086
void gpu_evict() const noexcept requires(etl_dma< Expr >)
Evict the expression from GPU.
Definition: unary_expr.hpp:717
void ensure_gpu_up_to_date() const
Copy back from the GPU to the expression memory if necessary.
Definition: unary_expr.hpp:324
value_type read_flat(size_t i) const noexcept
Returns the value at the given index This function never alters the state of the container.
Definition: unary_expr.hpp:181
void assign_add_to(L &&lhs) const
Add to the given left-hand-side expression.
Definition: unary_expr.hpp:261
An unary expression.
Definition: unary_expr.hpp:126
Simple unary op for stateful operations.
Definition: unary_expr.hpp:91
CRTP class to inject functions testing values of the expressions.
Definition: value_testable.hpp:26
constexpr bool is_fast
Traits to test if the given ETL expresion type is fast (sizes known at compile-time) ...
Definition: traits.hpp:588
An optimizer for the given expression type.
Definition: expr_fwd.hpp:16
void assign_mod_to(L &&lhs) const
Modulo the given left-hand-side expression.
Definition: unary_expr.hpp:297
void assign_div_to(L &&lhs) const
Divide the given left-hand-side expression.
Definition: unary_expr.hpp:288
Specialization of unary expression for identity op.
Definition: unary_expr.hpp:346
auto load(size_t x) const noexcept
Load several elements of the expression at once.
Definition: dyn_matrix_view.hpp:143
Traits to get information about ETL types.
Definition: tmp.hpp:68
void assign_sub_to(L &&lhs) const
Sub from the given left-hand-side expression.
Definition: unary_expr.hpp:270
Root namespace for the ETL library.
Definition: adapter.hpp:15
value_type read_flat(size_t i) const noexcept
Returns the value at the given index This function never alters the state of the container.
Definition: unary_expr.hpp:435
value_type read_flat(size_t i) const
Returns the value at the given index This function never alters the state of the container.
Definition: unary_expr.hpp:1096
bool memory_alias(const P1 *a_begin, const P1 *a_end, const P2 *b_begin, const P2 *b_end)
Test if two memory ranges overlap.
Definition: helpers.hpp:264
void validate_cpu() const noexcept requires(etl_dma< Expr >)
Validates the CPU memory.
Definition: unary_expr.hpp:738
void assign_mul_to(L &&lhs) const
Multiply the given left-hand-side expression.
Definition: unary_expr.hpp:279
auto dim(E &&value, size_t i) -> detail::identity_helper< E, dim_view< detail::build_identity_type< E >, D >>
Return a view representing the ith Dth dimension.
Definition: view_expression_builder.hpp:25
friend std::ostream & operator<<(std::ostream &os, const unary_expr &expr)
Prints the type of the unary expression to the stream.
Definition: unary_expr.hpp:335
typename V::template vec_type< T > vec_type
Definition: unary_expr.hpp:149
std::conditional_t< non_const_return_ref, value_type &, value_type > return_type
The type returned by the functions.
Definition: unary_expr.hpp:379
auto slice(size_t first, size_t last) const noexcept
Creates a slice view of the matrix, effectively reducing the first dimension.
Definition: unary_expr.hpp:541
std::conditional_t< std::is_const_v< std::remove_reference_t< S > >, typename std::decay_t< S >::const_memory_type, typename std::decay_t< S >::memory_type > memory_t
Traits to extract the direct memory type out of an ETL type.
Definition: tmp.hpp:88
std::ostream & operator<<(std::ostream &os, const etl::complex< T > &c)
Outputs a textual representation of the complex number in the given stream.
Definition: complex.hpp:576
typename std::decay_t< S >::const_memory_type const_memory_t
Traits to extract the direct const memory type out of an ETL type.
Definition: tmp.hpp:94
void ensure_cpu_up_to_date() const
Ensures that the GPU memory is allocated and that the GPU memory is up to date (to undefined value)...
Definition: dyn_matrix_view.hpp:271
return_type operator[](size_t i)
Returns the element at the given index.
Definition: unary_expr.hpp:416
Expr expr_t
The sub expression type.
Definition: unary_expr.hpp:381
Visitor to perform local evaluation when necessary.
Definition: eval_visitors.hpp:23
size_t & unsafe_dimension_access(size_t i)
Returns a reference to the ith dimension value.
Definition: unary_expr.hpp:503
Configurable iterator for ETL expressions.
Definition: iterator.hpp:24
void visit(detail::evaluator_visitor &visitor) const
Apply the given visitor to this expression and its descendants.
Definition: unary_expr.hpp:307
CRTP class to inject inplace operations to matrix and vector structures.
Definition: inplace_assignable.hpp:26
void std_mod_evaluate(Expr &&expr, Result &&result)
Compound modulo evaluation of the expr into result.
Definition: evaluator.hpp:1271
void store(vec_type< V > in, size_t i) noexcept
Store several elements in the matrix at once.
Definition: unary_expr.hpp:446
static constexpr size_t dim()
Returns the Dth dimension of an expression of this type.
Definition: unary_expr.hpp:1327
const_return_type operator()(size_t j) const
Access to the element at the given position.
Definition: dyn_matrix_view.hpp:89
void ensure_gpu_up_to_date() const
Allocate memory on the GPU for the expression and copy the values into the GPU.
Definition: unary_expr.hpp:760
void direct_fill(E &&mat, V value)
Fill the given ETL value class with the given value.
Definition: direct_fill.hpp:25
void ensure_cpu_up_to_date() const
Ensures that the GPU memory is allocated and that the GPU memory is up to date (to undefined value)...
Definition: unary_expr.hpp:315
vec_type< V > load(size_t i) const
Load several elements of the matrix at once.
Definition: unary_expr.hpp:1107
void std_mul_evaluate(Expr &&expr, Result &&result)
Compound multiply evaluation of the expr into result.
Definition: evaluator.hpp:1233
auto loadu(size_t x) const noexcept
Load several elements of the expression at once.
Definition: dyn_matrix_view.hpp:154
auto operator()(size_t i) requires sub_capable< this_type >
Creates a sub view of the matrix, effectively removing the first dimension and fixing it to the given...
Definition: unary_expr.hpp:512
constexpr bool is_transformer
Traits indicating if the given ETL type is a transformer expression.
Definition: traits.hpp:297
void ensure_gpu_allocated() const requires(etl_dma< Expr >)
Ensures that the GPU memory is allocated and that the GPU memory is up to date (to undefined value)...
Definition: unary_expr.hpp:753
void visit(detail::evaluator_visitor &visitor) const
Apply the given visitor to this expression and its descendants.
Definition: dyn_matrix_view.hpp:263
Expr expr_t
The sub expression type.
Definition: unary_expr.hpp:141
constexpr size_t size(const E &expr) noexcept
Returns the size of the given ETL expression.
Definition: helpers.hpp:108
void invalidate_gpu() const noexcept requires(etl_dma< Expr >)
Invalidates the GPU memory.
Definition: unary_expr.hpp:731
void ensure_cpu_up_to_date() const
Copy back from the GPU to the expression memory if necessary.
Definition: unary_expr.hpp:772
void gpu_copy_from(const T *gpu_memory) const requires(etl_dma< Expr >)
Copy from GPU to GPU.
Definition: unary_expr.hpp:784
value_type operator[](size_t i) const
Returns the element at the given index.
Definition: unary_expr.hpp:171
static constexpr int complexity()
Estimate the complexity of operator.
Definition: unary_expr.hpp:46
requires(D > 0) struct dyn_base
Matrix with run-time fixed dimensions.
Definition: dyn_base.hpp:113
constexpr bool is_view
Traits indicating if the given ETL type is a view expression.
Definition: traits.hpp:304
void ensure_gpu_up_to_date() const
Copy back from the GPU to the expression memory if necessary.
Definition: dyn_matrix_view.hpp:280
static constexpr bool linear
Indicates if the operator is linear.
Definition: unary_expr.hpp:25
static constexpr bool thread_safe
Indicates if the operator is thread safe.
Definition: unary_expr.hpp:26
Simple traits to test if an expression is optimizable.
Definition: expr_fwd.hpp:13
static constexpr int complexity() noexcept
Estimate the complexity of computation.
Definition: unary_expr.hpp:1343
CRTP class to inject assign operations to matrix and vector structures.
Definition: assignable.hpp:25
void storeu(vec_type< V > in, size_t i) noexcept
Store several elements in the matrix at once.
Definition: unary_expr.hpp:457
unary_expr(Expr l)
Construct a new unary_expr with the given sub expression.
Definition: unary_expr.hpp:155
void std_sub_evaluate(Expr &&expr, Result &&result)
Compound subtract evaluation of the expr into result.
Definition: evaluator.hpp:1214
T value_type
The value type.
Definition: unary_expr.hpp:1263
typename V::template vec_type< value_type > vec_type
Definition: unary_expr.hpp:389
void assign_mod_to(L &&lhs) const
Modulo the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:253
void memory_type
The memory type.
Definition: unary_expr.hpp:139
auto slice(size_t first, size_t last) noexcept
Creates a slice view of the matrix, effectively reducing the first dimension.
Definition: unary_expr.hpp:531
constexpr bool is_thread_safe
Traits to test if the given ETL expresion type is thread safe.
Definition: traits.hpp:687
void const_memory_type
The const memory type.
Definition: unary_expr.hpp:140
typename V::template vec_type< T > vec_type
Definition: unary_expr.hpp:1062
static size_t size(const expr_t &v)
Returns the size of the given expression.
Definition: unary_expr.hpp:1299
const auto & gpu_compute_hint([[maybe_unused]] Y &y) const
Return a GPU computed version of this expression.
Definition: sub_view.hpp:653
T value_type
The value type.
Definition: unary_expr.hpp:375
void std_div_evaluate(Expr &&expr, Result &&result)
Compound divide evaluation of the expr into result.
Definition: evaluator.hpp:1252
const_return_type operator[](size_t i) const
Returns the element at the given index.
Definition: unary_expr.hpp:425
value_type * gpu_memory() const noexcept
Return GPU memory of this expression, if any.
Definition: sub_view.hpp:674
Definition: gpu_handler.hpp:549
static size_t dim(const expr_t &v, size_t d)
Returns the dth dimension of the given expression.
Definition: unary_expr.hpp:1309
static constexpr bool vectorizable
Indicates if the expression is vectorizable using the given vector mode.
Definition: unary_expr.hpp:34
void std_add_evaluate(Expr &&expr, Result &&result)
Compound add evaluation of the expr into result.
Definition: evaluator.hpp:1195
CRTP class to inject functions testing the dimensions.
Definition: dim_testable.hpp:45
void assign_sub_to(L &&lhs) const
Sub from the given left-hand-side expression.
Definition: dyn_matrix_view.hpp:226