@@ -29,37 +29,40 @@ class Optimization extends TestLLSC {
29
29
import scala .collection .mutable .ListBuffer
30
30
import java .io .{File , FileWriter }
31
31
val writer = new FileWriter (new File (" opt_exp.csv" ), true )
32
- val N = 0
32
+ val N = 5
33
33
34
34
def testLLSC (N : Int , llsc : LLSC , tst : TestPrg ): Unit = {
35
35
val TestPrg (m, name, f, config, cliArg, exp) = tst
36
36
test(llsc.insName + " _" + name) {
37
37
val code = llsc.run(m, llsc.insName + " _" + name, f, config)
38
- val mkRet = code.make(4 )
38
+ val mkRet = code.make(8 )
39
39
assert(mkRet == 0 , " make failed" )
40
40
for (i <- 1 to N ) {
41
41
Thread .sleep(1 * 1000 )
42
42
val prefix = " numactl -N1 -m1"
43
43
val (output, ret) = code.runWithStatus(cliArg, prefix)
44
44
val resStat = parseOutput(llsc.insName, name, output)
45
45
System .out.println(resStat)
46
- writer.append(s " $resStat\n " )
46
+ writer.append(s " ${tst.toString}\n " )
47
+ writer.append(s " $output\n " )
48
+ writer.append(s " $resStat\n\n " )
47
49
writer.flush()
48
50
}
49
51
}
50
52
}
51
53
}
52
54
53
55
/*
56
+ // Test algorithm benchmarks
54
57
class TestImpCPSOpt extends Optimization {
55
58
val llsc = new ImpCPSLLSC
56
59
Config.enableOpt
57
- testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/mergesort .ll"), "mergeSort_Opt ", "@main", noArg, "--solver=z3", nPath(5040 )))
58
- testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/bubblesort .ll"), "bubbleSort_Opt ", "@main", noArg, "--solver=z3", nPath(720 )))
59
- testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/knapsack .ll"), "knapsack_Opt ", "@main", noArg, "--solver=z3", nPath(1666 )))
60
- testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/kmpmatcher .ll"), "kmp_Opt ", "@main", noArg, "--solver=z3", nPath(4181 )))
61
- testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/nqueen.ll"), "nqueen_Opt", "@main", noArg, "--solver=z3", nPath(1363)))
62
- testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/quicksort.ll"), "quicksort_Opt", "@main", noArg, "--solver=z3", nPath(5040)))
60
+ testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/kmpmatcher .ll"), "kmp_Opt ", "@main", noArg, "--cons-indep -- solver=z3", nPath(4181 )))
61
+ testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/mergesort .ll"), "mergeSort_Opt ", "@main", noArg, "--cons-indep -- solver=z3", nPath(5040 )))
62
+ testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/bubblesort .ll"), "bubbleSort_Opt ", "@main", noArg, "--cons-indep -- solver=z3", nPath(720 )))
63
+ testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/knapsack .ll"), "knapsack_Opt ", "@main", noArg, "--cons-indep -- solver=z3", nPath(1666 )))
64
+ testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/nqueen.ll"), "nqueen_Opt", "@main", noArg, "--cons-indep -- solver=z3", nPath(1363)))
65
+ testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/quicksort.ll"), "quicksort_Opt", "@main", noArg, "--cons-indep -- solver=z3", nPath(5040)))
63
66
}
64
67
65
68
class TestPureCPSOpt extends Optimization {
0 commit comments