MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / run_perf_process

Function run_perf_process

compute/perf/perf.py:23–44  ·  view source on GitHub ↗
(name, size, backend = "")

Source from the content-addressed store, hash-verified

21 pass
22
23def 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
46class Report:
47 def __init__(self, name):

Callers 1

run_benchmarkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected