Class SingleCNOperatorNode

Inheritance Relationships

Base Type

Class Documentation

class mgb::cg::mixin::SingleCNOperatorNode : public mgb::cg::OperatorNodeMixinBase

mixin for opeators that work on a single computing node

Protected Types

using NodeProp = OperatorNodeBase::NodeProp
using ExecEnv = OperatorNodeBase::ExecEnv

Protected Functions

CompNode mixin_comp_node() const
NodeProp *mixin_do_make_node_prop(const OperatorNodeBase &opr) const

initialize NodeProp with SINGLE_COMP_NODE, and setup dependency on input

void mixin_do_execute(OperatorNodeBase &opr, OperatorNodeBase::ExecEnv &env)
void mixin_on_output_comp_node_stream_changed(OperatorNodeBase &opr)
void mixin_comp_node(OperatorNodeBase &opr, CompNode node)

set comp node during initializing

void scn_do_execute() = 0

override by subclass to perform raw computing; this function is already dispatched on corresponding stream in ExecEnv

~SingleCNOperatorNode() = default

Protected Static Functions

void mixin_init_output_comp_node(OperatorNodeBase &opr)

infer output comp node and update the comp node of all ouput vars

Note: the comp node stored in this mixin class is updated via mixin_on_output_comp_node_stream_changed(), which is called from opr.on_output_comp_node_stream_changed() invoked by this function.

CompNode mixin_infer_output_comp_node(const OperatorNodeBase &opr, bool cross_mem)

only infer output comp node, without modifying anything

This implementation uses the comp node from input, requiring that at least one input exists and they are all placed on the same comp node. It also checks the comp node set in config.