| 203 | }; |
| 204 | static TimeTraceInfo* gTimeTraceInfo = nullptr; |
| 205 | static void _initTimeTrace() { |
| 206 | static TimeTraceInfo gTime; |
| 207 | gTimeTraceInfo = &gTime; |
| 208 | MNN::TensorCallBackWithInfo beforeCallBack = [&](const std::vector<MNN::Tensor*>& ntensors, const MNN::OperatorInfo* info) { |
| 209 | gTimeTraceInfo->begin(info); |
| 210 | return true; |
| 211 | }; |
| 212 | MNN::TensorCallBackWithInfo callBack = [&](const std::vector<MNN::Tensor*>& ntensors, const MNN::OperatorInfo* info) { |
| 213 | for (auto t : ntensors) { |
| 214 | t->wait(MNN::Tensor::MAP_TENSOR_READ, true); |
| 215 | } |
| 216 | gTimeTraceInfo->end(info); |
| 217 | return true; |
| 218 | }; |
| 219 | MNN::Express::ExecutorScope::Current()->setCallBack(std::move(beforeCallBack), std::move(callBack)); |
| 220 | } |
| 221 | |
| 222 | template<typename T> |
| 223 | std::tuple<float, float, float> _countTensor(MNN::Tensor* tensor) { |
no test coverage detected