| 388 | |
| 389 | #ifdef MNN_INTERNAL_ENABLED |
| 390 | void Interpreter::logForRunSession(const Session* session, float timeInMs, const char* api) const { |
| 391 | int backendType[MNN_FORWARD_ALL]; |
| 392 | session->getInfo(MNN::Interpreter::BACKENDS, backendType); |
| 393 | float flops = 0.0f; |
| 394 | session->getInfo(MNN::Interpreter::FLOPS, &flops); |
| 395 | float memory = 0.0f; |
| 396 | session->getInfo(MNN::Interpreter::MEMORY, &memory); |
| 397 | std::map<std::string, std::string> metrics = logBasicInfo(); |
| 398 | metrics.emplace("ModelVersion", mNet->version); |
| 399 | metrics.emplace("UUID", mNet->uuid); |
| 400 | metrics.emplace("Backend", std::to_string(backendType[0])); // "Precision" is not logged here. Don't need it. |
| 401 | metrics.emplace("Time", std::to_string(timeInMs)); |
| 402 | metrics.emplace("API", api); |
| 403 | metrics.emplace("Flops", std::to_string(flops)); |
| 404 | metrics.emplace("Memory", std::to_string(memory)); |
| 405 | auto iter = mNet->sessionInfo.find(session); |
| 406 | if (iter != mNet->sessionInfo.end()) { |
| 407 | metrics.emplace("Precision", std::to_string(std::get<0>(iter->second))); |
| 408 | metrics.emplace("Mode", std::to_string(std::get<1>(iter->second))); |
| 409 | } |
| 410 | logAsync(metrics); |
| 411 | } |
| 412 | #endif |
| 413 | static void _runSessionBegin(const Session* session) { |
| 414 | auto& rt = session->getRuntime(); |