This is an automated email from the ASF dual-hosted git repository.

junrushao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new cf081d9929 [BugFix][CPP] Fix cpp deploy bug (#15773)
cf081d9929 is described below

commit cf081d992992b191ebad4256f7a915b2c7368185
Author: HinGwenWoong <[email protected]>
AuthorDate: Thu Sep 28 09:28:40 2023 +0800

    [BugFix][CPP] Fix cpp deploy bug (#15773)
    
    ## Motivation
    
    Fix bug when using `apps/howto_deploy/run_example.sh`, it will cause `core 
dumped`
    
    
![image](https://github.com/apache/tvm/assets/25873202/a55b40ba-0f28-4c75-b216-591c6008734f)
    
    After fixed, all test pass.
    
    
![image](https://github.com/apache/tvm/assets/25873202/61db50eb-77a2-43b4-9cf4-1f24aba49b67)
    
    
    ## Modification
    
    Add runtime for `tvm.build`
---
 apps/howto_deploy/prepare_test_libs.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/apps/howto_deploy/prepare_test_libs.py 
b/apps/howto_deploy/prepare_test_libs.py
index f5afc5bf67..45d7c0abd9 100644
--- a/apps/howto_deploy/prepare_test_libs.py
+++ b/apps/howto_deploy/prepare_test_libs.py
@@ -33,7 +33,13 @@ def prepare_test_libs(base_path):
     fadd_dylib.export_library(dylib_path)
 
     # Compile library in system library mode
-    fadd_syslib = tvm.build(s, [A, B], "llvm", name="addonesys")
+    fadd_syslib = tvm.build(
+        s,
+        [A, B],
+        "llvm",
+        name="addonesys",
+        runtime=relay.backend.Runtime("cpp", {"system-lib": True}),
+    )
     syslib_path = os.path.join(base_path, "test_addone_sys.o")
     fadd_syslib.save(syslib_path)
 

Reply via email to