def timingRun(ctx, n, limit=None): if limit >= maxint: limit=None if limit is not None: limit=int(math.ceil(limit)) args=["--transform="+nameof(ctx)] args.extend(defaultArgs) return pbutil.executeTimingRun(pbutil.benchmarkToBin(app), n, args, limit)['average']
def run(self, cfg): return pbutil.executeTimingRun(pbutil.benchmarkToBin(self.benchmark), int(self.n), ['--trials=%d'%TRAILS, '--config='+cfg, '--accuracy'], None, ['timing', 'accuracy'])
def timingRun(ctx, n, limit=None): if limit >= maxint: limit = None if limit is not None: limit = int(math.ceil(limit)) args = ["--transform=" + nameof(ctx)] args.extend(defaultArgs) return pbutil.executeTimingRun(pbutil.benchmarkToBin(app), n, args, limit)['average']
def runCfg(benchmark, cfg, n, args=['--trials=5']): fd, tmp = tempfile.mkstemp('.cfg') try: os.close(fd) cfg.save(tmp) perf, acc = pbutil.executeTimingRun(pbutil.benchmarkToBin(benchmark), int(n), args+['--config='+tmp, '--accuracy'], None, ['timing', 'accuracy']) return perf['average'], acc['average'] finally: os.unlink(tmp)
def run(self, cfg): return pbutil.executeTimingRun( pbutil.benchmarkToBin(self.benchmark), int(self.n), ['--trials=%d' % TRAILS, '--config=' + cfg, '--accuracy'], None, ['timing', 'accuracy'])