| 113 | } |
| 114 | |
| 115 | void CustomOpNode::do_execute(ExecEnv& env) { |
| 116 | auto runner = [this]() { |
| 117 | std::shared_ptr<SmallVector<DeviceTensorND>> inputs = |
| 118 | std::make_shared<SmallVector<DeviceTensorND>>(); |
| 119 | std::shared_ptr<SmallVector<DeviceTensorND>> outputs = |
| 120 | std::make_shared<SmallVector<DeviceTensorND>>(); |
| 121 | for (size_t i = 0; i < input_num(); i++) { |
| 122 | inputs->emplace_back(input(i)->dev_tensor()); |
| 123 | } |
| 124 | for (size_t i = 0; i < output_num(); i++) { |
| 125 | outputs->emplace_back(output(i)->dev_tensor()); |
| 126 | } |
| 127 | |
| 128 | this->owner_graph()->event().signal_inplace<cg::event::BeforeKernel>( |
| 129 | this, m_comp_node); |
| 130 | m_comp_node.activate(); |
| 131 | custom::dispatch_custom_op(m_op, m_param, inputs, outputs); |
| 132 | this->owner_graph()->event().signal_inplace<cg::event::AfterKernel>( |
| 133 | this, m_comp_node); |
| 134 | }; |
| 135 | env.dispatch_on_comp_node(m_comp_node, runner); |
| 136 | } |
| 137 | |
| 138 | void CustomOpNode::init_output_static_infer_desc() { |
| 139 | using namespace std::placeholders; |
nothing calls this directly
no test coverage detected