MCPcopy Create free account
hub / github.com/apache/tvm / get_target_by_dump_machine

Function get_target_by_dump_machine

python/tvm/support/cc.py:226–253  ·  view source on GitHub ↗

Functor of get_target_triple that can get the target triple using compiler. Parameters ---------- compiler : Optional[str] The compiler. Returns ------- out: Callable A function that can get target triple according to dumpmachine option of compiler.

(compiler)

Source from the content-addressed store, hash-verified

224
225
226def get_target_by_dump_machine(compiler):
227 """Functor of get_target_triple that can get the target triple using compiler.
228
229 Parameters
230 ----------
231 compiler : Optional[str]
232 The compiler.
233
234 Returns
235 -------
236 out: Callable
237 A function that can get target triple according to dumpmachine option of compiler.
238 """
239
240 def get_target_triple():
241 """Get target triple according to dumpmachine option of compiler."""
242 if compiler:
243 cmd = [compiler, "-dumpmachine"]
244 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
245 (out, _) = proc.communicate()
246 if proc.returncode != 0:
247 msg = "dumpmachine error:\n"
248 msg += out.decode("utf-8", errors="replace")
249 return None
250 return out.decode("utf-8", errors="replace")
251 return None
252
253 return get_target_triple
254
255
256# assign so as default output format

Callers 2

ndk.pyFile · 0.85
cc.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…