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

Function checkSystem

tools/cpp/MNN2QNNModel.cpp:133–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133static bool checkSystem() {
134#ifdef _WIN32
135 // On Windows, skip the system check as this tool is primarily for Linux
136 // but we allow it to compile on Windows for development purposes
137 MNN_PRINT("Warning: This tool is designed for x86_64 Linux systems. Running on Windows may have limitations.\n");
138 return true;
139#else
140 struct utsname buf;
141 if (uname(&buf) != 0) {
142 MNN_ERROR("uname error\n");
143 return false;
144 }
145 if (std::string(buf.sysname) == "Linux" && std::string(buf.machine) == "x86_64") {
146 return true;
147 }
148 MNN_ERROR("This program must be run on a x86_64 Linux system. Current system: %s %s\n", buf.sysname, buf.machine);
149 return false;
150#endif
151}
152
153int main(int argc, const char* argv[]) {
154 if (argc < 6) {

Callers 1

mainFunction · 0.85

Calls 1

stringFunction · 0.50

Tested by

no test coverage detected