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

Function initThresholdFile

tools/cpp/getLinearInput.hpp:31–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31static void initThresholdFile(const std::string& filename = "thresholds.json") {
32 std::lock_guard<std::mutex> lock(thresholdFileMutex);
33
34 if (thresholdFile.is_open()) {
35 thresholdFile.close();
36 }
37
38 currentThresholdFile = filename;
39 thresholdFile.open(filename, std::ios::out);
40 if (thresholdFile.is_open()) {
41 thresholdFile << "{\n";
42 thresholdFile.flush();
43 isFirstThreshold = true;
44 MNN_PRINT("Initialized threshold file: %s\n", filename.c_str());
45 } else {
46 MNN_ERROR("Failed to open threshold file: %s\n", filename.c_str());
47 }
48}
49
50static void writeThresholdRealtime(const std::string& opName, float thresholdValue) {
51 std::lock_guard<std::mutex> lock(thresholdFileMutex);

Callers 2

writeThresholdRealtimeFunction · 0.85
initGetThresholdFunction · 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