Пример #1
0
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']
Пример #2
0
 def run(self, cfg):
   return pbutil.executeTimingRun(pbutil.benchmarkToBin(self.benchmark),
                                  int(self.n),
                                  ['--trials=%d'%TRAILS,
                                   '--config='+cfg,
                                   '--accuracy'],
                                  None,
                                  ['timing', 'accuracy'])
Пример #3
0
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']
Пример #4
0
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)
Пример #5
0
 def run(self, cfg):
     return pbutil.executeTimingRun(
         pbutil.benchmarkToBin(self.benchmark), int(self.n),
         ['--trials=%d' % TRAILS, '--config=' + cfg, '--accuracy'], None,
         ['timing', 'accuracy'])