TiledArray  0.7.0
TiledArray::expressions::ExprEngine< Derived > Class Template Reference

Expression engine. More...

#include <expr_engine.h>

Inheritance diagram for TiledArray::expressions::ExprEngine< Derived >:
Collaboration diagram for TiledArray::expressions::ExprEngine< Derived >:

Public Types

typedef ExprEngine< Derived > ExprEngine_
 
typedef Derived derived_type
 The derived object type. More...
 
typedef EngineTrait< Derived >::value_type value_type
 Tensor value type. More...
 
typedef EngineTrait< Derived >::op_type op_type
 Tile operation type. More...
 
typedef EngineTrait< Derived >::policy policy
 The result policy type. More...
 
typedef EngineTrait< Derived >::dist_eval_type dist_eval_type
 This expression's distributed evaluator type. More...
 
typedef EngineTrait< Derived >::size_type size_type
 Size type. More...
 
typedef EngineTrait< Derived >::trange_type trange_type
 Tiled range type type. More...
 
typedef EngineTrait< Derived >::shape_type shape_type
 Tensor shape type. More...
 
typedef EngineTrait< Derived >::pmap_interface pmap_interface
 Process map interface type. More...
 

Public Member Functions

template<typename D >
 ExprEngine (const Expr< D > &expr)
 Default constructor. More...
 
void init (World &world, std::shared_ptr< pmap_interface > pmap, const VariableList &target_vars)
 Construct and initialize the expression engine. More...
 
void init_struct (const VariableList &target_vars)
 Initialize result tensor structure. More...
 
void init_distribution (World *world, const std::shared_ptr< pmap_interface > &pmap)
 Initialize result tensor distribution. More...
 
Permutation make_perm (const VariableList &target_vars) const
 Permutation factory function. More...
 
op_type make_op () const
 Tile operation factory function. More...
 
derived_typederived ()
 Cast this object to it's derived type. More...
 
const derived_typederived () const
 Cast this object to it's derived type. More...
 
World * world () const
 World accessor. More...
 
const VariableListvars () const
 Variable list accessor. More...
 
const Permutationperm () const
 Permutation accessor. More...
 
const trange_typetrange () const
 Tiled range accessor. More...
 
const shape_typeshape () const
 Shape accessor. More...
 
const std::shared_ptr< pmap_interface > & pmap () const
 Process map accessor. More...
 
void permute_tiles (const bool status)
 Set the permute tiles flag. More...
 
void print (ExprOStream &os, const VariableList &target_vars) const
 Expression print. More...
 
const char * make_tag () const
 Expression identification tag. More...
 

Protected Attributes

World * world_
 The world where this expression will be evaluated. More...
 
VariableList vars_
 The variable list of this expression. More...
 
bool permute_tiles_
 Result tile permutation flag (true == permute tile) More...
 
Permutation perm_
 The permutation that will be applied to the result. More...
 
trange_type trange_
 The tiled range of the result tensor. More...
 
shape_type shape_
 The shape of the result tensor. More...
 
std::shared_ptr< pmap_interfacepmap_
 The process map for the result tensor. More...
 
std::shared_ptr< EngineParamOverride< Derived > > override_ptr_
 The engine params overriding the default. More...
 

Detailed Description

template<typename Derived>
class TiledArray::expressions::ExprEngine< Derived >

Expression engine.

Definition at line 42 of file expr_engine.h.

Member Typedef Documentation

◆ derived_type

template<typename Derived>
typedef Derived TiledArray::expressions::ExprEngine< Derived >::derived_type

The derived object type.

Definition at line 45 of file expr_engine.h.

◆ dist_eval_type

template<typename Derived>
typedef EngineTrait<Derived>::dist_eval_type TiledArray::expressions::ExprEngine< Derived >::dist_eval_type

This expression's distributed evaluator type.

Definition at line 51 of file expr_engine.h.

◆ ExprEngine_

template<typename Derived>
typedef ExprEngine<Derived> TiledArray::expressions::ExprEngine< Derived >::ExprEngine_

Definition at line 44 of file expr_engine.h.

◆ op_type

template<typename Derived>
typedef EngineTrait<Derived>::op_type TiledArray::expressions::ExprEngine< Derived >::op_type

Tile operation type.

Definition at line 49 of file expr_engine.h.

◆ pmap_interface

template<typename Derived>
typedef EngineTrait<Derived>::pmap_interface TiledArray::expressions::ExprEngine< Derived >::pmap_interface

Process map interface type.

Definition at line 57 of file expr_engine.h.

◆ policy

template<typename Derived>
typedef EngineTrait<Derived>::policy TiledArray::expressions::ExprEngine< Derived >::policy

The result policy type.

Definition at line 50 of file expr_engine.h.

◆ shape_type

template<typename Derived>
typedef EngineTrait<Derived>::shape_type TiledArray::expressions::ExprEngine< Derived >::shape_type

Tensor shape type.

Definition at line 56 of file expr_engine.h.

◆ size_type

template<typename Derived>
typedef EngineTrait<Derived>::size_type TiledArray::expressions::ExprEngine< Derived >::size_type

Size type.

Definition at line 54 of file expr_engine.h.

◆ trange_type

template<typename Derived>
typedef EngineTrait<Derived>::trange_type TiledArray::expressions::ExprEngine< Derived >::trange_type

Tiled range type type.

Definition at line 55 of file expr_engine.h.

◆ value_type

template<typename Derived>
typedef EngineTrait<Derived>::value_type TiledArray::expressions::ExprEngine< Derived >::value_type

Tensor value type.

Definition at line 48 of file expr_engine.h.

Constructor & Destructor Documentation

◆ ExprEngine()

template<typename Derived>
template<typename D >
TiledArray::expressions::ExprEngine< Derived >::ExprEngine ( const Expr< D > &  expr)
inline

Default constructor.

All data members are initialized to NULL values.

Definition at line 78 of file expr_engine.h.

Member Function Documentation

◆ derived() [1/2]

template<typename Derived>
derived_type& TiledArray::expressions::ExprEngine< Derived >::derived ( )
inline

Cast this object to it's derived type.

Definition at line 186 of file expr_engine.h.

Here is the caller graph for this function:

◆ derived() [2/2]

template<typename Derived>
const derived_type& TiledArray::expressions::ExprEngine< Derived >::derived ( ) const
inline

Cast this object to it's derived type.

Definition at line 189 of file expr_engine.h.

◆ init()

template<typename Derived>
void TiledArray::expressions::ExprEngine< Derived >::init ( World &  world,
std::shared_ptr< pmap_interface pmap,
const VariableList target_vars 
)
inline

Construct and initialize the expression engine.

This function will initialize all expression engines in the expression graph. The init_vars(), init_struct(), and init_distribution() will be called for each node and leaf of the graph in that order.

Parameters
worldThe world where the expression will be evaluated
pmapThe process map for the result tensor (may be NULL)
target_varsThe target variable list of the result tensor

Definition at line 92 of file expr_engine.h.

◆ init_distribution()

template<typename Derived>
void TiledArray::expressions::ExprEngine< Derived >::init_distribution ( World *  world,
const std::shared_ptr< pmap_interface > &  pmap 
)
inline

Initialize result tensor distribution.

This function will initialize the world and process map for the result tensor. Derived classes may customize this function by providing their own implementation it.

Parameters
worldThe world were the result will be distributed
pmapThe process map for the result tensor tiles

Definition at line 151 of file expr_engine.h.

Here is the caller graph for this function:

◆ init_struct()

template<typename Derived>
void TiledArray::expressions::ExprEngine< Derived >::init_struct ( const VariableList target_vars)
inline

Initialize result tensor structure.

This function will initialize the permutation, tiled range, and shape for the result tensor. These members are initialized with the make_perm(), make_trange(), and make_shape() functions. Derived classes may customize the structure initialization by providing their own implementation of this function or any of the above initialization. functions.

Parameters
target_varsThe target variable list for the result tensor

Definition at line 130 of file expr_engine.h.

Here is the caller graph for this function:

◆ make_op()

template<typename Derived>
op_type TiledArray::expressions::ExprEngine< Derived >::make_op ( ) const
inline

Tile operation factory function.

This function will generate the tile operations by calling make_tile_op(). The permuting or non-permuting version of the tile operation will be selected based on permute_tiles(). Derived classes may customize this function by providing their own implementation it.

Definition at line 178 of file expr_engine.h.

Here is the caller graph for this function:

◆ make_perm()

template<typename Derived>
Permutation TiledArray::expressions::ExprEngine< Derived >::make_perm ( const VariableList target_vars) const
inline

Permutation factory function.

This function will generate the permutation that will be applied to the result tensor. Derived classes may customize this function by providing their own implementation it.

Definition at line 168 of file expr_engine.h.

Here is the caller graph for this function:

◆ make_tag()

template<typename Derived>
const char* TiledArray::expressions::ExprEngine< Derived >::make_tag ( ) const
inline

Expression identification tag.

Returns
An expression tag used to identify this expression

Definition at line 242 of file expr_engine.h.

◆ perm()

template<typename Derived>
const Permutation& TiledArray::expressions::ExprEngine< Derived >::perm ( ) const
inline

Permutation accessor.

Returns
A const reference to the permutation

Definition at line 204 of file expr_engine.h.

Here is the caller graph for this function:

◆ permute_tiles()

template<typename Derived>
void TiledArray::expressions::ExprEngine< Derived >::permute_tiles ( const bool  status)
inline

Set the permute tiles flag.

Parameters
statusThe new status for permute tiles (true == permtue result tiles)

Definition at line 224 of file expr_engine.h.

◆ pmap()

template<typename Derived>
const std::shared_ptr<pmap_interface>& TiledArray::expressions::ExprEngine< Derived >::pmap ( ) const
inline

Process map accessor.

Returns
A const reference to the process map

Definition at line 219 of file expr_engine.h.

Here is the caller graph for this function:

◆ print()

template<typename Derived>
void TiledArray::expressions::ExprEngine< Derived >::print ( ExprOStream os,
const VariableList target_vars 
) const
inline

Expression print.

Parameters
osThe output stream
target_varsThe target variable list for this expression

Definition at line 230 of file expr_engine.h.

Here is the caller graph for this function:

◆ shape()

template<typename Derived>
const shape_type& TiledArray::expressions::ExprEngine< Derived >::shape ( ) const
inline

Shape accessor.

Returns
A const reference to the tiled range

Definition at line 214 of file expr_engine.h.

Here is the caller graph for this function:

◆ trange()

template<typename Derived>
const trange_type& TiledArray::expressions::ExprEngine< Derived >::trange ( ) const
inline

Tiled range accessor.

Returns
A const reference to the tiled range

Definition at line 209 of file expr_engine.h.

Here is the caller graph for this function:

◆ vars()

template<typename Derived>
const VariableList& TiledArray::expressions::ExprEngine< Derived >::vars ( ) const
inline

Variable list accessor.

Returns
A const reference to the variable list

Definition at line 199 of file expr_engine.h.

Here is the caller graph for this function:

◆ world()

template<typename Derived>
World* TiledArray::expressions::ExprEngine< Derived >::world ( ) const
inline

World accessor.

Returns
A pointer to world

Definition at line 194 of file expr_engine.h.

Here is the caller graph for this function:

Member Data Documentation

◆ override_ptr_

template<typename Derived>
std::shared_ptr<EngineParamOverride<Derived> > TiledArray::expressions::ExprEngine< Derived >::override_ptr_
protected

The engine params overriding the default.

Definition at line 70 of file expr_engine.h.

◆ perm_

template<typename Derived>
Permutation TiledArray::expressions::ExprEngine< Derived >::perm_
protected

The permutation that will be applied to the result.

Definition at line 66 of file expr_engine.h.

◆ permute_tiles_

template<typename Derived>
bool TiledArray::expressions::ExprEngine< Derived >::permute_tiles_
protected

Result tile permutation flag (true == permute tile)

Definition at line 65 of file expr_engine.h.

◆ pmap_

template<typename Derived>
std::shared_ptr<pmap_interface> TiledArray::expressions::ExprEngine< Derived >::pmap_
protected

The process map for the result tensor.

Definition at line 69 of file expr_engine.h.

◆ shape_

template<typename Derived>
shape_type TiledArray::expressions::ExprEngine< Derived >::shape_
protected

The shape of the result tensor.

Definition at line 68 of file expr_engine.h.

◆ trange_

template<typename Derived>
trange_type TiledArray::expressions::ExprEngine< Derived >::trange_
protected

The tiled range of the result tensor.

Definition at line 67 of file expr_engine.h.

◆ vars_

template<typename Derived>
VariableList TiledArray::expressions::ExprEngine< Derived >::vars_
protected

The variable list of this expression.

Definition at line 64 of file expr_engine.h.

◆ world_

template<typename Derived>
World* TiledArray::expressions::ExprEngine< Derived >::world_
protected

The world where this expression will be evaluated.

Definition at line 63 of file expr_engine.h.


The documentation for this class was generated from the following file: