MCPcopy Create free account
hub / github.com/Tencent/embedx / RunMultiThread

Method RunMultiThread

src/tools/graph/main_util.cc:59–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59bool MainUtil::RunMultiThread(const std::string& in, const std::string& out,
60 int thread_num) {
61 DXINFO("Runing %s...", task_name());
62
63 vec_str_t in_files;
64 if (!io_util::ListFile(in, &in_files)) {
65 return false;
66 }
67
68 MakeDir(out);
69
70 thread_num = std::min(thread_num, (int)in_files.size());
71 if (!io_util::ParallelProcess<std::string>(
72 in_files,
73 [this, &out](const vec_str_t& in_files, int thread_id) {
74 return RunEntry(thread_id, in_files, out);
75 },
76 thread_num)) {
77 DXERROR("Failed to run %s.", task_name());
78 return false;
79 }
80
81 DXINFO("Done.");
82 return true;
83}
84
85bool MainUtil::DumpText(deepx_core::AutoOutputFileStream& ofs /* NOLINT */,
86 std::ostringstream& oss /* NOLINT*/,

Callers 3

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 2

ListFileFunction · 0.85
MakeDirFunction · 0.85

Tested by

no test coverage detected