Template Class GenerationVisitor

Class Documentation

template<typename NodeData, typename Context>
class GenerationVisitor

Visitor objects that will steer code generation while visiting a given expression/evaluation tree by triggering the corresponding callbacks in the provided Generator objects.

Public Types

using NodeID = std::decay_t<decltype(std::declval<ExportExpr>().id())>

Public Functions

inline GenerationVisitor(Generator<Context> &generator, Context &ctx, const std::unordered_map<NodeID, ExprPtr> &scalarFactors)
Parameters:
  • generator – The Generator to use

  • ctx – The Context to use

  • scalarFactors – A map of node IDs to a product of scalar factors that need to be multiplied with the result before storing the node

inline void operator()(const ExportNode<NodeData> &node, TreeTraversal context)
template<typename ExprType>
inline void load_or_create(const ExprType &expr, const bool isLeaf)
inline void load_or_create(const ExportNode<NodeData> &node)
inline void drop(const Expr &expr)
inline void process_computation(const ExportNode<NodeData> &node)