26 #ifndef TILEDARRAY_EXPRESSIONS_EXPR_ENGINE_H__INCLUDED 27 #define TILEDARRAY_EXPRESSIONS_EXPR_ENGINE_H__INCLUDED 33 namespace expressions {
36 template <
typename>
struct EngineParamOverride;
37 template <
typename>
class Expr;
41 template <
typename Derived>
69 std::shared_ptr<pmap_interface>
pmap_;
95 if(target_vars.
dim()) {
96 derived().init_vars(target_vars);
97 derived().init_struct(target_vars);
112 if((
typename pmap_interface::size_type(
world_->size()) !=
pmap_->procs()) ||
131 if(target_vars !=
vars_) {
152 const std::shared_ptr<pmap_interface>&
pmap)
182 return derived().make_tile_op();
219 const std::shared_ptr<pmap_interface>&
pmap()
const {
return pmap_; }
232 os <<
"[P " << target_vars <<
"]" << (
permute_tiles_ ?
" " :
" [no permute tiles] ")
249 #endif // TILEDARRAY_EXPRESSIONS_EXPR_ENGINE_H__INCLUDED EngineTrait< Derived >::pmap_interface pmap_interface
Process map interface type.
EngineTrait< Derived >::value_type value_type
Tensor value type.
EngineTrait< Derived >::size_type size_type
Size type.
std::shared_ptr< EngineParamOverride< Derived > > override_ptr_
The engine params overriding the default.
Derived derived_type
The derived object type.
const trange_type & trange() const
Tiled range accessor.
bool permute_tiles_
Result tile permutation flag (true == permute tile)
const Permutation & perm() const
Permutation accessor.
Permutation permutation(const V &other) const
Generate permutation relationship for variable lists.
Permutation make_perm(const VariableList &target_vars) const
Permutation factory function.
Scaling expression engine.
World * world() const
World accessor.
op_type make_op() const
Tile operation factory function.
const shape_type & shape() const
Shape accessor.
derived_type & derived()
Cast this object to it's derived type.
const std::shared_ptr< pmap_interface > & pmap() const
Process map accessor.
VariableList vars_
The variable list of this expression.
unsigned int dim() const
Returns the number of strings in the variable list.
const VariableList & vars() const
Variable list accessor.
void init_struct(const VariableList &target_vars)
Initialize result tensor structure.
EngineTrait< Derived >::trange_type trange_type
Tiled range type type.
ExprEngine(const Expr< D > &expr)
Default constructor.
EngineTrait< Derived >::shape_type shape_type
Tensor shape type.
Variable list manages a list variable strings.
const char * make_tag() const
Expression identification tag.
EngineTrait< Derived >::dist_eval_type dist_eval_type
This expression's distributed evaluator type.
std::shared_ptr< pmap_interface > pmap_
The process map for the result tensor.
Base class for expression evaluation.
EngineTrait< Derived >::policy policy
The result policy type.
World * world_
The world where this expression will be evaluated.
Permutation of a sequence of objects indexed by base-0 indices.
ExprEngine< Derived > ExprEngine_
Permutation perm_
The permutation that will be applied to the result.
void init_distribution(World *world, const std::shared_ptr< pmap_interface > &pmap)
Initialize result tensor distribution.
shape_type shape_
The shape of the result tensor.
Expression output stream.
void init(World &world, std::shared_ptr< pmap_interface > pmap, const VariableList &target_vars)
Construct and initialize the expression engine.
void permute_tiles(const bool status)
Set the permute tiles flag.
trange_type trange_
The tiled range of the result tensor.
void print(ExprOStream &os, const VariableList &target_vars) const
Expression print.
EngineTrait< Derived >::op_type op_type
Tile operation type.