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)])