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

Function _initTimeTrace

tools/cpp/ExprDebug.hpp:205–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203};
204static TimeTraceInfo* gTimeTraceInfo = nullptr;
205static 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
222template<typename T>
223std::tuple<float, float, float> _countTensor(MNN::Tensor* tensor) {

Callers 2

mainFunction · 0.85
initRuntimeMethod · 0.85

Calls 4

setCallBackMethod · 0.80
beginMethod · 0.45
waitMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected