Expression Templates Library (ETL)
Namespaces | Functions | Variables
evaluator.hpp File Reference

The evaluator is responsible for assigning one expression to another. More...

#include "etl/eval_selectors.hpp"
#include "etl/linear_eval_functors.hpp"
#include "etl/vec_eval_functors.hpp"
Include dependency graph for evaluator.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 etl
 Root namespace for the ETL library.
 

Functions

template<typename E >
void etl::standard_evaluator::pre_assign_rhs (E &&expr)
 Allocate temporaries and evaluate sub expressions in RHS. More...
 
template<typename Fun , typename E , typename R >
void etl::standard_evaluator::par_exec (E &&expr, R &&result)
 Assign the result of the expression to the result with the given Functor, using parallel implementation. More...
 
template<typename E , typename R >
void etl::standard_evaluator::standard_assign_impl (E &expr, R &result)
 Assign the result of the expression to the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::fast_assign_impl_full (E &expr, R &result)
 Assign the result of the expression to the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::fast_assign_impl (E &expr, R &result)
 Assign the result of the expression to the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::gpu_assign_impl (E &expr, R &result)
 Assign the result of the expression to the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::direct_assign_impl (E &expr, R &result)
 Assign the result of the expression to the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::vectorized_assign_impl (E &expr, R &result)
 Assign the result of the expression to the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::assign_evaluate_impl_no_gpu (E &&expr, R &&result)
 
template<typename E , typename R >
void etl::standard_evaluator::assign_evaluate_impl (E &&expr, R &&result)
 
template<typename E , typename R >
void etl::standard_evaluator::standard_compound_add_impl (E &expr, R &result)
 Add the result of the expression to the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::direct_compound_add_impl (E &expr, R &result)
 Add the result of the expression to the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::vectorized_compound_add_impl (E &expr, R &result)
 Add the result of the expression to the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::add_evaluate_no_gpu (E &&expr, R &&result)
 Add the result of the expression to the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::add_evaluate (E &&expr, R &&result)
 Add the result of the expression to the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::standard_compound_sub_impl (E &expr, R &result)
 Subtract the result of the expression from the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::direct_compound_sub_impl (E &expr, R &result)
 Subtract the result of the expression from the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::vectorized_compound_sub_impl (E &expr, R &result)
 Subtract the result of the expression from the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::gpu_compound_sub_impl (E &expr, R &result)
 Subtract the result of the expression from the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::sub_evaluate_no_gpu (E &&expr, R &&result)
 Subtract the result of the expression from the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::sub_evaluate (E &&expr, R &&result)
 Subtract the result of the expression from the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::standard_compound_mul_impl (E &expr, R &result)
 Multiply the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::direct_compound_mul_impl (E &expr, R &result)
 Multiply the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::vectorized_compound_mul_impl (E &expr, R &result)
 Multiply the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::gpu_compound_mul_scalar_impl (E &expr, R &result)
 Multiply the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::mul_evaluate_no_gpu (E &&expr, R &&result)
 Subtract the result of the expression from the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::mul_evaluate (E &&expr, R &&result)
 Subtract the result of the expression from the result. More...
 
template<typename E , typename R >
void etl::standard_evaluator::standard_compound_div_impl (E &expr, R &result)
 Divide the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::direct_compound_div_impl (E &expr, R &result)
 Divide the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::vectorized_compound_div_impl (E &expr, R &result)
 Divide the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::gpu_compound_div_impl (E &expr, R &result)
 Divide the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::gpu_compound_div_scalar_impl (E &expr, R &result)
 Divide the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::div_evaluate_no_gpu (E &&expr, R &&result)
 Divide the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::div_evaluate (E &&expr, R &&result)
 Divide the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::mod_evaluate (E &&expr, R &&result)
 Modulo the result by the result of the expression. More...
 
template<typename E , typename R >
void etl::standard_evaluator::assign_evaluate (E &&expr, R &&result)
 Assign the result of the expression to the result. More...
 
template<typename Expr , typename Result >
void etl::std_assign_evaluate (Expr &&expr, Result &&result)
 Evaluation of the expr into result. More...
 
template<typename Expr , typename Result >
void etl::std_add_evaluate (Expr &&expr, Result &&result)
 Compound add evaluation of the expr into result. More...
 
template<typename Expr , typename Result >
void etl::std_sub_evaluate (Expr &&expr, Result &&result)
 Compound subtract evaluation of the expr into result. More...
 
template<typename Expr , typename Result >
void etl::std_mul_evaluate (Expr &&expr, Result &&result)
 Compound multiply evaluation of the expr into result. More...
 
template<typename Expr , typename Result >
void etl::std_div_evaluate (Expr &&expr, Result &&result)
 Compound divide evaluation of the expr into result. More...
 
template<typename Expr , typename Result >
void etl::std_mod_evaluate (Expr &&expr, Result &&result)
 Compound modulo evaluation of the expr into result. More...
 
template<typename Expr >
void etl::force (Expr &&expr)
 Force the internal evaluation of an expression. More...
 

Variables

template<typename Expr , typename Result >
constexpr bool etl::direct_assign_compatible
 Traits indicating if a direct assign is possible. More...
 

Detailed Description

The evaluator is responsible for assigning one expression to another.

The evaluator will handle all expressions assignment and for each of them, it will choose the most adapted implementation to assign one to another. There are several implementations of assign:

Function Documentation

◆ add_evaluate()

template<typename E , typename R >
void etl::standard_evaluator::add_evaluate ( E &&  expr,
R &&  result 
)

Add the result of the expression to the result.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ add_evaluate_no_gpu()

template<typename E , typename R >
void etl::standard_evaluator::add_evaluate_no_gpu ( E &&  expr,
R &&  result 
)

Add the result of the expression to the result.

This does not consider the GPU.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ assign_evaluate()

template<typename E , typename R >
void etl::standard_evaluator::assign_evaluate ( E &&  expr,
R &&  result 
)

Assign the result of the expression to the result.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ direct_assign_impl()

template<typename E , typename R >
void etl::standard_evaluator::direct_assign_impl ( E &  expr,
R &  result 
)

Assign the result of the expression to the result.

This is done using a direct computation and stored in memory, possibly in parallel.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ direct_compound_add_impl()

template<typename E , typename R >
void etl::standard_evaluator::direct_compound_add_impl ( E &  expr,
R &  result 
)

Add the result of the expression to the result.

This is performed using direct computation with, possibly in parallel.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ direct_compound_div_impl()

template<typename E , typename R >
void etl::standard_evaluator::direct_compound_div_impl ( E &  expr,
R &  result 
)

Divide the result by the result of the expression.

This is performed using direct computation into memory, possibly in parallel.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ direct_compound_mul_impl()

template<typename E , typename R >
void etl::standard_evaluator::direct_compound_mul_impl ( E &  expr,
R &  result 
)

Multiply the result by the result of the expression.

This is performed with direct computation into memory, possibly in parallel.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ direct_compound_sub_impl()

template<typename E , typename R >
void etl::standard_evaluator::direct_compound_sub_impl ( E &  expr,
R &  result 
)

Subtract the result of the expression from the result.

This is performed using direct compution into memory, possibly in parallel.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ div_evaluate()

template<typename E , typename R >
void etl::standard_evaluator::div_evaluate ( E &&  expr,
R &&  result 
)

Divide the result by the result of the expression.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ div_evaluate_no_gpu()

template<typename E , typename R >
void etl::standard_evaluator::div_evaluate_no_gpu ( E &&  expr,
R &&  result 
)

Divide the result by the result of the expression.

This does not consider the GPU.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ fast_assign_impl()

template<typename E , typename R >
void etl::standard_evaluator::fast_assign_impl ( E &  expr,
R &  result 
)

Assign the result of the expression to the result.

This is done using direct memory copy between the two expressions.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ fast_assign_impl_full()

template<typename E , typename R >
void etl::standard_evaluator::fast_assign_impl_full ( E &  expr,
R &  result 
)

Assign the result of the expression to the result.

This is done using direct memory copy between the two expressions, handling possible GPU memory.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ gpu_assign_impl()

template<typename E , typename R >
void etl::standard_evaluator::gpu_assign_impl ( E &  expr,
R &  result 
)

Assign the result of the expression to the result.

This is done using a full GPU computation.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ gpu_compound_div_impl()

template<typename E , typename R >
void etl::standard_evaluator::gpu_compound_div_impl ( E &  expr,
R &  result 
)

Divide the result by the result of the expression.

This is performed using full GPU computation into memory.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ gpu_compound_div_scalar_impl()

template<typename E , typename R >
void etl::standard_evaluator::gpu_compound_div_scalar_impl ( E &  expr,
R &  result 
)

Divide the result by the result of the expression.

This is performed using full GPU computation into memory.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ gpu_compound_mul_scalar_impl()

template<typename E , typename R >
void etl::standard_evaluator::gpu_compound_mul_scalar_impl ( E &  expr,
R &  result 
)

Multiply the result by the result of the expression.

This is performed with full GPU computation into memory.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ gpu_compound_sub_impl()

template<typename E , typename R >
void etl::standard_evaluator::gpu_compound_sub_impl ( E &  expr,
R &  result 
)

Subtract the result of the expression from the result.

This is performed using full GPU compution into memory.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ mod_evaluate()

template<typename E , typename R >
void etl::standard_evaluator::mod_evaluate ( E &&  expr,
R &&  result 
)

Modulo the result by the result of the expression.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ mul_evaluate()

template<typename E , typename R >
void etl::standard_evaluator::mul_evaluate ( E &&  expr,
R &&  result 
)

Subtract the result of the expression from the result.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ mul_evaluate_no_gpu()

template<typename E , typename R >
void etl::standard_evaluator::mul_evaluate_no_gpu ( E &&  expr,
R &&  result 
)

Subtract the result of the expression from the result.

This does not consider the GPU.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ par_exec()

template<typename Fun , typename E , typename R >
void etl::standard_evaluator::par_exec ( E &&  expr,
R &&  result 
)

Assign the result of the expression to the result with the given Functor, using parallel implementation.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ pre_assign_rhs()

template<typename E >
void etl::standard_evaluator::pre_assign_rhs ( E &&  expr)

Allocate temporaries and evaluate sub expressions in RHS.

Parameters
exprThe expr to be visited

◆ standard_assign_impl()

template<typename E , typename R >
void etl::standard_evaluator::standard_assign_impl ( E &  expr,
R &  result 
)

Assign the result of the expression to the result.

This is done using the standard [] and read_flat operators.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ standard_compound_add_impl()

template<typename E , typename R >
void etl::standard_evaluator::standard_compound_add_impl ( E &  expr,
R &  result 
)

Add the result of the expression to the result.

This is performed using standard computation with operator[].

Parameters
exprThe right hand side expression
resultThe left hand side

◆ standard_compound_div_impl()

template<typename E , typename R >
void etl::standard_evaluator::standard_compound_div_impl ( E &  expr,
R &  result 
)

Divide the result by the result of the expression.

This is performed using standard computation with operator[]

Parameters
exprThe right hand side expression
resultThe left hand side

◆ standard_compound_mul_impl()

template<typename E , typename R >
void etl::standard_evaluator::standard_compound_mul_impl ( E &  expr,
R &  result 
)

Multiply the result by the result of the expression.

This is performed with standard computation with operator[]

Parameters
exprThe right hand side expression
resultThe left hand side

◆ standard_compound_sub_impl()

template<typename E , typename R >
void etl::standard_evaluator::standard_compound_sub_impl ( E &  expr,
R &  result 
)

Subtract the result of the expression from the result.

This is performed using standard operator[].

Parameters
exprThe right hand side expression
resultThe left hand side

◆ sub_evaluate()

template<typename E , typename R >
void etl::standard_evaluator::sub_evaluate ( E &&  expr,
R &&  result 
)

Subtract the result of the expression from the result.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ sub_evaluate_no_gpu()

template<typename E , typename R >
void etl::standard_evaluator::sub_evaluate_no_gpu ( E &&  expr,
R &&  result 
)

Subtract the result of the expression from the result.

This does not consider the GPU.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ vectorized_assign_impl()

template<typename E , typename R >
void etl::standard_evaluator::vectorized_assign_impl ( E &  expr,
R &  result 
)

Assign the result of the expression to the result.

This is done using a vectorized computation and stored in memory, possibly in parallel.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ vectorized_compound_add_impl()

template<typename E , typename R >
void etl::standard_evaluator::vectorized_compound_add_impl ( E &  expr,
R &  result 
)

Add the result of the expression to the result.

This is performed using vectorized computation with, possibly in parallel.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ vectorized_compound_div_impl()

template<typename E , typename R >
void etl::standard_evaluator::vectorized_compound_div_impl ( E &  expr,
R &  result 
)

Divide the result by the result of the expression.

This is performed using vectorized computation into memory, possibly in parallel.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ vectorized_compound_mul_impl()

template<typename E , typename R >
void etl::standard_evaluator::vectorized_compound_mul_impl ( E &  expr,
R &  result 
)

Multiply the result by the result of the expression.

This is performed with vectorized computation into memory, possibly in parallel.

Parameters
exprThe right hand side expression
resultThe left hand side

◆ vectorized_compound_sub_impl()

template<typename E , typename R >
void etl::standard_evaluator::vectorized_compound_sub_impl ( E &  expr,
R &  result 
)

Subtract the result of the expression from the result.

This is performed using vectorized compution into memory, possibly in parallel.

Parameters
exprThe right hand side expression
resultThe left hand side