MCPcopy Create free account
hub / github.com/alibaba/MNN / allPathLegal

Function allPathLegal

codegen/OpFuse.cpp:253–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251 return x;
252}
253bool allPathLegal(Node* s, Node* t, MNNForwardType type) {
254 bool legal = true;
255 std::queue<Node*> q;
256 q.push(s);
257 while (!q.empty()) {
258 auto node = q.front();
259 q.pop();
260 legal &= isLegal(node->cmd, type);
261 if(!legal) {
262 return false;
263 }
264 for (auto succ : node->succ) {
265 if (succ != t) {
266 q.push(succ);
267 }
268 }
269 }
270 return legal;
271}
272std::vector<Node*> fuseNode(Node* root, std::vector<Node*>& edges, MNNForwardType type) {
273 std::vector<Node*> fuseSet;
274 std::queue<Node*> q;

Callers 1

fuseNodeFunction · 0.85

Calls 5

isLegalFunction · 0.85
pushMethod · 0.45
emptyMethod · 0.45
frontMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected