Commit 50e9d327 by alex-weaver Committed by Tianqi Chen

Run C++ TOPI tests in Jenkins build (#870)

* Added +x permission to task_cpp_topi.sh. Added C++ topi tests to Jenkinsfile

* Fixed test_topi_math.py

* Minor style fix
parent fbb472b8
...@@ -224,6 +224,9 @@ stage('Unit Test') { ...@@ -224,6 +224,9 @@ stage('Unit Test') {
timeout(time: max_time, unit: 'MINUTES') { timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} cpu ./tests/scripts/task_cpp_unittest.sh" sh "${docker_run} cpu ./tests/scripts/task_cpp_unittest.sh"
} }
timeout(time: max_time, unit: 'MINUTES') {
sh "${docker_run} cpu ./tests/scripts/task_cpp_topi.sh"
}
} }
} }
}, },
......
File mode changed from 100644 to 100755
...@@ -21,7 +21,7 @@ def test_ewise(): ...@@ -21,7 +21,7 @@ def test_ewise():
B = func(A) B = func(A)
assert tuple(B.shape) == tuple(A.shape) assert tuple(B.shape) == tuple(A.shape)
assert B.op.body[0].name == name assert B.op.body[0].name == name
a_np = np.random.uniform(size=shape).astype(A.dtype) a_np = np.random.uniform(low=1e-5, size=shape).astype(A.dtype)
a_np = np.abs(a_np) a_np = np.abs(a_np)
b_np = f_numpy(a_np) b_np = f_numpy(a_np)
...@@ -37,7 +37,7 @@ def test_ewise(): ...@@ -37,7 +37,7 @@ def test_ewise():
b = tvm.nd.array(np.zeros_like(b_np), ctx) b = tvm.nd.array(np.zeros_like(b_np), ctx)
foo = tvm.build(s, [A, B], device, name=name) foo = tvm.build(s, [A, B], device, name=name)
foo(a, b) foo(a, b)
np.testing.assert_allclose(b.asnumpy(), b_np, rtol=1e-5) np.testing.assert_allclose(b.asnumpy(), b_np, rtol=1e-5, atol=1e-5)
for device in ['cuda', 'opencl', 'metal', 'rocm', 'vulkan', 'llvm']: for device in ['cuda', 'opencl', 'metal', 'rocm', 'vulkan', 'llvm']:
check_device(device) check_device(device)
......
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