add all materials
This commit is contained in:
parent
01e7a23ae2
commit
2ea0c0b60c
43 changed files with 20448 additions and 0 deletions
39
benchmark_low_level/parse_results.py
Normal file
39
benchmark_low_level/parse_results.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
# prefix is something like results_
|
||||
results = sys.argv[1]
|
||||
name = results.removeprefix('results_')
|
||||
types = {}
|
||||
results = open(results, 'rt')
|
||||
|
||||
|
||||
for idx, line in enumerate(results):
|
||||
if line.startswith('Memory read bandwidth'):
|
||||
types['bwr'] = idx
|
||||
elif line.startswith('Memory write bandwidth'):
|
||||
types['bww'] = idx
|
||||
elif line.startswith('Memory load latency'):
|
||||
types['lseq'] = idx
|
||||
elif line.startswith('Random load latency'):
|
||||
types['lrnd'] = idx
|
||||
else:
|
||||
pass
|
||||
|
||||
for typ, idx in types.items():
|
||||
csv = open(f'{name}-{typ}.csv', 'wt')
|
||||
results.seek(0)
|
||||
for count, line in enumerate(results):
|
||||
if count <= idx:
|
||||
continue
|
||||
if line.startswith('"'):
|
||||
continue
|
||||
try:
|
||||
val1, val2 = line.split(" ")
|
||||
except ValueError:
|
||||
# we are at the end of the section
|
||||
csv.close()
|
||||
break
|
||||
csv.write(f'{val1},{val2}')
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue