-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
186 lines (163 loc) · 6.2 KB
/
build.xml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?xml version="1.0" encoding="UTF-8"?>
<project name="AeminiumGPU" basedir="." default="main">
<property name="src.dir" value="src"/>
<property name="build.dir" value="bin"/>
<property name="lib.dir" value="lib"/>
<property name="logs.dir" value="logs"/>
<property name="classes.dir" value="${build.dir}"/>
<property name="jar.dir" value="dist"/>
<property name="templates.dir" value="templates"/>
<property name="verbose" value="false" />
<!-- <property name="main-class" value="aeminium.gpu.examples.RecIntegral"/>-->
<!-- <property name="main-class" value="aeminium.gpu.examples.FilterToFilterExample"/>-->
<!-- <property name="main-class" value="aeminium.gpu.recorder.FilterRecorder"/>-->
<property name="main-class" value="aeminium.gpu.examples.FilterExample"/>
<property name="info-class" value="aeminium.gpu.utils.HardwareReport"/>
<property name="bench-class" value="aeminium.gpu.recorder.Recorder"/>
<property name="lib.dir" value="lib"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<path id="classpath.test">
<pathelement location="${classes.dir}" />
<path refid="classpath" />
</path>
<target name="clean">
<echo message="In clean "/>
<delete dir="${build.dir}"/>
</target>
<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" debug="true" debuglevel="lines,vars,source"/>
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<fileset dir="." includes="**/*.clt" />
<fileset dir="." includes="data/*" />
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<zipgroupfileset dir="${lib.dir}" includes="**/*.jar" />
</jar>
</target>
<target name="fetchruntime">
<exec executable="ant" dir="../AeminiumRuntime/">
<arg value="jar" />
</exec>
<copy file="../AeminiumRuntime/dist/AeminiumRuntime.jar" todir="${lib.dir}" />
</target>
<target name="run" depends="jar">
<java fork="true" classname="${main-class}">
<jvmarg value="-Xms512m" />
<jvmarg value="-Xmx1536m" />
<classpath>
<path refid="classpath"/>
<path location="${jar.dir}/${ant.project.name}.jar"/>
</classpath>
</java>
</target>
<target name="info" depends="jar">
<java fork="true" classname="${info-class}">
<jvmarg value="-Xms512m" />
<jvmarg value="-Xmx1536m" />
<classpath>
<path refid="classpath"/>
<path location="${jar.dir}/${ant.project.name}.jar"/>
</classpath>
</java>
</target>
<target name="record" depends="jar">
<java fork="true" classname="${bench-class}">
<classpath>
<path refid="classpath"/>
<path location="${jar.dir}/${ant.project.name}.jar"/>
</classpath>
</java>
</target>
<target name="clean-build" depends="clean,jar"/>
<target name="main" depends="clean,run"/>
<target name="test" depends="compile">
<junit failureProperty="test.failure" fork="true">
<jvmarg value="-Xms512m" />
<jvmarg value="-Xmx1536m" />
<classpath refid="classpath.test" />
<formatter type="brief" usefile="false" />
<test name="${testcase}" todir="${classes.dir}" if="${testcase}"/>
<batchtest>
<fileset dir="${classes.dir}" includes="aeminium/gpu/tests/*.class aeminium/gpu/tests/*/*.class aeminium/gpu/tests/*/*/*.class" excludes="**/*$*.class **/*Template.class" />
</batchtest>
</junit>
<fail message="test failed" if="test.failure" />
</target>
<target name="pre-benchmark" depends="compile,getgitdetails">
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${lib.dir}/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<tstamp/>
<property name="logdir" value="${logs.dir}/${DSTAMP}_${TSTAMP}__rev-${git.rev}/" />
<mkdir dir="${logdir}"/>
</target>
<target name="benchmark" depends="pre-benchmark">
<antcall target="all_benchmarks_once"></antcall>
</target>
<target name="benchmark30" depends="pre-benchmark">
<taskdef resource="ise/antelope/tasks/antlib.xml">
<classpath>
<pathelement location="${lib.dir}/ant-repeat.jar"/>
</classpath>
</taskdef>
<repeat count="30">
<antcall target="all_benchmarks_once"></antcall>
</repeat>
</target>
<target name="single_benchmark" depends="pre-benchmark">
<for list="0,1,2" param="test">
<sequential>
<java fork="true" classname="aeminium.gpu.benchmark.${bench}">
<arg value="@{test}" />
<jvmarg value="-Xms512m" />
<jvmarg value="-Xmx1536m" />
<classpath>
<path refid="classpath"/>
<pathelement location="${classes.dir}" />
</classpath>
</java>
</sequential>
</for>
</target>
<target name="all_benchmarks_once">
<for param="file">
<path>
<fileset dir="${src.dir}/aeminium/gpu/benchmark" excludes="Benchmark.java,BenchmarkExecutor.java"/>
</path>
<sequential>
<propertyregex override="yes"
property="name" input="@{file}"
regexp=".*/([^\.]*)\.java" replace="\1"/>
<echo>${name}</echo>
<for list="0,1,2" param="test">
<sequential>
<java fork="true" classname="aeminium.gpu.benchmark.${name}" output="${logdir}/${name}.log" append="true">
<arg value="@{test}" />
<jvmarg value="-Xms512m" />
<jvmarg value="-Xmx1536m" />
<classpath>
<path refid="classpath"/>
<pathelement location="${classes.dir}" />
</classpath>
</java>
</sequential>
</for>
</sequential>
</for>
</target>
<target name="getgitdetails" >
<exec executable="git" outputproperty="git.rev">
<arg value="rev-parse"/>
<arg value="HEAD"/>
</exec>
</target>
</project>