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

Function popen_check

tests/python/codegen/test_target_codegen_blob.py:81–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79 cc.create_shared(path_dso, ["-Wl,--whole-archive", pathAll, "-Wl,--no-whole-archive"])
80
81 def popen_check():
82 # Load dll, will trigger system library registration
83 ctypes.CDLL(path_dso)
84 # Load the system wide library
85 dev = tvm.cuda()
86 a_np = np.random.uniform(size=12).astype("float32")
87 a_nd = tvm.runtime.tensor(a_np, dev)
88 b_nd = tvm.runtime.tensor(a_np, dev)
89 syslibA = tvm.runtime.system_lib("modA_")
90 syslibB = tvm.runtime.system_lib("modB_")
91 # reload same lib twice
92 syslibA = tvm.runtime.system_lib("modA_")
93 syslibA["my_inplace_update"](a_nd)
94 syslibB["my_inplace_update"](b_nd)
95 np.testing.assert_equal(a_nd.numpy(), a_np + 1)
96 np.testing.assert_equal(b_nd.numpy(), a_np + 2)
97
98 # system lib should be loaded in different process
99 worker = popen_pool.PopenWorker()

Callers

nothing calls this directly

Calls 5

uniformMethod · 0.80
system_libMethod · 0.80
numpyMethod · 0.80
cudaMethod · 0.45
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…