Skip to content

Commit

Permalink
fix arduino tests, broken by apache#9246.
Browse files Browse the repository at this point in the history
  • Loading branch information
areusch committed Feb 22, 2022
1 parent 6905b17 commit 31da234
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,12 @@ def _disassemble_mlf(self, mlf_tar_path, source_dir):

# Copy C files from model. The filesnames and quantity
# depend on the target string, so we just copy all c files
include_dir = mlf_unpacking_dir / "codegen" / "host" / "include"
for file in include_dir.rglob("*.h"):
shutil.copy(file, model_dir)

source_dir = mlf_unpacking_dir / "codegen" / "host" / "src"
for file in source_dir.rglob(f"*.c"):
for file in source_dir.rglob("*.c"):
shutil.copy(file, model_dir)

# Return metadata.json for use in templating
Expand Down
2 changes: 1 addition & 1 deletion tests/micro/arduino/test_arduino_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_project_folder_structure(project_dir, project):
def test_project_model_integrity(project_dir, project):
model_dir = project_dir / "src" / "model"
assert _get_directory_elements(model_dir) == set(
["default_lib0.c", "default_lib1.c", "model.tar"]
["tvmgen_default.h", "default_lib0.c", "default_lib1.c", "model.tar"]
)


Expand Down
2 changes: 1 addition & 1 deletion tests/micro/arduino/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def make_kws_project(board, arduino_cli_cmd, tvm_debug, workspace_dir):
mod, params = relay.frontend.from_tflite(tflite_model)
target = tvm.target.target.micro(model)
runtime = Runtime("crt")
executor = Executor("aot", {"unpacked-api": True})
executor = Executor("aot", {"unpacked-api": True, "interface-api": "c"})

with tvm.transform.PassContext(opt_level=3, config={"tir.disable_vectorize": True}):
mod = relay.build(mod, target, runtime=runtime, executor=executor, params=params)
Expand Down

0 comments on commit 31da234

Please sign in to comment.