(model_name, data_type, debug_mode=False)
| 41 | |
| 42 | |
| 43 | def build_engine(model_name, data_type, debug_mode=False): |
| 44 | mace_check(flags.model_name is not None and len(model_name) > 0, |
| 45 | "you should specify model name for build.") |
| 46 | debug_option = "Debug" if debug_mode else "Release" |
| 47 | command = ("micro/tools/cmake/cmake-build-host.sh" |
| 48 | " -DMICRO_MODEL_NAME=%s -DMACE_MICRO_ENABLE_CMSIS=ON" |
| 49 | " -DMACE_MICRO_ENABLE_TOOLS=ON" |
| 50 | " -DCMAKE_BUILD_TYPE=%s" % (model_name, debug_option)) |
| 51 | if data_type == mace_pb2.DT_BFLOAT16: |
| 52 | command += " -DMACE_MICRO_ENABLE_BFLOAT16=ON" |
| 53 | print("The current engine's data type is bfloat16.") |
| 54 | else: |
| 55 | command += " -DMACE_MICRO_ENABLE_BFLOAT16=OFF" |
| 56 | |
| 57 | device.execute(command) |
| 58 | |
| 59 | |
| 60 | def get_model_conf_by_name(flags, conf): |
no test coverage detected