Skip to content

Commit f9e6018

Browse files
author
Krzysztof Parzyszek
authored
[Runtime] Make export_library parameters after file_name keyword-only (#15658)
This makes the code a bit more readable at a little cost.
1 parent 022299b commit f9e6018

File tree

34 files changed

+45
-42
lines changed

34 files changed

+45
-42
lines changed

apps/android_camera/models/prepare_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def main(model_str, output_path):
100100
with tvm.transform.PassContext(opt_level=3):
101101
graph, lib, params = relay.build(net, tvm.target.Target(target, target_host), params=params)
102102
print("dumping lib...")
103-
lib.export_library(output_path_str + "/" + "deploy_lib_cpu.so", ndk.create_shared)
103+
lib.export_library(output_path_str + "/" + "deploy_lib_cpu.so", fcompile=ndk.create_shared)
104104
print("dumping graph...")
105105
with open(output_path_str + "/" + "deploy_graph.json", "w") as f:
106106
f.write(graph)

apps/android_rpc/tests/android_rpc_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_rpc_module():
6464
s[B].pragma(xi, "parallel_barrier_when_finish")
6565
f = tvm.build(s, [A, B], target, name="myadd_cpu")
6666
path_dso_cpu = temp.relpath("cpu_lib.so")
67-
f.export_library(path_dso_cpu, ndk.create_shared)
67+
f.export_library(path_dso_cpu, fcompile=ndk.create_shared)
6868

6969
# Execute the portable graph on cpu target
7070
print("Run CPU test ...")
@@ -88,7 +88,7 @@ def test_rpc_module():
8888
# If we don't want to do metal and only use cpu, just set target to be target
8989
f = tvm.build(s, [A, B], tvm.target.Target("opencl", host=target), name="myadd")
9090
path_dso_cl = temp.relpath("dev_lib_cl.so")
91-
f.export_library(path_dso_cl, ndk.create_shared)
91+
f.export_library(path_dso_cl, fcompile=ndk.create_shared)
9292

9393
print("Run GPU(OpenCL Flavor) test ...")
9494
dev = remote.cl(0)
@@ -111,7 +111,7 @@ def test_rpc_module():
111111
# If we don't want to do metal and only use cpu, just set target to be target
112112
f = tvm.build(s, [A, B], tvm.target.Target("vulkan", host=target), name="myadd")
113113
path_dso_vulkan = temp.relpath("dev_lib_vulkan.so")
114-
f.export_library(path_dso_vulkan, ndk.create_shared)
114+
f.export_library(path_dso_vulkan, fcompile=ndk.create_shared)
115115

116116
print("Run GPU(Vulkan Flavor) test ...")
117117
dev = remote.vulkan(0)

apps/benchmark/adreno/adreno_gpu_bench_clml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def evaluate_network(network, target, target_host, dtype, repeat):
224224
tmp = tempdir()
225225

226226
filename = "%s.so" % network
227-
lib.export_library(tmp.relpath(filename), ndk.create_shared)
227+
lib.export_library(tmp.relpath(filename), fcompile=ndk.create_shared)
228228

229229
# upload library and params
230230
print_progress("%-20s uploading..." % network)

apps/benchmark/adreno/adreno_gpu_bench_texture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def evaluate_network(network, target, target_host, dtype, repeat):
220220
tmp = tempdir()
221221

222222
filename = "%s.so" % network
223-
lib.export_library(tmp.relpath(filename), ndk.create_shared)
223+
lib.export_library(tmp.relpath(filename), fcompile=ndk.create_shared)
224224

225225
# upload library and params
226226
print_progress("%-20s uploading..." % network)

apps/benchmark/arm_cpu_imagenet_bench.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def evaluate_network(network, target, target_host, repeat):
4747
from tvm.contrib import ndk
4848

4949
filename = "%s.so" % network
50-
lib.export_library(tmp.relpath(filename), ndk.create_shared)
50+
lib.export_library(tmp.relpath(filename), fcompile=ndk.create_shared)
5151
else:
5252
filename = "%s.tar" % network
5353
lib.export_library(tmp.relpath(filename))

apps/benchmark/mobile_gpu_imagenet_bench.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def evaluate_network(network, target, target_host, dtype, repeat):
4747
from tvm.contrib import ndk
4848

4949
filename = "%s.so" % network
50-
lib.export_library(tmp.relpath(filename), ndk.create_shared)
50+
lib.export_library(tmp.relpath(filename), fcompile=ndk.create_shared)
5151
else:
5252
filename = "%s.tar" % network
5353
lib.export_library(tmp.relpath(filename))

apps/hexagon_launcher/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ lowered = tvm.relay.build(
186186
executor=Executor("aot", {"unpacked-api": False, "interface-api": "packed"}),
187187
)
188188
189-
lowered.export_library("model-aot.so", tvm.contrib.hexagon.link_shared)
189+
lowered.export_library("model-aot.so", fcompile=tvm.contrib.hexagon.link_shared)
190190
```
191191

192192

apps/ios_rpc/tests/ios_rpc_mobilenet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def run(mod, target):
9898
mod, target=tvm.target.Target(target, host=target_host), params=params
9999
)
100100
path_dso = temp.relpath("deploy.dylib")
101-
lib.export_library(path_dso, xcode.create_dylib, arch=arch, sdk=sdk)
101+
lib.export_library(path_dso, fcompile=xcode.create_dylib, arch=arch, sdk=sdk)
102102

103103
# connect to the proxy
104104
if mode == "tracker":

apps/ios_rpc/tests/ios_rpc_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_rpc_module(host, port, key, mode):
5858
# If we don't want to do metal and only use cpu, just set target to be target
5959
f = tvm.build(s, [A, B], tvm.target.Target("metal", host=target), name="myadd")
6060
path_dso1 = temp.relpath("dev_lib.dylib")
61-
f.export_library(path_dso1, xcode.create_dylib, arch=arch, sdk=sdk)
61+
f.export_library(path_dso1, fcompile=xcode.create_dylib, arch=arch, sdk=sdk)
6262

6363
s = te.create_schedule(B.op)
6464
xo, xi = s[B].split(B.op.axis[0], factor=64)
@@ -67,7 +67,7 @@ def test_rpc_module(host, port, key, mode):
6767
s[B].pragma(xi, "parallel_barrier_when_finish")
6868
f = tvm.build(s, [A, B], target, name="myadd_cpu")
6969
path_dso2 = temp.relpath("cpu_lib.dylib")
70-
f.export_library(path_dso2, xcode.create_dylib, arch=arch, sdk=sdk)
70+
f.export_library(path_dso2, fcompile=xcode.create_dylib, arch=arch, sdk=sdk)
7171

7272
# connect to the proxy
7373
if mode == "tracker":

apps/topi_recipe/gemm/android_gemm_square.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_gemm_gpu(N, times, bn, num_block, num_thread):
123123
f = tvm.build(s, [A, B, C], tvm.target.Target("opencl", host=target), name="gemm_gpu")
124124
temp = utils.tempdir()
125125
path_dso = temp.relpath("gemm_gpu.so")
126-
f.export_library(path_dso, ndk.create_shared)
126+
f.export_library(path_dso, fcompile=ndk.create_shared)
127127

128128
# connect to the proxy
129129
remote = rpc.connect(proxy_host, proxy_port, key=key)

0 commit comments

Comments
 (0)