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

Function check_llvm

tests/python/runtime/test_runtime_module_load.py:172–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170 mod2 = tvm.IRModule.from_expr(te.create_prim_func([A, B]).with_attr("global_symbol", "myadd2"))
171
172 def check_llvm():
173 dev = tvm.cpu(0)
174 temp = utils.tempdir()
175 fadd1 = tvm.tirx.build(mod1, "llvm")
176 fadd2 = tvm.tirx.build(mod2, "llvm")
177 path1 = temp.relpath("myadd1.o")
178 path2 = temp.relpath("myadd2.o")
179 path_dso = temp.relpath("mylib.so")
180 fadd1.write_to_file(path1)
181 fadd2.write_to_file(path2)
182 # create shared library with multiple functions
183 cc.create_shared(path_dso, [path1, path2])
184 m = tvm.runtime.load_module(path_dso)
185 fadd1 = m["myadd1"]
186 fadd2 = m["myadd2"]
187 a = tvm.runtime.tensor(np.random.uniform(size=nn).astype(A.dtype), dev)
188 b = tvm.runtime.tensor(np.zeros(nn, dtype=A.dtype), dev)
189 fadd1(a, b)
190 np.testing.assert_equal(b.numpy(), a.numpy() + 1)
191 fadd2(a, b)
192 np.testing.assert_equal(b.numpy(), a.numpy() + 1)
193
194 def check_system_lib():
195 dev = tvm.cpu(0)

Callers 1

test_combine_module_llvmFunction · 0.70

Calls 8

relpathMethod · 0.80
uniformMethod · 0.80
numpyMethod · 0.80
cpuMethod · 0.45
buildMethod · 0.45
load_moduleMethod · 0.45
astypeMethod · 0.45
zerosMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…