(arch_str)
| 72 | |
| 73 | # set test config and run |
| 74 | def set_config_and_run(arch_str): |
| 75 | for arch_desc in arch_str: |
| 76 | kernel_build_dir = kernel_build_dirs[arch_desc] |
| 77 | for model in all_models.models: |
| 78 | for framework in framework_str: |
| 79 | for log_level in [False, True]: |
| 80 | if framework == "megcc": |
| 81 | extension = "tiny" |
| 82 | model_path = "{}/{}.tiny".format( |
| 83 | kernel_build_dir, model.name) |
| 84 | model_ = ValidModel(model_path, model.name, extension) |
| 85 | output_dir_ = ValidOutputDir( |
| 86 | "{}/benchmark/output".format(megcc_path), "output") |
| 87 | benchmarker_list[arch_desc].set_config( |
| 88 | profile_kernel=log_level, |
| 89 | benchmark_framework=framework, |
| 90 | model=model_, |
| 91 | output_dir=output_dir_, |
| 92 | ) |
| 93 | if arch_desc == "x86": |
| 94 | benchmarker_list[arch_desc].run_local() |
| 95 | elif (arch_desc == "riscv" or arch_desc == "armv7" |
| 96 | or arch_desc == "arm64"): |
| 97 | # run for different device may avoid the effection of device heat radiation |
| 98 | for ssh_device in ssh_device_info: |
| 99 | ssh_name = ssh_device["name"] |
| 100 | ssh_host = ssh_device["host"] |
| 101 | ssh_workdir = ssh_device["workdir"] |
| 102 | benchmarker_list[arch_desc].run_ssh_device( |
| 103 | ssh_name, ssh_host, ssh_workdir) |
| 104 | else: |
| 105 | print("unsupported arch type: {} in megcc".format( |
| 106 | arch_desc)) |
| 107 | return |
| 108 | |
| 109 | |
| 110 | def main(): |
no test coverage detected