26 template <
typename Generator>
29 mutable Generator generator;
38 template <
typename... Args>
39 explicit generator_expr(Args&&... args) : generator(std::forward<Args>(args)...) {}
83 return generator.gpu_compute_hint(y);
92 return generator.gpu_compute(y);
100 template <
typename E>
101 constexpr
bool alias(
const E& rhs)
const noexcept {
102 return (
void)rhs,
false;
127 template <
typename L>
136 template <
typename L>
145 template <
typename L>
154 template <
typename L>
163 template <
typename L>
172 template <
typename L>
183 template <
typename V>
184 void visit([[maybe_unused]] V&& visitor)
const {}
216 template <
typename Generator>
220 static constexpr
bool is_etl =
true;
224 static constexpr
bool is_linear =
true;
227 static constexpr
bool is_value =
false;
228 static constexpr
bool is_direct =
false;
229 static constexpr
bool is_generator =
true;
230 static constexpr
bool is_temporary =
false;
231 static constexpr
bool is_padded =
false;
232 static constexpr
bool is_aligned =
false;
233 static constexpr
bool gpu_computable = Generator::gpu_computable;
241 template <vector_mode_t V>
242 static constexpr
bool vectorizable =
false;
247 static constexpr
size_t size() {
void ensure_gpu_up_to_date() const
Copy back from the GPU to the expression memory if necessary.
Definition: generator_expr.hpp:198
void assign_mul_to(L &&lhs) const
Multiply the given left-hand-side expression.
Definition: generator_expr.hpp:155
static constexpr int complexity() noexcept
Estimate the complexity of computation.
Definition: generator_expr.hpp:262
void std_assign_evaluate(Expr &&expr, Result &&result)
Evaluation of the expr into result.
Definition: evaluator.hpp:1176
void assign_mod_to(L &&lhs) const
Modulo the given left-hand-side expression.
Definition: generator_expr.hpp:173
void assign_add_to(L &&lhs) const
Add to the given left-hand-side expression.
Definition: generator_expr.hpp:137
static constexpr size_t size()
Return the size of the expression.
Definition: generator_expr.hpp:247
value_t< sub_type > value_type
The value contained in the expression.
Definition: dyn_matrix_view.hpp:31
void assign_to(L &&lhs) const
Assign to the given left-hand-side expression.
Definition: generator_expr.hpp:128
constexpr bool is_magic_view
Traits indicating if the given ETL type is a magic view expression.
Definition: traits.hpp:311
const Generator & get_generator() const
Returns a reference to the generator op.
Definition: generator_expr.hpp:117
friend std::ostream & operator<<(std::ostream &os, const generator_expr &expr)
Outputs the expression to the given stream.
Definition: generator_expr.hpp:208
order
Storage order of a matrix.
Definition: order.hpp:15
decltype(auto) gpu_compute(Y &y) const
Return a GPU computed version of this expression.
Definition: generator_expr.hpp:91
constexpr bool alias(const E &rhs) const noexcept
Test if this expression aliases with the given expression.
Definition: generator_expr.hpp:101
value_type operator()() const
Apply the functor.
Definition: generator_expr.hpp:109
decltype(auto) gpu_compute_hint(Y &y) const
Return a GPU computed version of this expression.
Definition: generator_expr.hpp:82
constexpr bool is_fast
Traits to test if the given ETL expresion type is fast (sizes known at compile-time) ...
Definition: traits.hpp:588
void visit([[maybe_unused]] V &&visitor) const
Apply the given visitor to this expression and its descendants.
Definition: generator_expr.hpp:184
Traits to get information about ETL types.
Definition: tmp.hpp:68
value_type read_flat([[maybe_unused]] size_t i) const
Returns the value at the given index This function never alters the state of the container.
Definition: generator_expr.hpp:73
Root namespace for the ETL library.
Definition: adapter.hpp:15
value_type operator[]([[maybe_unused]] size_t i) const
Returns the element at the given index.
Definition: generator_expr.hpp:63
void assign_div_to(L &&lhs) const
Divide the given left-hand-side expression.
Definition: generator_expr.hpp:164
typename Generator::value_type value_type
The type of value generated.
Definition: generator_expr.hpp:32
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: generator_expr.hpp:190
void std_mod_evaluate(Expr &&expr, Result &&result)
Compound modulo evaluation of the expr into result.
Definition: evaluator.hpp:1271
static constexpr size_t dimensions()
Return the number of dimensions of the expression.
Definition: generator_expr.hpp:254
void std_mul_evaluate(Expr &&expr, Result &&result)
Compound multiply evaluation of the expr into result.
Definition: evaluator.hpp:1233
void assign_sub_to(L &&lhs) const
Sub from the given left-hand-side expression.
Definition: generator_expr.hpp:146
constexpr bool is_transformer
Traits indicating if the given ETL type is a transformer expression.
Definition: traits.hpp:297
constexpr bool is_view
Traits indicating if the given ETL type is a view expression.
Definition: traits.hpp:304
void std_sub_evaluate(Expr &&expr, Result &&result)
Compound subtract evaluation of the expr into result.
Definition: evaluator.hpp:1214
constexpr bool is_thread_safe
Traits to test if the given ETL expresion type is thread safe.
Definition: traits.hpp:687
void std_div_evaluate(Expr &&expr, Result &&result)
Compound divide evaluation of the expr into result.
Definition: evaluator.hpp:1252
generator_expr(Args &&... args)
Construct a generator expression and forward the arguments to the generator.
Definition: generator_expr.hpp:39
generator_expr(generator_expr &e)
Copy constructor for non-const argument. This simply forwards to the regular copy constructor to avoi...
Definition: generator_expr.hpp:48
typename Generator::value_type value_type
The value type.
Definition: generator_expr.hpp:218
A generator expression.
Definition: generator_expr.hpp:27
void std_add_evaluate(Expr &&expr, Result &&result)
Compound add evaluation of the expr into result.
Definition: evaluator.hpp:1195