Exemplo n.º 1
0
def main():
  # Delimiter is ',' or ' ', skip if nested inside parens (e.g. gpu(a=b,c=d)).
  DELIMITER = r'[, ](?!(?:[^(]*\([^)]*\))*[^()]*\))'
  configs = re.split(DELIMITER, FLAGS.config)
  skps = _path.find_skps(FLAGS.skps)

  if FLAGS.adb:
    adb = Adb(FLAGS.device_serial)
    model = adb.get_device_model()
    if model == 'Pixel C':
      from _hardware_pixel_c import HardwarePixelC
      hardware = HardwarePixelC(adb)
    elif model == 'Nexus 6P':
      from _hardware_nexus_6p import HardwareNexus6P
      hardware = HardwareNexus6P(adb)
    else:
      from _hardware_android import HardwareAndroid
      print("WARNING: %s: don't know how to monitor this hardware; results "
            "may be unreliable." % model, file=sys.stderr)
      hardware = HardwareAndroid(adb)
  else:
    hardware = Hardware()

  with hardware:
    SKPBench.run_warmup(hardware.warmup_time)
    run_benchmarks(configs, skps, hardware)
Exemplo n.º 2
0
def main():
    # Delimiter is ',' or ' ', skip if nested inside parens (e.g. gpu(a=b,c=d)).
    DELIMITER = r'[, ](?!(?:[^(]*\([^)]*\))*[^()]*\))'
    configs = re.split(DELIMITER, FLAGS.config)
    skps = _path.find_skps(FLAGS.skps)

    if FLAGS.adb:
        adb = Adb(FLAGS.device_serial)
        model = adb.get_device_model()
        if model == 'Pixel C':
            from _hardware_pixel_c import HardwarePixelC
            hardware = HardwarePixelC(adb)
        else:
            from _hardware_android import HardwareAndroid
            print(
                "WARNING: %s: don't know how to monitor this hardware; results "
                "may be unreliable." % model,
                file=sys.stderr)
            hardware = HardwareAndroid(adb)
    else:
        hardware = Hardware()

    with hardware:
        if hardware.kick_in_time:
            print(
                "sleeping %i seconds to allow hardware settings to kick in..."
                % hardware.kick_in_time,
                file=sys.stderr)
            time.sleep(hardware.kick_in_time)
        run_benchmarks(configs, skps, hardware)
Exemplo n.º 3
0
def main():
    # Delimiter is ',' or ' ', skip if nested inside parens (e.g. gpu(a=b,c=d)).
    DELIMITER = r'[, ](?!(?:[^(]*\([^)]*\))*[^()]*\))'
    configs = re.split(DELIMITER, FLAGS.config)
    skps = _path.find_skps(FLAGS.skps)

    if FLAGS.adb:
        adb = Adb(FLAGS.device_serial)
        model = adb.get_device_model()
        if model == 'Pixel C':
            from _hardware_pixel_c import HardwarePixelC
            hardware = HardwarePixelC(adb)
        elif model == 'Nexus 6P':
            from _hardware_nexus_6p import HardwareNexus6P
            hardware = HardwareNexus6P(adb)
        else:
            from _hardware_android import HardwareAndroid
            print(
                "WARNING: %s: don't know how to monitor this hardware; results "
                "may be unreliable." % model,
                file=sys.stderr)
            hardware = HardwareAndroid(adb)
    else:
        hardware = Hardware()

    with hardware:
        SKPBench.run_warmup(hardware.warmup_time)
        run_benchmarks(configs, skps, hardware)