| 21 | pass |
| 22 | |
| 23 | def run_perf_process(name, size, backend = ""): |
| 24 | if not backend: |
| 25 | proc = "perf_%s" % name |
| 26 | else: |
| 27 | proc = "perf_%s_%s" % (backend, name) |
| 28 | |
| 29 | filename = "./perf/" + proc |
| 30 | |
| 31 | if not os.path.isfile(filename): |
| 32 | print("Error: failed to find ", filename, " for running") |
| 33 | return 0 |
| 34 | try: |
| 35 | output = subprocess.check_output([filename, str(int(size))]) |
| 36 | except: |
| 37 | return 0 |
| 38 | |
| 39 | t = 0 |
| 40 | for line in output.decode('utf8').split("\n"): |
| 41 | if line.startswith("time:"): |
| 42 | t = float(line.split(":")[1].split()[0]) |
| 43 | |
| 44 | return t |
| 45 | |
| 46 | class Report: |
| 47 | def __init__(self, name): |