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

Function writeThresholdRealtime

tools/cpp/getLinearInput.hpp:50–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50static 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
70static std::ofstream maxValueFile;
71static std::mutex maxValueFileMutex;

Callers 1

initGetThresholdFunction · 0.85

Calls 4

initThresholdFileFunction · 0.85
is_openMethod · 0.45
flushMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected