File size: 1,233 Bytes
81b9afd 0cea2c9 81b9afd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import csv
import pathlib
import time
folder = str(pathlib.Path(__file__).parent.resolve())
with open(folder+"/Fig10.csv", mode='w', newline='', encoding='utf-8') as out_file:
csv_writer = csv.writer(out_file)
csv_writer.writerow(["Target", "Case", "LLVM-Base", "LLVM-VEGA"])
with open(folder+"/LLVM-RISCV.csv", mode='r', encoding='utf-8') as csv_file:
csv_reader = csv.reader(csv_file)
next(csv_reader)
for row in csv_reader:
csv_writer.writerow(["RISCV", row[0], round(float(row[1]) / float(row[2]), 6), round(float(row[1]) / float(row[3]), 6)])
with open(folder+"/LLVM-RI5CY.csv", mode='r', encoding='utf-8') as csv_file:
csv_reader = csv.reader(csv_file)
next(csv_reader)
for row in csv_reader:
csv_writer.writerow(["RI5CY", row[0], round(float(row[1]) / float(row[2]), 6), round(float(row[1]) / float(row[3]), 6)])
with open(folder+"/LLVM-xCORE.csv", mode='r', encoding='utf-8') as csv_file:
csv_reader = csv.reader(csv_file)
next(csv_reader)
for row in csv_reader:
csv_writer.writerow(["xCORE", row[0], round(float(row[1]) / float(row[2]), 6), round(float(row[1]) / float(row[3]), 6)]) |