| 64 | int seqLen = 0; |
| 65 | }; |
| 66 | static void _computeTensorMask(SubModuleInfo& m, const Net* net) { |
| 67 | /**Compute All SubModule's inputs and outputs*/ |
| 68 | // 0: not use, 1: input, 2: output, 3: mid, 4: valid output |
| 69 | m.tensorMask = std::vector<uint8_t>(net->tensorName()->size(), 0); |
| 70 | auto& tensorMask = m.tensorMask; |
| 71 | for (auto opIndex : m.opList) { |
| 72 | auto op = net->oplists()->GetAs<Op>(opIndex); |
| 73 | if (nullptr != op->inputIndexes()) { |
| 74 | for (int v=0; v<op->inputIndexes()->size(); ++v) { |
| 75 | auto index = op->inputIndexes()->data()[v]; |
| 76 | tensorMask[index] = tensorMask[index] | 1; |
| 77 | } |
| 78 | } |
| 79 | if (nullptr != op->outputIndexes()) { |
| 80 | for (int v=0; v<op->outputIndexes()->size(); ++v) { |
| 81 | auto index = op->outputIndexes()->data()[v]; |
| 82 | tensorMask[index] = tensorMask[index] | 2; |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | static bool _npuSupportOp(const Op* op) { |
| 88 | if (gMaxKVSize > 0) { |
| 89 | return true; |
no test coverage detected