VisionCpp
0.0.1
|
the root of the expression tree. More...
the root of the expression tree.
It is used to avoid extra creation of the shared memory for the LHS of the root node. The are two types of nodes that can be the root of the expression tree. ParallelCopy and assign. An expression tree can be evaluated in three ways, depending on the type of operation it represents. A global operation node represents that the operation requires to access the entire input or non-linear area of input to calculate an element of the output; a neighbour operation node requires to access a linear area of the input in order to calculate the output; and a point operation node requires a corresponding elements of the input to calculate an elements of the output. Therefore, we have tree types of Operations. GlobalNeighbourOP, NeighbourOP, PointOP. Thus, 6 specialisation of Evaluator template struct has been provided. In an expression tree with the mixed types of nodes following rules will be applied.
1) If an expression tree contains a combination of point and neighbour operations nodes, the neighbour operation will be used for the evaluation of the expression tree without splitting the expression tree into small sub-trees. In this case only one kernel will be executed.
2)If an expression tree has global operation node in the middle of the tree, the expression tree will be split in to 3 sub-trees. One before the global operation node; one is the global operation node; and one is the nodes after global expression node.
3) If the global operation is the root of the expression tree, the expression will be split in to two sub-trees.
4) If the child of the global operation node is a leaf node, the child will not be split in to a sub-tree. The eval struct has been specialised based on the operation types of the expression tree, in order to call the appropriate function.
These specialisation of Evaluator class are located in eval_root/eval_assign.hpp and eval_root/eval_partial_assign.hpp files. Typical usage:
Template parameters:
Offset | the starting offset of the output shared |
memories | inside the input tuple. |
Output_Index | the required step from offset in order to |
access | the output memory of the current expression |
LHS | the left-hand size expression |
RHS | then right-hand size expression |
internal::ops_category | the type of the operation |
LC | the shared memory column size |
LR | the shared memory row size |
Cols | output memory column size |
Rows | output memory row size |
LVL | the depth of the subexpression root in the expression tree |
LfType | the type of the output memory |
Loc | Coordinate of accessing a particular location |
Params | the input/output memories |
eval function parameters:
cOffset | Coordinate of accessing a particular location. |
t | tuple of input/output memories |
Definition at line 195 of file evaluator.hpp.