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

Function plot_to_file

compute/perf/perfdoc.py:18–43  ·  view source on GitHub ↗
(report, filename)

Source from the content-addressed store, hash-verified

16fignum = 0
17
18def plot_to_file(report, filename):
19 global fignum
20 fignum += 1
21 pylab.figure(fignum)
22
23 run_to_label = {
24 "stl" : "C++ STL",
25 "thrust" : "Thrust",
26 "compute" : "Boost.Compute",
27 "bolt" : "Bolt"
28 }
29
30 for run in sorted(report.samples.keys()):
31 x = []
32 y = []
33
34 for sample in report.samples[run]:
35 x.append(sample[0])
36 y.append(sample[1])
37
38 pylab.loglog(x, y, marker='o', label=run_to_label[run])
39
40 pylab.xlabel("Size")
41 pylab.ylabel("Time (ms)")
42 pylab.legend(loc='upper left')
43 pylab.savefig(filename)
44
45if __name__ == '__main__':
46 sizes = [pow(2, x) for x in range(10, 26)]

Callers 1

perfdoc.pyFile · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected