MCPcopy Create free account
hub / github.com/OAID/Tengine / CheckBind

Function CheckBind

executor/lib/custom_kernel.cpp:130–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130static bool CheckBind(Node* node, struct custom_kernel_ops* ops)
131{
132 /* prepare tensors */
133 int input_num = node->GetInputNum();
134 int output_num = node->GetOutputNum();
135
136 struct custom_kernel_tensor** k_inputs;
137 struct custom_kernel_tensor** k_outputs;
138
139 if(!PrepareTensors(node, k_inputs, input_num, k_outputs, output_num))
140 {
141 ReleaseTensors(node, k_inputs, input_num, k_outputs, output_num);
142 return false;
143 }
144
145 int ret = ops->bind(ops, ( const struct custom_kernel_tensor** )k_inputs, input_num,
146 ( const struct custom_kernel_tensor** )k_outputs, output_num);
147
148 ReleaseTensors(node, k_inputs, input_num, k_outputs, output_num);
149
150 if(ret < 0)
151 return false;
152
153 return true;
154}
155
156NodeOps* BindOps(Node* node, const std::string& dev_name)
157{

Callers 1

BindOpsFunction · 0.85

Calls 4

PrepareTensorsFunction · 0.85
ReleaseTensorsFunction · 0.85
GetInputNumMethod · 0.45
GetOutputNumMethod · 0.45

Tested by

no test coverage detected