| 47 | self.benchmark_arch = benchmark_arch |
| 48 | |
| 49 | def build(self, x86_target="fallback", build_options=""): |
| 50 | # build prepare |
| 51 | if not os.path.exists(self.benchmark_build_dir) or os.path.isfile( |
| 52 | self.benchmark_build_dir): |
| 53 | os.makedirs(self.benchmark_build_dir) |
| 54 | # build megengine lib and set cmake build options |
| 55 | cmd = "cd {} && cmake {}/benchmark {} -G Ninja && ninja install/strip".format( |
| 56 | self.benchmark_build_dir, megcc_path, build_options) |
| 57 | subprocess.check_call(cmd, shell=True) |
| 58 | |
| 59 | def set_config( |
| 60 | self, |