build.xml 2.01 KB
Newer Older
1
2
3
4
<?xml version="1.0"?>

<project name="convolution" default="build" basedir=".">

5
6
7
8
9
10
11
	<!-- Ideally this would be the latest version of Java but not everyone is going to have it installed -->
	<!-- Additionally we want to avoid "Class not found: javac1.8" errors from old Ant versions (i.e. Eclipse) -->
	<property name="build.compiler" value="javac1.7" />
	<property name="ant.build.javac.source" value="1.7" />
	<property name="ant.build.javac.target" value="1.7" />

	<path id="compiler.class.path">
12
		<pathelement path="../../com.syncleus.aparapi/dist/aparapi.jar" />
13
14
15
16
17
18
19
20
21
22
23
	</path>

	<path id="runtime.class.path" cache="true">
		<path refid="compiler.class.path" />
		<pathelement path="${ant.project.name}.jar" />
	</path>

	<target name="build" depends="clean">
		<mkdir dir="classes" />
		<javac srcdir="src" destdir="classes" debug="on" includeantruntime="false">
			<classpath>
24
				<pathelement path="../../com.syncleus.aparapi/dist/aparapi.jar" />
25
26
27
28
29
30
31
32
33
34
35
36
			</classpath>
		</javac>
		<copy file="src\com\amd\aparapi\sample\convolution\convolution.cl" toDir="classes\com\amd\aparapi\sample\convolution" />
		<jar jarfile="${ant.project.name}.jar" basedir="classes" />
	</target>

	<target name="clean">
		<delete dir="classes" />
		<delete file="${ant.project.name}.jar" />
	</target>

	<target name="run-jtp">
37
		<java classname="com.syncleus.aparapi.sample.convolution.Convolution" fork="true">
38
			<classpath refid="runtime.class.path" />
39
40
			<sysproperty key="java.library.path" path="..\..\com.syncleus.aparapi.jni\dist" />
			<sysproperty key="com.syncleus.aparapi.executionMode" value="JTP" />
41
42
43
44
		</java>
	</target>

	<target name="run-gpu">
45
		<java classname="com.syncleus.aparapi.sample.convolution.Convolution" fork="true">
46
			<classpath refid="runtime.class.path" />
47
48
			<sysproperty key="java.library.path" path="..\..\com.syncleus.aparapi.jni\dist" />
			<sysproperty key="com.syncleus.aparapi.executionMode" value="GPU" />
49
50
51
52
		</java>
	</target>

	<target name="run" depends="run-gpu" />
53
54

</project>