-
Notifications
You must be signed in to change notification settings - Fork 12
/
generate_dwarf.py
36 lines (25 loc) · 1.02 KB
/
generate_dwarf.py
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
29
30
31
32
33
# tool that generates dwarfs in directories
import sys
import argparse
import os
parser = argparse.ArgumentParser("Create dwarf directories")
parser.add_argument('dwarf', help='The dwarf for the new benchmark creates one if it does not exist', nargs=1)
parser.add_argument('bench', help='The benchmark to be made', nargs=1)
args= vars(parser.parse_args())
dwarf_dir = args["dwarf"][0]
bench_dir = dwarf_dir + "/" +args["bench"][0]
dirs = ["c", "js", "asmjs", "opencl", "webcl", "common", "data", "tools"]
#create the dwarf directory if it does not already exist
if(not os.path.exists(dwarf_dir)):
print "Creating dwarf directory " + dwarf_dir + " ..."
os.makedirs(dwarf_dir)
#create the bench directory in dwarf
if(not os.path.exists(bench_dir)):
print "Creating benchmark directory " + bench_dir + " ..."
os.makedirs(bench_dir)
for d in dirs:
print "Creating " + d + " directory ..."
os.makedirs(bench_dir + "/" + d)
else:
print "Benchmark directory " + bench_dir + " already exists!"
print "done"