Created
December 19, 2018 17:13
-
-
Save ruslo/95f275de2b8effde94e22b5f02f03a31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tvm | |
import os | |
def prepare_test_libs(base_path): | |
n = tvm.var("n") | |
A = tvm.placeholder((n,), name='A') | |
B = tvm.compute(A.shape, lambda *i: A(*i) + 1.0, name='B') | |
s = tvm.create_schedule(B.op) | |
s[B].bind(B.op.axis[0], tvm.thread_axis("blockIdx.x")) | |
fadd_syslib = tvm.build(s, [A, B], "opencl --system-lib", name="addonesys") | |
syslib_path = os.path.join(base_path, "test_addone_sys.o") | |
fadd_syslib.save(syslib_path) | |
if __name__ == "__main__": | |
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) | |
prepare_test_libs(os.path.join(curr_path, "./lib")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment