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

Method runSessionWithCallBackInfo

source/core/Interpreter.cpp:520–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520ErrorCode Interpreter::runSessionWithCallBackInfo(const Session* session, const TensorCallBackWithInfo& before,
521 const TensorCallBackWithInfo& callBack, bool sync) const {
522 std::unique_lock<std::mutex> _l(mNet->lock);
523#ifdef MNN_INTERNAL_ENABLED
524 Timer timer;
525#endif
526 _runSessionBegin(session);
527 ErrorCode errorcode = session->runWithCallBack(before, callBack, sync);
528 _runSessionEnd(session);
529#ifdef MNN_INTERNAL_ENABLED
530 if (shouldLog(FREQ_LOW)) {
531 waitSessionFinish(session);
532 float costTime = (float)timer.durationInUs() / (float)1000;
533 logForRunSession(session, costTime, "Interpreter::runSessionWithCallBackInfo");
534 }
535#endif // MNN_INTERNAL_ENABLED
536
537 return errorcode;
538}
539
540const Backend* Interpreter::getBackend(const Session* session, const Tensor* tensor) const {
541 return session->getBackEnd(tensor);

Callers 5

compareNetFunction · 0.80
test_mainFunction · 0.80
mainFunction · 0.80
runMethod · 0.80

Calls 4

_runSessionBeginFunction · 0.85
_runSessionEndFunction · 0.85
runWithCallBackMethod · 0.80
durationInUsMethod · 0.80

Tested by 2

test_mainFunction · 0.64
runMethod · 0.64