()
| 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() |
nothing calls this directly
no test coverage detected
searching dependent graphs…