Unverified Commit f7488ccf by Tianqi Chen Committed by GitHub

[TESTS] Triage the testcases to fit the the new namespaces (#5071)

* [TESTS] Triage the testcases to fit the naming convention of the new namespaces

* Remove multiple usage of system lib to avoid test problems
parent e0316415
...@@ -68,7 +68,7 @@ def test_resnet18(): ...@@ -68,7 +68,7 @@ def test_resnet18():
tvm.testing.assert_allclose(out, verify(data), atol=1e-5) tvm.testing.assert_allclose(out, verify(data), atol=1e-5)
def test_system_lib(): def test_cuda_lib():
ctx = tvm.gpu(0) ctx = tvm.gpu(0)
for device in ["llvm", "cuda"]: for device in ["llvm", "cuda"]:
if not tvm.runtime.enabled(device): if not tvm.runtime.enabled(device):
...@@ -85,15 +85,10 @@ def test_system_lib(): ...@@ -85,15 +85,10 @@ def test_system_lib():
from tvm.contrib import util from tvm.contrib import util
temp = util.tempdir() temp = util.tempdir()
fn_add = tvm.build(s, [A, B], target="cuda", target_host="llvm -system-lib", name="add") fn_add = tvm.build(s, [A, B], target="cuda", target_host="llvm", name="add")
path_obj = temp.relpath("add.o")
path_lib = temp.relpath("deploy_lib.so") path_lib = temp.relpath("deploy_lib.so")
fn_add.save(path_obj)
fn_add.export_library(path_lib) fn_add.export_library(path_lib)
# Load dll, will trigger system library registration m = tvm.runtime.load_module(path_lib)
dll = ctypes.CDLL(path_lib)
# Load the system wide library
m = tvm.runtime.system_lib()
a = tvm.nd.array(np.random.uniform(size=nn).astype(A.dtype), ctx) a = tvm.nd.array(np.random.uniform(size=nn).astype(A.dtype), ctx)
b = tvm.nd.array(np.zeros(nn, dtype=A.dtype), ctx) b = tvm.nd.array(np.zeros(nn, dtype=A.dtype), ctx)
m['add'](a, b) m['add'](a, b)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment