| 48 | } |
| 49 | |
| 50 | static void writeThresholdRealtime(const std::string& opName, float thresholdValue) { |
| 51 | std::lock_guard<std::mutex> lock(thresholdFileMutex); |
| 52 | |
| 53 | if (!thresholdFile.is_open()) { |
| 54 | initThresholdFile(currentThresholdFile); |
| 55 | } |
| 56 | |
| 57 | if (thresholdFile.is_open()) { |
| 58 | if (!isFirstThreshold) { |
| 59 | thresholdFile << ",\n"; |
| 60 | } |
| 61 | |
| 62 | thresholdFile << " \"" << opName << "\": " << thresholdValue; |
| 63 | thresholdFile.flush(); |
| 64 | isFirstThreshold = false; |
| 65 | |
| 66 | MNN_PRINT("Saved threshold: %s = %f\n", opName.c_str(), thresholdValue); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | static std::ofstream maxValueFile; |
| 71 | static std::mutex maxValueFileMutex; |
no test coverage detected