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

Function _compile_cc

tests/python/relax/test_frontend_nn_extern_module.py:123–145  ·  view source on GitHub ↗
(src: Path, dst: Path)

Source from the content-addressed store, hash-verified

121
122
123def _compile_cc(src: Path, dst: Path):
124 cmd = ["g++", str(src)]
125 default_include_paths = [
126 tvm.libinfo.find_include_path(),
127 tvm_ffi.libinfo.find_include_path(),
128 tvm_ffi.libinfo.find_dlpack_include_path(),
129 ]
130 for include_path in default_include_paths:
131 cmd += ["-I", include_path]
132 cmd += [
133 "-c",
134 "-std=c++17",
135 "-fPIC",
136 "-o",
137 str(dst),
138 ]
139 with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) as proc:
140 (out, _) = proc.communicate()
141 if proc.returncode != 0:
142 msg = "Compilation error:\n"
143 msg += out.decode("utf-8", errors="replace")
144 msg += "\nCommand line: " + " ".join(cmd)
145 raise RuntimeError(msg)
146
147
148def test_extern_object():

Callers 1

test_extern_objectFunction · 0.85

Calls 3

strFunction · 0.85
decodeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…