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

Function popen_check

tests/python/relax/test_vm_build.py:1046–1056  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1044 cc.create_shared(path_dso, ["-Wl,--whole-archive", pathA, pathB, "-Wl,--no-whole-archive"])
1045
1046 def popen_check():
1047 # Load dll, will trigger system library registration
1048 ctypes.CDLL(path_dso)
1049 # Load the system wide library
1050 vmA = relax.VirtualMachine(tvm.runtime.system_lib("libA_"), tvm.cpu())
1051 vmB = relax.VirtualMachine(tvm.runtime.system_lib("libB_"), tvm.cpu())
1052
1053 retA = vmA["main"](tvm_ffi.Shape([1]))
1054 retB = vmB["main"](tvm_ffi.Shape([2]))
1055 np.testing.assert_equal(retA.numpy(), np.array([0, 0]).astype("float32"))
1056 np.testing.assert_equal(retB.numpy(), np.array([1, 1]).astype("float32"))
1057
1058 # system lib should be loaded in different process
1059 worker = popen_pool.PopenWorker()

Callers

nothing calls this directly

Calls 5

system_libMethod · 0.80
ShapeMethod · 0.80
numpyMethod · 0.80
cpuMethod · 0.45
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…