MCPcopy Index your code
hub / github.com/apache/tvm / _compile

Function _compile

tests/python/support/test_ccache.py:39–52  ·  view source on GitHub ↗
(f_create, text, output)

Source from the content-addressed store, hash-verified

37
38
39def _compile(f_create, text, output):
40 with tempfile.TemporaryDirectory() as temp_dir:
41 src_path = os.path.join(temp_dir, "src.cpp")
42 with open(src_path, "w", encoding="utf-8") as file:
43 file.write(_src_gen(text))
44 log_path = os.path.join(temp_dir, "log.txt")
45 ccache_env = {
46 "CCACHE_COMPILERCHECK": "content",
47 "CCACHE_LOGFILE": log_path,
48 }
49 f_create(output, ["src.cpp"], ["-c"], cwd=temp_dir, ccache_env=ccache_env)
50 with open(log_path, encoding="utf-8") as file:
51 log = file.read()
52 return log
53
54
55@pytest.mark.skipif(shutil.which("ccache") is None, reason="ccache not installed")

Callers 2

test_sharedFunction · 0.70
test_executableFunction · 0.70

Calls 4

_src_genFunction · 0.85
writeMethod · 0.65
readMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…