-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_O1.py
66 lines (48 loc) · 1.73 KB
/
test_O1.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import benchmark
import fracfact
import itertools
# n_factors = 8
# tests_lg2 = 5
# n_tests = 2**tests_lg2
# m = fracfact.FactorialMatrix(n_factors)
# m.fractionFactorial(tests_lg2)
# m.display()
tm = benchmark.TestManager(optionsfile="options-4.7.1.csv")
flags = ["-fauto-inc-dec", "-fcombine-stack-adjustments",
"-fcompare-elim", "-fcprop-registers",
"-fdce", "-fdefer-pop",
"-fdelayed-branch", "-fdse", "-fguess-branch-probability",
"-fif-conversion", "-fif-conversion2",
"-finline-functions-called-once", "-fipa-profile",
"-fipa-pure-const", "-fipa-reference",
"-fmerge-constants", "-fmove-loop-invariants",
"-fomit-frame-pointer", "-fshrink-wrap",
"-fsplit-wide-types", "-ftree-bit-ccp",
"-ftree-ccp", "-ftree-ch",
"-ftree-copy-prop", "-ftree-copyrename",
"-ftree-dce", "-ftree-dominator-opts",
"-ftree-dse", "-ftree-forwprop",
"-ftree-fre", "-ftree-loop-optimize",
"-ftree-phiprop", "-ftree-pta",
"-ftree-reassoc", "-ftree-sink",
"-ftree-sra", "-ftree-ter"]
tm.useOptionSubset(flags)
m = fracfact.FactorialMatrix(len(flags))
bd = m.fractionFactorial(11)
print "Best distance found", bd
m.addCombination([True for f in flags])
m.addCombination([False for f in flags])
comb_mat = m.getTrueFalse()
for i, comb in enumerate(comb_mat):
test = tm.createTest(comb)
test.loadOrRun()
r = test.getResult()
m.addResult(i, r)
idstr = "".join(map(lambda x: str(int(x)), comb))
print idstr, r
for c in itertools.combinations(m.header, 2):
v = m.getFactor(c)
print "Combination",c,"has effect",v
for i, c in enumerate(m.header):
v = m.getFactor(c)
print "Factor",c,"(",i,") has effect",v