Skip to content

Commit

Permalink
[TESTS] Triage the testcases to fit the the new namespaces (#5071)
Browse files Browse the repository at this point in the history
* [TESTS] Triage the testcases to fit the naming convention of the new namespaces

* Remove multiple usage of system lib to avoid test problems
  • Loading branch information
tqchen authored Mar 15, 2020
1 parent e031641 commit f7488cc
Show file tree
Hide file tree
Showing 69 changed files with 3 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def verify(data):
tvm.testing.assert_allclose(out, verify(data), atol=1e-5)


def test_system_lib():
def test_cuda_lib():
ctx = tvm.gpu(0)
for device in ["llvm", "cuda"]:
if not tvm.runtime.enabled(device):
Expand All @@ -85,15 +85,10 @@ def test_system_lib():

from tvm.contrib import util
temp = util.tempdir()
fn_add = tvm.build(s, [A, B], target="cuda", target_host="llvm -system-lib", name="add")
path_obj = temp.relpath("add.o")
fn_add = tvm.build(s, [A, B], target="cuda", target_host="llvm", name="add")
path_lib = temp.relpath("deploy_lib.so")
fn_add.save(path_obj)
fn_add.export_library(path_lib)
# Load dll, will trigger system library registration
dll = ctypes.CDLL(path_lib)
# Load the system wide library
m = tvm.runtime.system_lib()
m = tvm.runtime.load_module(path_lib)
a = tvm.nd.array(np.random.uniform(size=nn).astype(A.dtype), ctx)
b = tvm.nd.array(np.zeros(nn, dtype=A.dtype), ctx)
m['add'](a, b)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f7488cc

Please sign in to comment.