| 518 | } |
| 519 | |
| 520 | ErrorCode 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 | |
| 540 | const Backend* Interpreter::getBackend(const Session* session, const Tensor* tensor) const { |
| 541 | return session->getBackEnd(tensor); |