MCPcopy Create free account
hub / github.com/ablab/spades / get_threadpool_strategy

Method get_threadpool_strategy

ext/src/llvm/Threading.cpp:136–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134#endif
135
136Optional<ThreadPoolStrategy>
137llvm::get_threadpool_strategy(StringRef Num, ThreadPoolStrategy Default) {
138 if (Num == "all")
139 return llvm::hardware_concurrency();
140 if (Num.empty())
141 return Default;
142 unsigned V;
143 if (Num.getAsInteger(10, V))
144 return None; // malformed 'Num' value
145 if (V == 0)
146 return Default;
147
148 // Do not take the Default into account. This effectively disables
149 // heavyweight_hardware_concurrency() if the user asks for any number of
150 // threads on the cmd-line.
151 ThreadPoolStrategy S = llvm::hardware_concurrency();
152 S.ThreadsRequested = V;
153 return S;
154}

Callers

nothing calls this directly

Calls 3

hardware_concurrencyFunction · 0.85
emptyMethod · 0.45
getAsIntegerMethod · 0.45

Tested by

no test coverage detected