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

Function initMaxValueFile

tools/cpp/getLinearInput.hpp:85–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85static void initMaxValueFile(const std::string& filename = "max_values.json") {
86 std::lock_guard<std::mutex> lock(maxValueFileMutex);
87
88 if (maxValueFile.is_open()) {
89 maxValueFile.close();
90 }
91
92 currentMaxValueFile = filename;
93 maxValueFile.open(filename, std::ios::out);
94 if (maxValueFile.is_open()) {
95 maxValueFile << "{\n";
96 maxValueFile.flush();
97 isFirstMaxValue = true;
98 MNN_PRINT("Initialized max value file: %s\n", filename.c_str());
99 } else {
100 MNN_ERROR("Failed to open max value file: %s\n", filename.c_str());
101 }
102}
103
104static void writeMaxValueRealtime(const std::string& opName, float maxValueFloat) {
105 std::lock_guard<std::mutex> lock(maxValueFileMutex);

Callers 2

writeMaxValueRealtimeFunction · 0.85
initGetMaxValueFunction · 0.85

Calls 5

is_openMethod · 0.45
closeMethod · 0.45
openMethod · 0.45
flushMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected