mlonmcu 0.3.0.dev0__3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mlonmcu/__init__.py +26 -0
- mlonmcu/artifact.py +172 -0
- mlonmcu/cli/__init__.py +19 -0
- mlonmcu/cli/build.py +119 -0
- mlonmcu/cli/cleanup.py +75 -0
- mlonmcu/cli/common.py +227 -0
- mlonmcu/cli/compile.py +87 -0
- mlonmcu/cli/env.py +68 -0
- mlonmcu/cli/export.py +93 -0
- mlonmcu/cli/flow.py +67 -0
- mlonmcu/cli/helper/__init__.py +18 -0
- mlonmcu/cli/helper/filter.py +25 -0
- mlonmcu/cli/helper/parse.py +159 -0
- mlonmcu/cli/init.py +130 -0
- mlonmcu/cli/load.py +87 -0
- mlonmcu/cli/main.py +116 -0
- mlonmcu/cli/models.py +48 -0
- mlonmcu/cli/run.py +56 -0
- mlonmcu/cli/setup.py +136 -0
- mlonmcu/cli/tune.py +48 -0
- mlonmcu/config.py +219 -0
- mlonmcu/context/__init__.py +22 -0
- mlonmcu/context/context.py +545 -0
- mlonmcu/context/read_write_filelock.py +327 -0
- mlonmcu/environment/__init__.py +18 -0
- mlonmcu/environment/config.py +214 -0
- mlonmcu/environment/environment.py +501 -0
- mlonmcu/environment/init.py +191 -0
- mlonmcu/environment/list.py +81 -0
- mlonmcu/environment/loader.py +250 -0
- mlonmcu/environment/templates.py +69 -0
- mlonmcu/environment/writer.py +117 -0
- mlonmcu/feature/__init__.py +18 -0
- mlonmcu/feature/feature.py +230 -0
- mlonmcu/feature/features.py +1537 -0
- mlonmcu/feature/type.py +33 -0
- mlonmcu/flow/__init__.py +61 -0
- mlonmcu/flow/backend.py +234 -0
- mlonmcu/flow/framework.py +69 -0
- mlonmcu/flow/tflm/__init__.py +23 -0
- mlonmcu/flow/tflm/backend/__init__.py +23 -0
- mlonmcu/flow/tflm/backend/backend.py +47 -0
- mlonmcu/flow/tflm/backend/tflmc.py +129 -0
- mlonmcu/flow/tflm/backend/tflmi.py +385 -0
- mlonmcu/flow/tflm/framework.py +81 -0
- mlonmcu/flow/tvm/__init__.py +23 -0
- mlonmcu/flow/tvm/backend/__init__.py +26 -0
- mlonmcu/flow/tvm/backend/backend.py +282 -0
- mlonmcu/flow/tvm/backend/model_info.py +307 -0
- mlonmcu/flow/tvm/backend/python_utils.py +36 -0
- mlonmcu/flow/tvm/backend/tuner.py +41 -0
- mlonmcu/flow/tvm/backend/tvmaot.py +162 -0
- mlonmcu/flow/tvm/backend/tvmaotplus.py +51 -0
- mlonmcu/flow/tvm/backend/tvmc_utils.py +172 -0
- mlonmcu/flow/tvm/backend/tvmcg.py +102 -0
- mlonmcu/flow/tvm/backend/tvmllvm.py +106 -0
- mlonmcu/flow/tvm/backend/tvmrt.py +151 -0
- mlonmcu/flow/tvm/backend/wrapper.py +645 -0
- mlonmcu/flow/tvm/framework.py +96 -0
- mlonmcu/logging.py +79 -0
- mlonmcu/mlonmcu.py +19 -0
- mlonmcu/models/__init__.py +31 -0
- mlonmcu/models/convert_data.py +107 -0
- mlonmcu/models/frontend.py +571 -0
- mlonmcu/models/group.py +29 -0
- mlonmcu/models/lookup.py +345 -0
- mlonmcu/models/metadata.py +133 -0
- mlonmcu/models/model.py +104 -0
- mlonmcu/models/options.py +64 -0
- mlonmcu/models/utils.py +136 -0
- mlonmcu/platform/__init__.py +27 -0
- mlonmcu/platform/_platform.py +46 -0
- mlonmcu/platform/espidf/__init__.py +25 -0
- mlonmcu/platform/espidf/espidf.py +489 -0
- mlonmcu/platform/espidf/espidf_target.py +257 -0
- mlonmcu/platform/lookup.py +126 -0
- mlonmcu/platform/microtvm/__init__.py +25 -0
- mlonmcu/platform/microtvm/microtvm.py +580 -0
- mlonmcu/platform/microtvm/microtvm_arduino_target.py +68 -0
- mlonmcu/platform/microtvm/microtvm_backend.py +64 -0
- mlonmcu/platform/microtvm/microtvm_espidf_target.py +94 -0
- mlonmcu/platform/microtvm/microtvm_etissvp_target.py +98 -0
- mlonmcu/platform/microtvm/microtvm_host_target.py +46 -0
- mlonmcu/platform/microtvm/microtvm_spike_target.py +230 -0
- mlonmcu/platform/microtvm/microtvm_target.py +189 -0
- mlonmcu/platform/microtvm/microtvm_template_target.py +55 -0
- mlonmcu/platform/microtvm/microtvm_zephyr_target.py +91 -0
- mlonmcu/platform/mlif/__init__.py +25 -0
- mlonmcu/platform/mlif/mlif.py +300 -0
- mlonmcu/platform/mlif/mlif_target.py +86 -0
- mlonmcu/platform/platform.py +244 -0
- mlonmcu/platform/tvm/__init__.py +25 -0
- mlonmcu/platform/tvm/tvm.py +429 -0
- mlonmcu/platform/tvm/tvm_backend.py +57 -0
- mlonmcu/platform/tvm/tvm_target.py +165 -0
- mlonmcu/platform/zephyr/__init__.py +25 -0
- mlonmcu/platform/zephyr/zephyr.py +450 -0
- mlonmcu/platform/zephyr/zephyr_target.py +110 -0
- mlonmcu/plugins.py +26 -0
- mlonmcu/report.py +99 -0
- mlonmcu/session/__init__.py +18 -0
- mlonmcu/session/postprocess/__init__.py +43 -0
- mlonmcu/session/postprocess/postprocess.py +62 -0
- mlonmcu/session/postprocess/postprocesses.py +487 -0
- mlonmcu/session/run.py +1008 -0
- mlonmcu/session/session.py +373 -0
- mlonmcu/setup/__init__.py +18 -0
- mlonmcu/setup/cache.py +147 -0
- mlonmcu/setup/gen_requirements.py +619 -0
- mlonmcu/setup/setup.py +285 -0
- mlonmcu/setup/task.py +380 -0
- mlonmcu/setup/tasks/__init__.py +40 -0
- mlonmcu/setup/tasks/arm_gcc.py +58 -0
- mlonmcu/setup/tasks/cmsisnn.py +151 -0
- mlonmcu/setup/tasks/common.py +36 -0
- mlonmcu/setup/tasks/corstone300.py +64 -0
- mlonmcu/setup/tasks/espidf.py +87 -0
- mlonmcu/setup/tasks/etiss.py +147 -0
- mlonmcu/setup/tasks/llvm.py +67 -0
- mlonmcu/setup/tasks/mlif.py +49 -0
- mlonmcu/setup/tasks/muriscvnn.py +166 -0
- mlonmcu/setup/tasks/pulp.py +192 -0
- mlonmcu/setup/tasks/riscv_gcc.py +146 -0
- mlonmcu/setup/tasks/spike.py +190 -0
- mlonmcu/setup/tasks/tf.py +92 -0
- mlonmcu/setup/tasks/tflite.py +59 -0
- mlonmcu/setup/tasks/tflmc.py +141 -0
- mlonmcu/setup/tasks/tvm.py +172 -0
- mlonmcu/setup/tasks/utvmcg.py +96 -0
- mlonmcu/setup/tasks/zephyr.py +119 -0
- mlonmcu/setup/utils.py +374 -0
- mlonmcu/target/__init__.py +37 -0
- mlonmcu/target/_target.py +41 -0
- mlonmcu/target/arm/__init__.py +3 -0
- mlonmcu/target/arm/corstone300.py +235 -0
- mlonmcu/target/arm/util.py +109 -0
- mlonmcu/target/common.py +194 -0
- mlonmcu/target/elf.py +256 -0
- mlonmcu/target/host_x86.py +84 -0
- mlonmcu/target/metrics.py +75 -0
- mlonmcu/target/riscv/__init__.py +7 -0
- mlonmcu/target/riscv/etiss_pulpino.py +462 -0
- mlonmcu/target/riscv/gvsoc_pulp.py +215 -0
- mlonmcu/target/riscv/ovpsim.py +301 -0
- mlonmcu/target/riscv/riscv.py +185 -0
- mlonmcu/target/riscv/riscv_qemu.py +166 -0
- mlonmcu/target/riscv/spike.py +243 -0
- mlonmcu/target/riscv/util.py +134 -0
- mlonmcu/target/target.py +200 -0
- mlonmcu/utils.py +49 -0
- mlonmcu/version.py +21 -0
- mlonmcu-0.3.0.dev0.dist-info/LICENSE +202 -0
- mlonmcu-0.3.0.dev0.dist-info/METADATA +343 -0
- mlonmcu-0.3.0.dev0.dist-info/NOTICE +8 -0
- mlonmcu-0.3.0.dev0.dist-info/RECORD +376 -0
- mlonmcu-0.3.0.dev0.dist-info/WHEEL +5 -0
- mlonmcu-0.3.0.dev0.dist-info/entry_points.txt +3 -0
- mlonmcu-0.3.0.dev0.dist-info/top_level.txt +1 -0
- resources/frameworks/tvm/crt_config/README.md +7 -0
- resources/frameworks/tvm/crt_config/crt_config.h +53 -0
- resources/frameworks/tvm/tuning_records/riscv_cpu_v0.01.log.best +46 -0
- resources/patches/fix_esp32c3_march.patch +20 -0
- resources/patches/pulp_freertos_support.patch +55 -0
- resources/platforms/espidf/micro_speech_esp32devboard/CMakeLists.txt +29 -0
- resources/platforms/espidf/micro_speech_esp32devboard/README.md +70 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/mlif2/CMakeLists.txt +78 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/mlif2/Kconfig +76 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/mlif2/default_data.c +26 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/mlif2/default_model_support/process_input.c +35 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/mlif2/default_model_support/process_output.c +45 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/mlif2/include/exit.h +26 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/mlif2/include/ml_interface.h +70 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/mlif2/include/printing.h +31 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/mlif2/ml_interface.c +74 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/mlif2/ml_interface_tflm.cc +64 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/mlif2/ml_interface_tvm.c +53 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/tflite-lib/CMakeLists.txt +140 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/tflite-lib/Kconfig +8 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/tvm-lib/CMakeLists.txt +66 -0
- resources/platforms/espidf/micro_speech_esp32devboard/components/tvm-lib/Kconfig +7 -0
- resources/platforms/espidf/micro_speech_esp32devboard/example_test.py +38 -0
- resources/platforms/espidf/micro_speech_esp32devboard/info.txt +9 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/CMakeLists.txt +58 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/audio_provider.cc +193 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/audio_provider.h +49 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/command_responder.cc +53 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/command_responder.h +35 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/feature_provider.cc +132 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/feature_provider.cc.orig +145 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/feature_provider.h +55 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/kissfft/COPYING +11 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/kissfft/_kiss_fft_guts.h +168 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/kissfft/kiss_fft.c +408 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/kissfft/kiss_fft.h +124 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/kissfft/tools/kiss_fftr.c +159 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/kissfft/tools/kiss_fftr.h +46 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/main.cc +63 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/main_functions.cc +204 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/main_functions.h +37 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/micro_features_generator.cc +121 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/micro_features_generator.h +38 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/micro_model_settings.cc +23 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/micro_model_settings.h +43 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/bits.h +102 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/fft.cc +52 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/fft.h +50 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/fft_util.cc +69 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/fft_util.h +34 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/filterbank.c +134 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/filterbank.h +63 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/filterbank_util.c +220 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/filterbank_util.h +50 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/frontend.c +72 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/frontend.h +64 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/frontend_util.c +85 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/frontend_util.h +52 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/kiss_fft_common.h +48 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/kiss_fft_int16.cc +8 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/kiss_fft_int16.h +34 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/log_lut.c +30 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/log_lut.h +40 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/log_scale.c +83 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/log_scale.h +39 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/log_scale_util.c +27 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/log_scale_util.h +45 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/noise_reduction.c +51 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/noise_reduction.h +46 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/noise_reduction_util.c +45 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/noise_reduction_util.h +50 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/pcan_gain_control.c +56 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/pcan_gain_control.h +47 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/pcan_gain_control_util.c +92 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/pcan_gain_control_util.h +57 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/window.c +70 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/window.h +49 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/window_util.c +73 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/microfrontend/lib/window_util.h +45 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/pins.c +14 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/pins.h +30 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/recognize_commands.cc +150 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/recognize_commands.h +173 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/ringbuf.c +333 -0
- resources/platforms/espidf/micro_speech_esp32devboard/main/ringbuf.h +74 -0
- resources/platforms/espidf/micro_speech_esp32devboard/sdkconfig.defaults +36 -0
- resources/platforms/espidf/project/CMakeLists.txt +29 -0
- resources/platforms/espidf/project/README.md +70 -0
- resources/platforms/espidf/project/components/mlif/CMakeLists.txt +77 -0
- resources/platforms/espidf/project/components/mlif/Kconfig +76 -0
- resources/platforms/espidf/project/components/mlif/default_data.c +26 -0
- resources/platforms/espidf/project/components/mlif/default_model_support/process_input.c +35 -0
- resources/platforms/espidf/project/components/mlif/default_model_support/process_output.c +45 -0
- resources/platforms/espidf/project/components/mlif/include/exit.h +26 -0
- resources/platforms/espidf/project/components/mlif/include/ml_interface.h +60 -0
- resources/platforms/espidf/project/components/mlif/include/printing.h +31 -0
- resources/platforms/espidf/project/components/mlif/ml_interface.c +54 -0
- resources/platforms/espidf/project/components/mlif/ml_interface_tflm.cc +40 -0
- resources/platforms/espidf/project/components/mlif/ml_interface_tvm.c +40 -0
- resources/platforms/espidf/project/components/tflite-lib/CMakeLists.txt +142 -0
- resources/platforms/espidf/project/components/tflite-lib/Kconfig +8 -0
- resources/platforms/espidf/project/components/tvm-lib/CMakeLists.txt +66 -0
- resources/platforms/espidf/project/components/tvm-lib/Kconfig +7 -0
- resources/platforms/espidf/project/example_test.py +38 -0
- resources/platforms/espidf/project/main/CMakeLists.txt +25 -0
- resources/platforms/espidf/project/main/main.c +57 -0
- resources/platforms/espidf/project/sdkconfig.defaults +26 -0
- resources/platforms/zephyr/project/CMakeLists.txt +22 -0
- resources/platforms/zephyr/project/Kconfig +101 -0
- resources/platforms/zephyr/project/README.rst +33 -0
- resources/platforms/zephyr/project/cmake/AddAllSubdirs.cmake +21 -0
- resources/platforms/zephyr/project/cmake/ChooseTarget.cmake +22 -0
- resources/platforms/zephyr/project/cmake/LinkTFLite.cmake +223 -0
- resources/platforms/zephyr/project/cmake/LinkTVM.cmake +68 -0
- resources/platforms/zephyr/project/cmake/LookupClang.cmake +41 -0
- resources/platforms/zephyr/project/cmake/backends/tflmc.cmake +5 -0
- resources/platforms/zephyr/project/cmake/backends/tflmi.cmake +5 -0
- resources/platforms/zephyr/project/cmake/backends/tvmaot.cmake +10 -0
- resources/platforms/zephyr/project/cmake/backends/tvmaotplus.cmake +10 -0
- resources/platforms/zephyr/project/cmake/backends/tvmcg.cmake +10 -0
- resources/platforms/zephyr/project/cmake/backends/tvmllvm.cmake +8 -0
- resources/platforms/zephyr/project/cmake/backends/tvmrt.cmake +8 -0
- resources/platforms/zephyr/project/cmake/extras.cmake +9 -0
- resources/platforms/zephyr/project/cmake/features/auto_vectorize_gcc.cmake +65 -0
- resources/platforms/zephyr/project/cmake/features/auto_vectorize_llvm.cmake +20 -0
- resources/platforms/zephyr/project/cmake/features/cmsisnn.cmake +86 -0
- resources/platforms/zephyr/project/cmake/features/muriscvnn.cmake +87 -0
- resources/platforms/zephyr/project/cmake/frameworks/tflm.cmake +1 -0
- resources/platforms/zephyr/project/cmake/frameworks/tflm_mlif.cmake +8 -0
- resources/platforms/zephyr/project/cmake/frameworks/tvm.cmake +1 -0
- resources/platforms/zephyr/project/cmake/frameworks/tvm_mlif.cmake +37 -0
- resources/platforms/zephyr/project/lib/CMakeLists.txt +13 -0
- resources/platforms/zephyr/project/lib/drivers/fake_input.c +10 -0
- resources/platforms/zephyr/project/lib/drivers/fake_input.h +8 -0
- resources/platforms/zephyr/project/lib/ml_interface/CMakeLists.txt +31 -0
- resources/platforms/zephyr/project/lib/ml_interface/default_data.c +8 -0
- resources/platforms/zephyr/project/lib/ml_interface/default_model_support/CMakeLists.txt +2 -0
- resources/platforms/zephyr/project/lib/ml_interface/default_model_support/process_input.c +17 -0
- resources/platforms/zephyr/project/lib/ml_interface/default_model_support/process_output.c +27 -0
- resources/platforms/zephyr/project/lib/ml_interface/ml_interface.c +36 -0
- resources/platforms/zephyr/project/lib/ml_interface/ml_interface.h +47 -0
- resources/platforms/zephyr/project/lib/ml_interface/ml_interface_tflm.cc +22 -0
- resources/platforms/zephyr/project/lib/ml_interface/ml_interface_tvm.c +22 -0
- resources/platforms/zephyr/project/lib/support/CMakeLists.txt +2 -0
- resources/platforms/zephyr/project/lib/support/dummy.c +0 -0
- resources/platforms/zephyr/project/lib/support/exit.h +8 -0
- resources/platforms/zephyr/project/lib/support/printing.h +11 -0
- resources/platforms/zephyr/project/lib/support/quantize.h +23 -0
- resources/platforms/zephyr/project/lib/targets/corstone300.c +62 -0
- resources/platforms/zephyr/project/lib/targets/default.c +2 -0
- resources/platforms/zephyr/project/lib/targets/etiss_pulpino.c +112 -0
- resources/platforms/zephyr/project/lib/targets/generic_riscv.c +112 -0
- resources/platforms/zephyr/project/lib/targets/riscv_qemu.c +112 -0
- resources/platforms/zephyr/project/lib/targets/target.h +2 -0
- resources/platforms/zephyr/project/prj.conf +11 -0
- resources/platforms/zephyr/project/sample.yaml +19 -0
- resources/platforms/zephyr/project/src/main.c +71 -0
- resources/platforms/zephyr/project2/CMakeLists.txt +72 -0
- resources/platforms/zephyr/project2/Kconfig +101 -0
- resources/platforms/zephyr/project2/README.rst +33 -0
- resources/platforms/zephyr/project2/cmake/AddAllSubdirs.cmake +21 -0
- resources/platforms/zephyr/project2/cmake/ChooseTarget.cmake +22 -0
- resources/platforms/zephyr/project2/cmake/LinkTFLite.cmake +223 -0
- resources/platforms/zephyr/project2/cmake/LinkTVM.cmake +68 -0
- resources/platforms/zephyr/project2/cmake/LookupClang.cmake +41 -0
- resources/platforms/zephyr/project2/cmake/backends/tflmc.cmake +5 -0
- resources/platforms/zephyr/project2/cmake/backends/tflmi.cmake +5 -0
- resources/platforms/zephyr/project2/cmake/backends/tvmaot.cmake +10 -0
- resources/platforms/zephyr/project2/cmake/backends/tvmaotplus.cmake +10 -0
- resources/platforms/zephyr/project2/cmake/backends/tvmcg.cmake +10 -0
- resources/platforms/zephyr/project2/cmake/backends/tvmllvm.cmake +8 -0
- resources/platforms/zephyr/project2/cmake/backends/tvmrt.cmake +8 -0
- resources/platforms/zephyr/project2/cmake/extras.cmake +9 -0
- resources/platforms/zephyr/project2/cmake/features/auto_vectorize_gcc.cmake +65 -0
- resources/platforms/zephyr/project2/cmake/features/auto_vectorize_llvm.cmake +20 -0
- resources/platforms/zephyr/project2/cmake/features/cmsisnn.cmake +86 -0
- resources/platforms/zephyr/project2/cmake/features/muriscvnn.cmake +87 -0
- resources/platforms/zephyr/project2/cmake/frameworks/tflm.cmake +1 -0
- resources/platforms/zephyr/project2/cmake/frameworks/tflm_mlif.cmake +8 -0
- resources/platforms/zephyr/project2/cmake/frameworks/tvm.cmake +1 -0
- resources/platforms/zephyr/project2/cmake/frameworks/tvm_mlif.cmake +37 -0
- resources/platforms/zephyr/project2/default_data.c +8 -0
- resources/platforms/zephyr/project2/default_model_support/CMakeLists.txt +3 -0
- resources/platforms/zephyr/project2/default_model_support/process_input.c +17 -0
- resources/platforms/zephyr/project2/default_model_support/process_output.c +27 -0
- resources/platforms/zephyr/project2/lib/CMakeLists.txt +13 -0
- resources/platforms/zephyr/project2/lib/drivers/fake_input.c +10 -0
- resources/platforms/zephyr/project2/lib/drivers/fake_input.h +8 -0
- resources/platforms/zephyr/project2/lib/support/CMakeLists.txt +2 -0
- resources/platforms/zephyr/project2/lib/support/dummy.c +0 -0
- resources/platforms/zephyr/project2/lib/support/exit.h +8 -0
- resources/platforms/zephyr/project2/lib/support/printing.h +11 -0
- resources/platforms/zephyr/project2/lib/support/quantize.h +23 -0
- resources/platforms/zephyr/project2/lib/targets/corstone300.c +62 -0
- resources/platforms/zephyr/project2/lib/targets/default.c +2 -0
- resources/platforms/zephyr/project2/lib/targets/etiss_pulpino.c +112 -0
- resources/platforms/zephyr/project2/lib/targets/generic_riscv.c +112 -0
- resources/platforms/zephyr/project2/lib/targets/riscv_qemu.c +112 -0
- resources/platforms/zephyr/project2/lib/targets/target.h +2 -0
- resources/platforms/zephyr/project2/ml_interface.c +36 -0
- resources/platforms/zephyr/project2/ml_interface.h +47 -0
- resources/platforms/zephyr/project2/ml_interface_tflm.cc +22 -0
- resources/platforms/zephyr/project2/ml_interface_tvm.c +22 -0
- resources/platforms/zephyr/project2/prj.conf +13 -0
- resources/platforms/zephyr/project2/sample.yaml +19 -0
- resources/platforms/zephyr/project2/settings.json +6 -0
- resources/platforms/zephyr/project2/src/main.c +35 -0
- resources/pycharm/.run/README.md +73 -0
- resources/pycharm/.run/step1_ init env.run.xml +24 -0
- resources/pycharm/.run/step2_ setup.run.xml +25 -0
- resources/pycharm/.run/step3_ run resnet on pulpxpulpissimo.run.xml +25 -0
- resources/templates/default.yml.j2 +258 -0
- resources/templates/dev.yml.j2 +212 -0
- resources/templates/minimal.yml.j2 +234 -0
- resources/templates/phi.yml.j2 +282 -0
- resources/templates/pulp.yml.j2 +267 -0
- resources/templates/research.yml.j2 +237 -0
- resources/templates/tumeda.yml.j2 +239 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 TUM Department of Electrical and Computer Engineering.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of MLonMCU.
|
|
5
|
+
* See https://github.com/tum-ei-eda/mlonmcu.git for further info.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
#include <stdio.h>
|
|
20
|
+
#include <stdint.h>
|
|
21
|
+
#include "sdkconfig.h"
|
|
22
|
+
#include "freertos/FreeRTOS.h"
|
|
23
|
+
#include "freertos/task.h"
|
|
24
|
+
#include "riscv/csr.h"
|
|
25
|
+
#include "esp_system.h"
|
|
26
|
+
#include "esp_timer.h"
|
|
27
|
+
|
|
28
|
+
#include "ml_interface.h"
|
|
29
|
+
|
|
30
|
+
// TODO: move pre and post stuff to mlif or somewhere else?
|
|
31
|
+
|
|
32
|
+
void app_main(void)
|
|
33
|
+
{
|
|
34
|
+
RV_WRITE_CSR(CSR_PCER_MACHINE,8);
|
|
35
|
+
printf("MLonMCU: START\n");
|
|
36
|
+
uint64_t us_before = esp_timer_get_time();
|
|
37
|
+
esp_cpu_ccount_t cc_before = esp_cpu_get_ccount();
|
|
38
|
+
mlif_run();
|
|
39
|
+
uint64_t us_after = esp_timer_get_time();
|
|
40
|
+
uint64_t us_diff = us_after - us_before;
|
|
41
|
+
esp_cpu_ccount_t cc_after = esp_cpu_get_ccount();
|
|
42
|
+
// Warning:
|
|
43
|
+
// 32 bit printf only for newlib nano...
|
|
44
|
+
printf("Total Time: %u us\n", (uint32_t)us_diff);
|
|
45
|
+
printf("Total Cycles: %u\n", (uint32_t)(cc_after - cc_before)); // TODO: overflow possible?
|
|
46
|
+
printf("MLonMCU: STOP\n");
|
|
47
|
+
// printf("Minimum free heap size: %d bytes\n", esp_get_minimum_free_heap_size());
|
|
48
|
+
fflush(stdout);
|
|
49
|
+
|
|
50
|
+
for (int i = 10; i >= 0; i--) {
|
|
51
|
+
printf("Restarting in %d seconds...\n", i);
|
|
52
|
+
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
|
53
|
+
}
|
|
54
|
+
printf("Restarting now.\n");
|
|
55
|
+
fflush(stdout);
|
|
56
|
+
esp_restart();
|
|
57
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
CONFIG_ESP_TASK_WDT_TIMEOUT_S=60
|
|
2
|
+
#
|
|
3
|
+
# MLonMCU Options
|
|
4
|
+
#
|
|
5
|
+
CONFIG_MLONMCU_CODEGEN_DIR=""
|
|
6
|
+
CONFIG_MLONMCU_FRAMEWORK_TFLM=y
|
|
7
|
+
CONFIG_MLONMCU_FRAMEWORK_TVM=n
|
|
8
|
+
CONFIG_MLONMCU_BACKEND_TFLMI=y
|
|
9
|
+
CONFIG_MLONMCU_BACKEND_TFLMC=n
|
|
10
|
+
CONFIG_MLONMCU_BACKEND_TVMAOT=n
|
|
11
|
+
CONFIG_MLONMCU_BACKEND_TVMRT=n
|
|
12
|
+
CONFIG_MLONMCU_BACKEND_TVMCG=n
|
|
13
|
+
CONFIG_MLONMCU_NUM_RUNS=1
|
|
14
|
+
# end of MLonMCU Options
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# TFLite Micro Build Options
|
|
18
|
+
#
|
|
19
|
+
CONFIG_TF_DIR=""
|
|
20
|
+
# end of TFLite Micro Build Options
|
|
21
|
+
|
|
22
|
+
#
|
|
23
|
+
# TVM Build Options
|
|
24
|
+
#
|
|
25
|
+
CONFIG_TVM_DIR=""
|
|
26
|
+
# end of TVM Build Options
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
cmake_minimum_required(VERSION 3.20.0)
|
|
4
|
+
|
|
5
|
+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
|
6
|
+
project(mlonmcu_template)
|
|
7
|
+
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
8
|
+
|
|
9
|
+
target_sources(app PRIVATE src/main.c)
|
|
10
|
+
|
|
11
|
+
INCLUDE(backends/${CONFIG_MLONMCU_BACKEND})
|
|
12
|
+
INCLUDE(frameworks/${CONFIG_MLONMCU_FRAMEWORK})
|
|
13
|
+
|
|
14
|
+
IF(CONFIG_TF_DIR)
|
|
15
|
+
INCLUDE(LinkTFLite)
|
|
16
|
+
ENDIF()
|
|
17
|
+
IF(CONFIG_TVM_DIR)
|
|
18
|
+
INCLUDE(LinkTVM)
|
|
19
|
+
ENDIF()
|
|
20
|
+
ADD_SUBDIRECTORY(lib)
|
|
21
|
+
|
|
22
|
+
TARGET_LINK_LIBRARIES(app PUBLIC target_sw_lib)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
mainmenu "MLonMCU"
|
|
2
|
+
|
|
3
|
+
source "Kconfig.zephyr"
|
|
4
|
+
menu "MLonMCU Options"
|
|
5
|
+
|
|
6
|
+
config MLONMCU_CODEGEN_DIR
|
|
7
|
+
string "Codegen Directory"
|
|
8
|
+
default "$(CODEGEN_SRC)"
|
|
9
|
+
help
|
|
10
|
+
Path to the directory with the codegen results.
|
|
11
|
+
|
|
12
|
+
# choice MLONMCU_FRAMEWORK
|
|
13
|
+
# prompt "MLonMCU framework"
|
|
14
|
+
# default MLONMCU_FRAMEWORK_TFLM
|
|
15
|
+
# help
|
|
16
|
+
# Choose a MLonMCU framework from the list.
|
|
17
|
+
|
|
18
|
+
# config MLONMCU_FRAMEWORK_TFLM
|
|
19
|
+
# bool "TFLite Micro"
|
|
20
|
+
# config MLONMCU_FRAMEWORK_TVM
|
|
21
|
+
# bool "TVM"
|
|
22
|
+
# endchoice
|
|
23
|
+
|
|
24
|
+
config MLONMCU_FRAMEWORK
|
|
25
|
+
string "Ued Framework"
|
|
26
|
+
# default "tflm" if MLONMCU_FRAMEWORK_TFLM
|
|
27
|
+
# default "tvm" if MLONMCU_FRAMEWORK_TVM
|
|
28
|
+
default "none"
|
|
29
|
+
help
|
|
30
|
+
TODO
|
|
31
|
+
|
|
32
|
+
# choice MLONMCU_BACKEND
|
|
33
|
+
# prompt "MLonMCU backend"
|
|
34
|
+
# default MLONMCU_BACKEND_TFLMI if MLONMCU_FRAMEWORK_TFLM
|
|
35
|
+
# default MLONMCU_BACKEND_TVMAOT if MLONMCU_FRAMEWORK_TVM
|
|
36
|
+
# help
|
|
37
|
+
# Choose a MLonMCU backend for the chosen framwork.
|
|
38
|
+
|
|
39
|
+
# config MLONMCU_BACKEND_TFLMI
|
|
40
|
+
# bool "TFLite Micro Default Interpreter"
|
|
41
|
+
# depends on MLONMCU_FRAMEWORK_TFLM
|
|
42
|
+
# config MLONMCU_BACKEND_TFLMC
|
|
43
|
+
# bool "TFLite Micro Compiler"
|
|
44
|
+
# depends on MLONMCU_FRAMEWORK_TFLM
|
|
45
|
+
# config MLONMCU_BACKEND_TVMAOT
|
|
46
|
+
# bool "TVM AoT Executor"
|
|
47
|
+
# depends on MLONMCU_FRAMEWORK_TVM
|
|
48
|
+
# config MLONMCU_BACKEND_TVMRT
|
|
49
|
+
# bool "TVM Graph Executor"
|
|
50
|
+
# depends on MLONMCU_FRAMEWORK_TVM
|
|
51
|
+
# config MLONMCU_BACKEND_TVMCG
|
|
52
|
+
# bool "TVM Custom Codegenerator"
|
|
53
|
+
# depends on MLONMCU_FRAMEWORK_TVM
|
|
54
|
+
# endchoice
|
|
55
|
+
|
|
56
|
+
config MLONMCU_BACKEND
|
|
57
|
+
string "Used backend"
|
|
58
|
+
default "none"
|
|
59
|
+
help
|
|
60
|
+
TODO
|
|
61
|
+
|
|
62
|
+
config MLONMCU_NUM_RUNS
|
|
63
|
+
int "Number of inferences"
|
|
64
|
+
default 1
|
|
65
|
+
help
|
|
66
|
+
How many times the network should be invoked. A negative value maps to a infinite number of runs.
|
|
67
|
+
|
|
68
|
+
config MLONMCU_VALIDATE
|
|
69
|
+
bool "Validate model output data"
|
|
70
|
+
default false
|
|
71
|
+
help
|
|
72
|
+
Compare model outputs with expected results (if available). Only works in DEBUG mode.
|
|
73
|
+
|
|
74
|
+
config MLONMCU_MODLE_DIR
|
|
75
|
+
string "Model Directory"
|
|
76
|
+
depends on MLONMCU_VALIDATE
|
|
77
|
+
default "$(MODEL_DIR)"
|
|
78
|
+
help
|
|
79
|
+
Directory where model support code and reference data can be found.
|
|
80
|
+
endmenu
|
|
81
|
+
|
|
82
|
+
menu "TVM Build Options"
|
|
83
|
+
config TVM_DIR
|
|
84
|
+
string "Path to TVM"
|
|
85
|
+
default "$(TVM_SRC)"
|
|
86
|
+
help
|
|
87
|
+
TVM directory path.
|
|
88
|
+
config TVM_CRT_CONFIG_DIR
|
|
89
|
+
string "Path to TVM CRT config directory"
|
|
90
|
+
default ""
|
|
91
|
+
help
|
|
92
|
+
TVM crt path.
|
|
93
|
+
endmenu
|
|
94
|
+
menu "TFLite Micro Build Options"
|
|
95
|
+
|
|
96
|
+
config TF_DIR
|
|
97
|
+
string "Path to TFLite Micro"
|
|
98
|
+
default "$(TF_SRC)"
|
|
99
|
+
help
|
|
100
|
+
TFLite Micro directory path.
|
|
101
|
+
endmenu
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.. _hello_world:
|
|
2
|
+
|
|
3
|
+
Hello World
|
|
4
|
+
###########
|
|
5
|
+
|
|
6
|
+
Overview
|
|
7
|
+
********
|
|
8
|
+
|
|
9
|
+
A simple sample that can be used with any :ref:`supported board <boards>` and
|
|
10
|
+
prints "Hello World" to the console.
|
|
11
|
+
|
|
12
|
+
Building and Running
|
|
13
|
+
********************
|
|
14
|
+
|
|
15
|
+
This application can be built and executed on QEMU as follows:
|
|
16
|
+
|
|
17
|
+
.. zephyr-app-commands::
|
|
18
|
+
:zephyr-app: samples/hello_world
|
|
19
|
+
:host-os: unix
|
|
20
|
+
:board: qemu_x86
|
|
21
|
+
:goals: run
|
|
22
|
+
:compact:
|
|
23
|
+
|
|
24
|
+
To build for another board, change "qemu_x86" above to that board's name.
|
|
25
|
+
|
|
26
|
+
Sample Output
|
|
27
|
+
=============
|
|
28
|
+
|
|
29
|
+
.. code-block:: console
|
|
30
|
+
|
|
31
|
+
Hello World! x86
|
|
32
|
+
|
|
33
|
+
Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MACRO(AddAllSubdirs)
|
|
2
|
+
UNSET(LOCAL_SUBDIRS)
|
|
3
|
+
FILE(
|
|
4
|
+
GLOB LOCAL_SUBDIRS
|
|
5
|
+
RELATIVE ${CMAKE_CURRENT_LIST_DIR}
|
|
6
|
+
${CMAKE_CURRENT_LIST_DIR}/*
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
FOREACH(subdir ${LOCAL_SUBDIRS})
|
|
10
|
+
IF(IS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/${subdir})
|
|
11
|
+
IF(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${subdir}/CMakeLists.txt)
|
|
12
|
+
ADD_SUBDIRECTORY(${CMAKE_CURRENT_LIST_DIR}/${subdir})
|
|
13
|
+
MESSAGE(STATUS "Including sub project ${subdir}.")
|
|
14
|
+
ELSE()
|
|
15
|
+
MESSAGE(
|
|
16
|
+
WARNING "Directory ${subdir} is not added to the current build because it lacks a CMakeLists.txt"
|
|
17
|
+
)
|
|
18
|
+
ENDIF()
|
|
19
|
+
ENDIF()
|
|
20
|
+
ENDFOREACH()
|
|
21
|
+
ENDMACRO()
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# New target architectures and systems should be added here Make sure to define the CMAKE_TOOLCHAIN_FILE for
|
|
2
|
+
# cross-compilation
|
|
3
|
+
|
|
4
|
+
# Default implementation of the macro points to the original ADD_LIBRARY function
|
|
5
|
+
MACRO(COMMON_ADD_LIBRARY TARGET_NAME)
|
|
6
|
+
ADD_LIBRARY(${TARGET_NAME} ${ARGN})
|
|
7
|
+
ENDMACRO()
|
|
8
|
+
|
|
9
|
+
MACRO(COMMON_ADD_EXECUTABLE TARGET_NAME)
|
|
10
|
+
ADD_EXECUTABLE(${TARGET_NAME} ${ARGN})
|
|
11
|
+
ENDMACRO()
|
|
12
|
+
|
|
13
|
+
SET(TOOLCHAIN_FILE "")
|
|
14
|
+
IF(TARGET_SYSTEM)
|
|
15
|
+
INCLUDE(targets/${TARGET_SYSTEM})
|
|
16
|
+
IF(TOOLCHAIN)
|
|
17
|
+
SET(TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchains/${TOOLCHAIN}_${TARGET_SYSTEM}.cmake")
|
|
18
|
+
INCLUDE(${TOOLCHAIN_FILE})
|
|
19
|
+
ENDIF()
|
|
20
|
+
ENDIF()
|
|
21
|
+
|
|
22
|
+
# set(CMAKE_EXECUTABLE_SUFFIX_C .elf)
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
SET(TF_DIR
|
|
2
|
+
"/data/work/code/tensorflow"
|
|
3
|
+
CACHE PATH "TensorFlow source directory"
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
SET(TFL_SRC ${CONFIG_TF_DIR}/tensorflow/lite)
|
|
7
|
+
SET(TFLM_SRC ${TFL_SRC}/micro)
|
|
8
|
+
SET(TFLD_SRC ${TFLM_SRC}/tools/make/downloads)
|
|
9
|
+
|
|
10
|
+
SET(TFLM_EXTRA_KERNEL_LIBS "")
|
|
11
|
+
SET(TFLM_EXTRA_KERNEL_INCS "")
|
|
12
|
+
|
|
13
|
+
IF(CONFIG_TFLM_OPTIMIZED_KERNEL)
|
|
14
|
+
# Suboptimal but we do not want to hardcode every kernel which should be replaced...
|
|
15
|
+
FILE(GLOB TFLM_EXTRA_KERNEL_SRCS ${TFLM_SRC}/kernels/${CONFIG_TFLM_OPTIMIZED_KERNEL}/*.cc)
|
|
16
|
+
# LIST(APPEND TFLM_EXTRA_KERNEL_INCS ${TFLM_SRC}/kernels/${TFLM_OPTIMIZED_KERNEL}/)
|
|
17
|
+
STRING(TOUPPER "${CONFIG_TFLM_OPTIMIZED_KERNEL}" TFLM_OPTIMIZED_KERNEL_UPPER)
|
|
18
|
+
ENDIF()
|
|
19
|
+
|
|
20
|
+
IF(CONFIG_TFLM_OPTIMIZED_KERNEL_LIB)
|
|
21
|
+
LIST(APPEND TFLM_EXTRA_KERNEL_LIBS ${CONFIG_TFLM_OPTIMIZED_KERNEL_LIB})
|
|
22
|
+
ENDIF()
|
|
23
|
+
|
|
24
|
+
IF(CONFIG_TFLM_OPTIMIZED_KERNEL_INCLUDE_DIR)
|
|
25
|
+
LIST(APPEND TFLM_EXTRA_KERNEL_INCS ${CONFIG_TFLM_OPTIMIZED_KERNEL_INCLUDE_DIR})
|
|
26
|
+
ENDIF()
|
|
27
|
+
|
|
28
|
+
IF(CONFIG_TFLM_OPTIMIZED_KERNEL_DEPS)
|
|
29
|
+
LIST(APPEND TFLM_EXTRA_KERNEL_DEPS ${CONFIG_TFLM_OPTIMIZED_KERNEL_DEPS})
|
|
30
|
+
ENDIF()
|
|
31
|
+
|
|
32
|
+
SET(CUSTOM_QUANT_SRC ${TFL_SRC}/experimental/custom_quantization_util.cc)
|
|
33
|
+
IF(EXISTS ${CUSTOM_QUANT_SRC})
|
|
34
|
+
SET(OPT_SRC ${CUSTOM_QUANT_SRC})
|
|
35
|
+
ENDIF()
|
|
36
|
+
|
|
37
|
+
SET(TFLM_REFERENCE_KERNEL_SRCS
|
|
38
|
+
${TFLM_SRC}/kernels/softmax.cc
|
|
39
|
+
${TFLM_SRC}/kernels/fully_connected.cc
|
|
40
|
+
${TFLM_SRC}/kernels/pooling.cc
|
|
41
|
+
${TFLM_SRC}/kernels/add.cc
|
|
42
|
+
${TFLM_SRC}/kernels/mul.cc
|
|
43
|
+
${TFLM_SRC}/kernels/conv.cc
|
|
44
|
+
${TFLM_SRC}/kernels/depthwise_conv.cc
|
|
45
|
+
${TFLM_SRC}/kernels/softmax.cc
|
|
46
|
+
${TFLM_SRC}/kernels/fully_connected.cc
|
|
47
|
+
${TFLM_SRC}/kernels/pooling.cc
|
|
48
|
+
${TFLM_SRC}/kernels/add.cc
|
|
49
|
+
${TFLM_SRC}/kernels/mul.cc
|
|
50
|
+
${TFLM_SRC}/kernels/conv.cc
|
|
51
|
+
${TFLM_SRC}/kernels/depthwise_conv.cc
|
|
52
|
+
${TFLM_SRC}/kernels/logical.cc
|
|
53
|
+
${TFLM_SRC}/kernels/logistic.cc
|
|
54
|
+
${TFLM_SRC}/kernels/svdf.cc
|
|
55
|
+
${TFLM_SRC}/kernels/concatenation.cc
|
|
56
|
+
${TFLM_SRC}/kernels/ceil.cc
|
|
57
|
+
${TFLM_SRC}/kernels/floor.cc
|
|
58
|
+
${TFLM_SRC}/kernels/prelu.cc
|
|
59
|
+
${TFLM_SRC}/kernels/neg.cc
|
|
60
|
+
${TFLM_SRC}/kernels/elementwise.cc
|
|
61
|
+
${TFLM_SRC}/kernels/maximum_minimum.cc
|
|
62
|
+
${TFLM_SRC}/kernels/arg_min_max.cc
|
|
63
|
+
${TFLM_SRC}/kernels/reshape.cc
|
|
64
|
+
${TFLM_SRC}/kernels/comparisons.cc
|
|
65
|
+
${TFLM_SRC}/kernels/round.cc
|
|
66
|
+
${TFLM_SRC}/kernels/strided_slice.cc
|
|
67
|
+
${TFLM_SRC}/kernels/pack.cc
|
|
68
|
+
${TFLM_SRC}/kernels/pad.cc
|
|
69
|
+
${TFLM_SRC}/kernels/split.cc
|
|
70
|
+
${TFLM_SRC}/kernels/unpack.cc
|
|
71
|
+
${TFLM_SRC}/kernels/quantize.cc
|
|
72
|
+
${TFLM_SRC}/kernels/activations.cc
|
|
73
|
+
${TFLM_SRC}/kernels/dequantize.cc
|
|
74
|
+
${TFLM_SRC}/kernels/reduce.cc
|
|
75
|
+
${TFLM_SRC}/kernels/sub.cc
|
|
76
|
+
${TFLM_SRC}/kernels/resize_nearest_neighbor.cc
|
|
77
|
+
${TFLM_SRC}/kernels/l2norm.cc
|
|
78
|
+
${TFLM_SRC}/kernels/circular_buffer.cc
|
|
79
|
+
${TFLM_SRC}/kernels/ethosu.cc
|
|
80
|
+
${TFLM_SRC}/kernels/tanh.cc
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# This files only exists in newer versions of TF
|
|
84
|
+
IF(EXISTS ${TFLM_SRC}/kernels/conv_common.cc)
|
|
85
|
+
LIST(APPEND TFLM_REFERENCE_KERNEL_SRCS ${TFLM_SRC}/kernels/conv_common.cc)
|
|
86
|
+
ENDIF()
|
|
87
|
+
IF(EXISTS ${TFLM_SRC}/kernels/depthwise_conv_common.cc)
|
|
88
|
+
LIST(APPEND TFLM_REFERENCE_KERNEL_SRCS ${TFLM_SRC}/kernels/depthwise_conv_common.cc)
|
|
89
|
+
ENDIF()
|
|
90
|
+
IF(EXISTS ${TFLM_SRC}/kernels/fully_connected_common.cc)
|
|
91
|
+
LIST(APPEND TFLM_REFERENCE_KERNEL_SRCS ${TFLM_SRC}/kernels/fully_connected_common.cc)
|
|
92
|
+
ENDIF()
|
|
93
|
+
IF(EXISTS ${TFLM_SRC}/kernels/quantize_common.cc)
|
|
94
|
+
LIST(APPEND TFLM_REFERENCE_KERNEL_SRCS ${TFLM_SRC}/kernels/quantize_common.cc)
|
|
95
|
+
ENDIF()
|
|
96
|
+
IF(EXISTS ${TFLM_SRC}/kernels/softmax_common.cc)
|
|
97
|
+
LIST(APPEND TFLM_REFERENCE_KERNEL_SRCS ${TFLM_SRC}/kernels/softmax_common.cc)
|
|
98
|
+
ENDIF()
|
|
99
|
+
IF(EXISTS ${TFLM_SRC}/kernels/svdf_common.cc)
|
|
100
|
+
LIST(APPEND TFLM_REFERENCE_KERNEL_SRCS ${TFLM_SRC}/kernels/svdf_common.cc)
|
|
101
|
+
ENDIF()
|
|
102
|
+
IF(EXISTS ${TFLM_SRC}/kernels/pooling_common.cc)
|
|
103
|
+
LIST(APPEND TFLM_REFERENCE_KERNEL_SRCS ${TFLM_SRC}/kernels/pooling_common.cc)
|
|
104
|
+
ENDIF()
|
|
105
|
+
IF(EXISTS ${TFLM_SRC}/kernels/add_common.cc)
|
|
106
|
+
LIST(APPEND TFLM_REFERENCE_KERNEL_SRCS ${TFLM_SRC}/kernels/add_common.cc)
|
|
107
|
+
ENDIF()
|
|
108
|
+
IF(EXISTS ${TFLM_SRC}/kernels/dequantize_common.cc)
|
|
109
|
+
LIST(APPEND TFLM_REFERENCE_KERNEL_SRCS ${TFLM_SRC}/kernels/dequantize_common.cc)
|
|
110
|
+
ENDIF()
|
|
111
|
+
IF(EXISTS ${TFLM_SRC}/kernels/detection_postprocess.cc)
|
|
112
|
+
LIST(APPEND TFLM_REFERENCE_KERNEL_SRCS ${TFLM_SRC}/kernels/detection_postprocess.cc)
|
|
113
|
+
ENDIF()
|
|
114
|
+
|
|
115
|
+
FOREACH(src ${TFLM_EXTRA_KERNEL_SRCS})
|
|
116
|
+
GET_FILENAME_COMPONENT(src_name ${src} NAME)
|
|
117
|
+
IF(${src_name} MATCHES ".*_test.*")
|
|
118
|
+
LIST(REMOVE_ITEM TFLM_EXTRA_KERNEL_SRCS ${src})
|
|
119
|
+
ELSE()
|
|
120
|
+
SET(src_path "${TFLM_SRC}/kernels/${src_name}")
|
|
121
|
+
LIST(FIND TFLM_REFERENCE_KERNEL_SRCS ${src_path} TFLM_KERNEL_SRCS_FOUND_INDEX)
|
|
122
|
+
IF(${TFLM_KERNEL_SRCS_FOUND_INDEX} GREATER_EQUAL 0)
|
|
123
|
+
MESSAGE(STATUS "Replacing TFLM version of ${src_name} by optimized variant...")
|
|
124
|
+
LIST(REMOVE_ITEM TFLM_REFERENCE_KERNEL_SRCS ${src_path})
|
|
125
|
+
ENDIF()
|
|
126
|
+
ENDIF()
|
|
127
|
+
ENDFOREACH()
|
|
128
|
+
|
|
129
|
+
# This files only exists in newer versions of TF
|
|
130
|
+
IF(EXISTS ${TFL_SRC}/schema/schema_utils.cc)
|
|
131
|
+
LIST(APPEND OPT_SRC ${TFL_SRC}/schema/schema_utils.cc)
|
|
132
|
+
ENDIF()
|
|
133
|
+
IF(EXISTS ${TFLM_SRC}/micro_context.cc)
|
|
134
|
+
LIST(APPEND OPT_SRC ${TFLM_SRC}/micro_context.cc)
|
|
135
|
+
ENDIF()
|
|
136
|
+
IF(EXISTS ${TFLM_SRC}/micro_graph.cc)
|
|
137
|
+
LIST(APPEND OPT_SRC ${TFLM_SRC}/micro_graph.cc)
|
|
138
|
+
ENDIF()
|
|
139
|
+
IF(EXISTS ${TFLM_SRC}/flatbuffer_utils.cc)
|
|
140
|
+
LIST(APPEND OPT_SRC ${TFLM_SRC}/flatbuffer_utils.cc)
|
|
141
|
+
ENDIF()
|
|
142
|
+
|
|
143
|
+
ADD_LIBRARY(
|
|
144
|
+
tflm STATIC
|
|
145
|
+
# Not really needed?
|
|
146
|
+
${TFLM_SRC}/micro_error_reporter.cc
|
|
147
|
+
${TFLM_SRC}/debug_log.cc
|
|
148
|
+
${TFLM_SRC}/micro_string.cc
|
|
149
|
+
# For reporter->Report
|
|
150
|
+
${CONFIG_TF_DIR}/tensorflow/lite/core/api/error_reporter.cc
|
|
151
|
+
# Kernels
|
|
152
|
+
${TFLM_REFERENCE_KERNEL_SRCS}
|
|
153
|
+
${TFLM_EXTRA_KERNEL_SRCS}
|
|
154
|
+
# Kernel deps
|
|
155
|
+
${TFLM_SRC}/kernels/kernel_util.cc
|
|
156
|
+
${TFLM_SRC}/all_ops_resolver.cc
|
|
157
|
+
${TFLM_SRC}/micro_utils.cc
|
|
158
|
+
${TFL_SRC}/kernels/internal/quantization_util.cc
|
|
159
|
+
${TFL_SRC}/kernels/kernel_util.cc
|
|
160
|
+
${TFLM_SRC}/micro_interpreter.cc
|
|
161
|
+
${TFLM_SRC}/micro_allocator.cc
|
|
162
|
+
${TFLM_SRC}/micro_allocation_info.cc
|
|
163
|
+
${TFLM_SRC}/micro_resource_variable.cc
|
|
164
|
+
${TFLM_SRC}/arena_allocator/simple_memory_allocator.cc
|
|
165
|
+
${TFLM_SRC}/memory_helpers.cc
|
|
166
|
+
${TFLM_SRC}/memory_planner/greedy_memory_planner.cc
|
|
167
|
+
${TFL_SRC}/core/api/tensor_utils.cc
|
|
168
|
+
${TFL_SRC}/core/api/flatbuffer_conversions.cc
|
|
169
|
+
${TFL_SRC}/core/api/op_resolver.cc
|
|
170
|
+
${TFL_SRC}/c/common.cc
|
|
171
|
+
${OPT_SRC}
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
IF(TFLM_EXTRA_KERNEL_LIBS)
|
|
175
|
+
TARGET_LINK_LIBRARIES(tflm PUBLIC ${TFLM_EXTRA_KERNEL_LIBS})
|
|
176
|
+
ENDIF()
|
|
177
|
+
TARGET_LINK_LIBRARIES(tflm PUBLIC m)
|
|
178
|
+
|
|
179
|
+
IF(TFLM_OPTIMIZED_KERNEL_DEPS)
|
|
180
|
+
ADD_DEPENDENCIES(tflm ${TFLM_OPTIMIZED_KERNEL_DEPS})
|
|
181
|
+
ENDIF()
|
|
182
|
+
|
|
183
|
+
# cmake-format: off
|
|
184
|
+
TARGET_INCLUDE_DIRECTORIES(tflm PUBLIC
|
|
185
|
+
${CONFIG_TF_DIR}
|
|
186
|
+
${TFLD_SRC}/flatbuffers/include
|
|
187
|
+
${TFLD_SRC}/gemmlowp
|
|
188
|
+
${TFLD_SRC}/ruy
|
|
189
|
+
${TFLM_EXTRA_KERNEL_INCS}
|
|
190
|
+
)
|
|
191
|
+
# cmake-format: on
|
|
192
|
+
|
|
193
|
+
# cmake-format: off
|
|
194
|
+
TARGET_COMPILE_DEFINITIONS(tflm PUBLIC
|
|
195
|
+
TF_LITE_USE_GLOBAL_CMATH_FUNCTIONS
|
|
196
|
+
TF_LITE_USE_GLOBAL_MAX
|
|
197
|
+
TF_LITE_USE_GLOBAL_MIN
|
|
198
|
+
TF_LITE_STATIC_MEMORY
|
|
199
|
+
TFLITE_EMULATE_FLOAT
|
|
200
|
+
"$<$<CONFIG:RELEASE>:TF_LITE_STRIP_ERROR_STRINGS>"
|
|
201
|
+
${TFLM_OPTIMIZED_KERNEL_UPPER}
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
# Workaround for the following issue which does not envolve patching the tflite-micro codebase:
|
|
205
|
+
|
|
206
|
+
# .../micro_error_reporter.cc: In function 'tflite::ErrorReporter* tflite::GetMicroErrorReporter()':
|
|
207
|
+
# .../micro_error_reporter.cc:58:76: error: 'static void tflite::MicroErrorReporter::operator delete(void*)' is private within this context
|
|
208
|
+
# 58 | error_reporter_ = new (micro_error_reporter_buffer) MicroErrorReporter();
|
|
209
|
+
# | ^
|
|
210
|
+
# In file included from .../micro_error_reporter.h:21,
|
|
211
|
+
# from .../micro_error_reporter.cc:16:
|
|
212
|
+
# .../compatibility.h:27:8: note: declared private here
|
|
213
|
+
# 27 | void operator delete(void* p) {}
|
|
214
|
+
# | ^~~~~~~~
|
|
215
|
+
# .../micro_error_reporter.h:51:3: note: in expansion of macro 'TF_LITE_REMOVE_VIRTUAL_DELETE'
|
|
216
|
+
# 51 | TF_LITE_REMOVE_VIRTUAL_DELETE
|
|
217
|
+
#
|
|
218
|
+
# If disabling the exceptions has major disadvantages needs to be investigated.
|
|
219
|
+
|
|
220
|
+
TARGET_COMPILE_OPTIONS(tflm PUBLIC
|
|
221
|
+
-fno-exceptions
|
|
222
|
+
)
|
|
223
|
+
# cmake-format: on
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
SET(TVM_ALIGNMENT_BYTES 4)
|
|
2
|
+
|
|
3
|
+
# cmake-format: off
|
|
4
|
+
SET(TVM_HEADERS
|
|
5
|
+
${CONFIG_TVM_DIR}/include
|
|
6
|
+
${CONFIG_TVM_DIR}/3rdparty/dlpack/include
|
|
7
|
+
${CONFIG_TVM_DIR}/apps/bundle_deploy
|
|
8
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/include
|
|
9
|
+
)
|
|
10
|
+
# cmake-format: on
|
|
11
|
+
|
|
12
|
+
IF(CONFIG_TVM_CRT_CONFIG_DIR)
|
|
13
|
+
LIST(APPEND TVM_HEADERS ${CONFIG_TVM_CRT_CONFIG_DIR})
|
|
14
|
+
ELSE()
|
|
15
|
+
LIST(APPEND TVM_HEADERS ${CONFIG_TVM_DIR}/apps/bundle_deploy/crt_config)
|
|
16
|
+
ENDIF()
|
|
17
|
+
|
|
18
|
+
# cmake-format: off
|
|
19
|
+
ADD_LIBRARY(tvm_static_rt STATIC
|
|
20
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/common/crt_runtime_api.c
|
|
21
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/memory/stack_allocator.c
|
|
22
|
+
)
|
|
23
|
+
# cmake-format: on
|
|
24
|
+
|
|
25
|
+
TARGET_INCLUDE_DIRECTORIES(tvm_static_rt PUBLIC ${TVM_HEADERS})
|
|
26
|
+
|
|
27
|
+
# cmake-format: off
|
|
28
|
+
TARGET_COMPILE_DEFINITIONS(tvm_static_rt PUBLIC
|
|
29
|
+
-DTVM_RUNTIME_ALLOC_ALIGNMENT_BYTES=${TVM_ALIGNMENT_BYTES}
|
|
30
|
+
)
|
|
31
|
+
# cmake-format: on
|
|
32
|
+
|
|
33
|
+
# cmake-format: off
|
|
34
|
+
ADD_LIBRARY(tvm_graph_rt STATIC
|
|
35
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/common/crt_backend_api.c
|
|
36
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/common/crt_runtime_api.c
|
|
37
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/common/func_registry.c
|
|
38
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/memory/page_allocator.c
|
|
39
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/memory/stack_allocator.c
|
|
40
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/common/ndarray.c
|
|
41
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/common/packed_func.c
|
|
42
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/graph_executor/graph_executor.c
|
|
43
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/graph_executor/load_json.c
|
|
44
|
+
)
|
|
45
|
+
# cmake-format: on
|
|
46
|
+
|
|
47
|
+
TARGET_INCLUDE_DIRECTORIES(tvm_graph_rt PUBLIC ${TVM_HEADERS})
|
|
48
|
+
|
|
49
|
+
# cmake-format: off
|
|
50
|
+
TARGET_COMPILE_DEFINITIONS(tvm_graph_rt PUBLIC
|
|
51
|
+
-DTVM_RUNTIME_ALLOC_ALIGNMENT_BYTES=${TVM_ALIGNMENT_BYTES}
|
|
52
|
+
)
|
|
53
|
+
# cmake-format: on
|
|
54
|
+
|
|
55
|
+
# cmake-format: off
|
|
56
|
+
ADD_LIBRARY(tvm_aot_rt STATIC
|
|
57
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/common/crt_backend_api.c
|
|
58
|
+
${CONFIG_TVM_DIR}/src/runtime/crt/memory/stack_allocator.c
|
|
59
|
+
)
|
|
60
|
+
# cmake-format: on
|
|
61
|
+
|
|
62
|
+
TARGET_INCLUDE_DIRECTORIES(tvm_aot_rt PUBLIC ${TVM_HEADERS})
|
|
63
|
+
|
|
64
|
+
# cmake-format: off
|
|
65
|
+
TARGET_COMPILE_DEFINITIONS(tvm_aot_rt PUBLIC
|
|
66
|
+
-DTVM_RUNTIME_ALLOC_ALIGNMENT_BYTES=${TVM_ALIGNMENT_BYTES}
|
|
67
|
+
)
|
|
68
|
+
# cmake-format: on
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
set(CLANG_VERSIONS 15 14)
|
|
2
|
+
|
|
3
|
+
set(LLVM_DIR "" CACHE PATH "Lookup path for the llvm installation.")
|
|
4
|
+
MESSAGE("LLVM_DIR=${LLVM_DIR}")
|
|
5
|
+
|
|
6
|
+
# Find clang
|
|
7
|
+
function(do_lookup program out)
|
|
8
|
+
set(VERSION_NAMES "")
|
|
9
|
+
foreach(version ${CLANG_VERSIONS})
|
|
10
|
+
set(NEW_NAME "${program}-${version}")
|
|
11
|
+
list(APPEND VERSION_NAMES ${NEW_NAME})
|
|
12
|
+
endforeach()
|
|
13
|
+
# Custom path, explicit versions
|
|
14
|
+
find_program(${program}_NAME_MATCH NAMES ${VERSION_NAMES} PATHS ${LLVM_DIR}/bin/ NO_DEFAULT_PATH)
|
|
15
|
+
IF(NOT ${program}_NAME_MATCH)
|
|
16
|
+
# System path, explicit versions
|
|
17
|
+
find_program(${program}_NAME_MATCH NAMES ${VERSION_NAMES})
|
|
18
|
+
IF(NOT ${program}_NAME_MATCH)
|
|
19
|
+
# Custom path, implicit version
|
|
20
|
+
find_program(${program}_NAME_MATCH NAMES ${program} PATHS ${LLVM_DIR}/bin/ NO_DEFAULT_PATH)
|
|
21
|
+
IF(NOT ${program}_NAME_MATCH)
|
|
22
|
+
# System path, implicit version
|
|
23
|
+
find_program(${program}_NAME_MATCH NAMES ${program})
|
|
24
|
+
ENDIF()
|
|
25
|
+
ENDIF()
|
|
26
|
+
ENDIF()
|
|
27
|
+
IF(NOT ${program}_NAME_MATCH)
|
|
28
|
+
MESSAGE(FATAL_ERROR "Unable to find ${program} executable")
|
|
29
|
+
ENDIF()
|
|
30
|
+
MESSAGE(STATUS "${program}_NAME_MATCH=${${program}_NAME_MATCH}")
|
|
31
|
+
set(${out} ${${program}_NAME_MATCH} PARENT_SCOPE)
|
|
32
|
+
endfunction()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
do_lookup(clang CLANG_EXECUTABLE)
|
|
36
|
+
do_lookup(clang++ CLANG++_EXECUTABLE)
|
|
37
|
+
do_lookup(lld LLD_EXECUTABLE)
|
|
38
|
+
|
|
39
|
+
MESSAGE(STATUS "CLANG_EXECUTABLE=${CLANG_EXECUTABLE}")
|
|
40
|
+
MESSAGE(STATUS "CLANG++_EXECUTABLE=${CLANG++_EXECUTABLE}")
|
|
41
|
+
MESSAGE(STATUS "LLD_EXECUTABLE=${LLD_EXECUTABLE}")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
IF("${MLONMCU_FRAMEWORK}" STREQUAL "")
|
|
2
|
+
SET(MLONMCU_FRAMEWORK "tvm")
|
|
3
|
+
ENDIF()
|
|
4
|
+
|
|
5
|
+
SET(TVM_REQUIRED_COMPONENTS a b c)
|
|
6
|
+
|
|
7
|
+
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DTVMCG_DEBUG_ALLOCATIONS")
|
|
8
|
+
|
|
9
|
+
SET(TVM_LIB tvm_aot_rt)
|
|
10
|
+
SET(TVM_WRAPPER_FILENAME aot_wrapper.c)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
IF("${MLONMCU_FRAMEWORK}" STREQUAL "")
|
|
2
|
+
SET(MLONMCU_FRAMEWORK "tvm")
|
|
3
|
+
ENDIF()
|
|
4
|
+
|
|
5
|
+
SET(TVM_REQUIRED_COMPONENTS a b c)
|
|
6
|
+
|
|
7
|
+
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DTVMCG_DEBUG_ALLOCATIONS")
|
|
8
|
+
|
|
9
|
+
SET(TVM_LIB tvm_aot_rt)
|
|
10
|
+
SET(TVM_WRAPPER_FILENAME aot_wrapper.c)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
IF("${MLONMCU_FRAMEWORK}" STREQUAL "")
|
|
2
|
+
SET(MLONMCU_FRAMEWORK "tvm")
|
|
3
|
+
ENDIF()
|
|
4
|
+
|
|
5
|
+
SET(TVM_REQUIRED_COMPONENTS a b c)
|
|
6
|
+
|
|
7
|
+
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DTVMAOT_DEBUG_ALLOCATIONS")
|
|
8
|
+
|
|
9
|
+
SET(TVM_LIB tvm_static_rt)
|
|
10
|
+
SET(TVM_WRAPPER_FILENAME staticrt.c)
|