Skip to content

Commit 55dcf1a

Browse files
author
Olivia W Hsu
committed
Add rename csv aggregator and add in --taco flag to work for both taco and numpy
1 parent 1605f9b commit 55dcf1a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/taco_bench_aggregator.py renamed to scripts/bench_csv_aggregator.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import tqdm
66
import argparse
77

8-
def aggregateTacoBenches(folder, outfile, labelSet=None):
8+
def aggregateTacoBenches(folder, outfile, taco=False, labelSet=None):
99
first = True
1010
outputFile = open(outfile, 'w+')
1111
writer = csv.writer(outputFile, delimiter=',')
@@ -20,8 +20,9 @@ def aggregateTacoBenches(folder, outfile, labelSet=None):
2020
with open(fname, 'r') as f:
2121
# Discard the first 10 lines. This corresponds to the
2222
# google-benchmark generated header.
23-
# for i in range(0, 10):
24-
# f.readline()
23+
if taco:
24+
for i in range(0, 10):
25+
f.readline()
2526
# Open the rest of the file as a CSV.
2627
reader = csv.reader(f)
2728
# Attempt to read the header from CSV. If this fails,
@@ -52,5 +53,6 @@ def aggregateTacoBenches(folder, outfile, labelSet=None):
5253
parser.add_argument('target_directory', type=str, help="Directory containing CSV's to aggregate")
5354
parser.add_argument('output_csv_name', type=str, help="Name of the CSV to generate")
5455
parser.add_argument('--label_set_file', type=str, default=None, help='Set to output all valid labels seen to a file')
56+
parser.add_argument('--taco', action='store_true', help='Flag to aggregate TACO csvs, default is numpy')
5557
args = parser.parse_args()
56-
aggregateTacoBenches(args.target_directory, args.output_csv_name, labelSet=args.label_set_file)
58+
aggregateTacoBenches(args.target_directory, args.output_csv_name, taco=args.taco, labelSet=args.label_set_file)

0 commit comments

Comments
 (0)