diff options
author | Wade Walker <[email protected]> | 2015-09-07 14:46:52 -0500 |
---|---|---|
committer | Wade Walker <[email protected]> | 2015-11-08 14:05:28 -0600 |
commit | e56a17d6d7780b8597c78ce50808c8da68d094b5 (patch) | |
tree | a37f9d5f351dd0b85844521ad7d6897fcecc062c /make/build.xml | |
parent | 85dc2b1357470d2a51a69080d33aac442eae291f (diff) |
Add OpenCL 1.2 and 2.0 headers and CLImpl classes
Added stub includes for OpenCL 1.2 and 2.0. Added new CLImpl versions for
1.2 and 2.0 to the build, but left them unused for now. The CL bindings
used by JOCL are still generated from OpenCL 1.1, so the existing Java
code will be able to stay mostly unchanged in the future.
Diffstat (limited to 'make/build.xml')
-rw-r--r-- | make/build.xml | 180 |
1 files changed, 123 insertions, 57 deletions
diff --git a/make/build.xml b/make/build.xml index 5b49ad03..cbe251a5 100644 --- a/make/build.xml +++ b/make/build.xml @@ -176,13 +176,10 @@ <!-- Directories used for OpenCL header file preprocessing. --> <property name="etc.build.dir" value="${build}/etc" /> - <property name="headers.orig" value="${stub.includes}/CL11" /> + <property name="headers.orig" value="${stub.includes}/CL" /> <property name="headers.dest" value="${gen.includes}/CL" /> <!-- The headers from which Java files are generated --> - <dirset id="stub.includes.fileset.all" dir="."> - <include name="${gen.includes.dir}"/> - </dirset> <fileset id="stub.includes.dependencies.fileset.1" dir="${stub.includes.dir}"> <include name="CL11/**" /> <include name="GL3/**" /> @@ -349,18 +346,24 @@ <update-headers header="${headers.orig}/cl_platform.h" url="${registry.url}cl_platform.h"/> </target> + <!-- + - Copies the OpenCl headers to a new directory while uncommenting the function parameters so gluegen will work properly. + --> <target name="preprocess-opencl-headers" depends="make-build-utilities"> - <mkdir dir="${headers.dest}"/> + <property name="preprocess.from" value="${stub.includes}/CL${opencl.version}" /> + <property name="preprocess.to" value="${gen.includes}/CL${opencl.version}/CL" /> + <mkdir dir="${preprocess.to}"/> - <!--uncomment function names in c headers and copy modified files into include path--> - <!-- need to pass in basedir or it won't work inside Eclipse, where user.dir is Eclipse's bin dir--> - <uncomment-function-params src="${basedir}/${headers.orig}/cl.h" dest="${basedir}/${headers.dest}/cl.h"/> - <uncomment-function-params src="${basedir}/${headers.orig}/cl_gl.h" dest="${basedir}/${headers.dest}/cl_gl.h"/> + <!-- need to use absolute paths or it won't work inside Eclipse, where user.dir is Eclipse's bin dir--> + <property name="preprocess.from.abs" value="${basedir}/${stub.includes.dir}/CL${opencl.version}" /> + <property name="preprocess.to.abs" value="${basedir}/${gen.includes.dir}/CL${opencl.version}/CL" /> + <uncomment-function-params src="${preprocess.from.abs}/cl.h" dest="${preprocess.to.abs}/cl.h"/> + <uncomment-function-params src="${preprocess.from.abs}/cl_gl.h" dest="${preprocess.to.abs}/cl_gl.h"/> <!--nothing to uncomment in these headers--> - <copy file="${headers.orig}/cl_platform.h" toDir="${headers.dest}" overwrite="true"/> - <copy file="${headers.orig}/cl_ext.h" toDir="${headers.dest}" overwrite="true"/> - <copy file="${headers.orig}/cl_gl_ext.h" toDir="${headers.dest}" overwrite="true"/> + <copy file="${preprocess.from}/cl_platform.h" toDir="${preprocess.to}" overwrite="true"/> + <copy file="${preprocess.from}/cl_ext.h" toDir="${preprocess.to}" overwrite="true"/> + <copy file="${preprocess.from}/cl_gl_ext.h" toDir="${preprocess.to}" overwrite="true"/> </target> <!-- @@ -369,24 +372,37 @@ - the classpath reference id then running the task on each header. --> <target name="java.generate" depends="build.gluegen, java.generate.check" unless="java.generate.skip"> - <antcall target="java.generate.impl" inheritRefs="true" /> + <antcall target="preprocess-opencl-headers" inheritRefs="true"> + <param name="opencl.version" value="11" /> + </antcall> + <antcall target="preprocess-opencl-headers" inheritRefs="true"> + <param name="opencl.version" value="12" /> + </antcall> + <antcall target="preprocess-opencl-headers" inheritRefs="true"> + <param name="opencl.version" value="20" /> + </antcall> + + <antcall target="java.generate.impl" inheritRefs="true"/> </target> - <target name="java.generate.impl" depends="generate.jdk6.autocloseable, generate.jdk7.autocloseable, preprocess-opencl-headers"> + <target name="java.generate.impl" depends="generate.jdk6.autocloseable, generate.jdk7.autocloseable"> <!-- Add the GlueGen task to ANT --> - <taskdef name="gluegen" classname="com.jogamp.gluegen.ant.GlueGenTask" - classpathref="gluegen.classpath" /> + <taskdef name="gluegen" classname="com.jogamp.gluegen.ant.GlueGenTask" classpathref="gluegen.classpath" /> + + <dirset id="stub.includes.fileset.all.11" dir="."> + <include name="${gen.includes.dir}/CL11"/> + </dirset> <!-- Use the GlueGen task to generate the Java files --> + <echo message="GlueGen and JOGL stub include path: ${stub.includes.gluegen.all}"/> + <echo message="OpenCL stub include path for OpenCL version 1.1: ${toString:stub.includes.fileset.all.11}"/> - <echo message="Generating CLContextBinding.java"/> - <echo message="local stub include path ${toString:stub.includes.fileset.all}"/> - <echo message="relative stub include path ${stub.includes.gluegen.all}"/> + <echo message="Generating CLContextBinding.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-context-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -394,11 +410,11 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLProgramBinding.java"/> + <echo message="Generating CLProgramBinding.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-program-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -406,11 +422,11 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLKernelBinding.java"/> + <echo message="Generating CLKernelBinding.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-kernel-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -418,11 +434,11 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLCommandQueueBinding.java"/> + <echo message="Generating CLCommandQueueBinding.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-queue-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -430,11 +446,11 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLDeviceBinding.java"/> + <echo message="Generating CLDeviceBinding.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-device-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -442,11 +458,11 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLMemObjBinding.java"/> + <echo message="Generating CLMemObjBinding.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-mem-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -454,11 +470,11 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLImageBinding.java"/> + <echo message="Generating CLImageBinding.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-image-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -466,11 +482,11 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLBufferBinding.java"/> + <echo message="Generating CLBufferBinding.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-buffer-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -478,11 +494,11 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLSamplerBinding.java"/> + <echo message="Generating CLSamplerBinding.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-sampler-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -490,11 +506,11 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLEventBinding.java"/> + <echo message="Generating CLEventBinding.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-event-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -502,11 +518,11 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLPlatformBinding.java"/> + <echo message="Generating CLPlatformBinding.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-platform-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -514,11 +530,11 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CL.java"/> + <echo message="Generating CL.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" dumpCPP="false" @@ -526,27 +542,57 @@ <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLGL.java"/> + <echo message="Generating CLGL.java from OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/clgl-if.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.JavaEmitter" debug="false"> <classpath refid="gluegen.classpath" /> </gluegen> - <echo message="Generating CLAbstractImpl.java and CLProcAddressTable.java"/> + <echo message="Generating CLAbstractImpl.java, CLAbstractImpl_JNI.c, and CLProcAddressTable.java for OpenCL version 1.1"/> <gluegen src="${stub.includes}/opencl.h" outputRootDir="${build}" config="${config}/cl-impl.cfg" - includeRefid="stub.includes.fileset.all" + includeRefid="stub.includes.fileset.all.11" + literalInclude="${stub.includes.gluegen.all}" + emitter="com.jogamp.gluegen.procaddress.ProcAddressEmitter" + debug="false"> + <classpath refid="gluegen.classpath" /> + </gluegen> + + <dirset id="stub.includes.fileset.all.12" dir="."> + <include name="${gen.includes.dir}/CL12"/> + </dirset> + <echo message="OpenCL stub include path for OpenCL version 1.2: ${toString:stub.includes.fileset.all.12}"/> + <echo message="Generating CLAbstractImpl.java, CLAbstractImpl_JNI.c, and CLProcAddressTable.java for OpenCL version 1.2"/> + <gluegen src="${stub.includes}/opencl.h" + outputRootDir="${build}" + config="${config}/cl-impl-12.cfg" + includeRefid="stub.includes.fileset.all.12" + literalInclude="${stub.includes.gluegen.all}" + emitter="com.jogamp.gluegen.procaddress.ProcAddressEmitter" + debug="false"> + <classpath refid="gluegen.classpath" /> + </gluegen> + + <dirset id="stub.includes.fileset.all.20" dir="."> + <include name="${gen.includes.dir}/CL20"/> + </dirset> + <echo message="OpenCL stub include path for OpenCL version 2.0: ${toString:stub.includes.fileset.all.20}"/> + <echo message="Generating CLAbstractImpl.java, CLAbstractImpl_JNI.c, and CLProcAddressTable.java for OpenCL version 2.0"/> + <gluegen src="${stub.includes}/opencl.h" + outputRootDir="${build}" + config="${config}/cl-impl-20.cfg" + includeRefid="stub.includes.fileset.all.20" literalInclude="${stub.includes.gluegen.all}" emitter="com.jogamp.gluegen.procaddress.ProcAddressEmitter" debug="false"> <classpath refid="gluegen.classpath" /> - </gluegen> + </gluegen> <!-- Inform the user that the generators have successfully created - the necessary Java files --> @@ -626,10 +672,6 @@ <istrue value="${c.compiler.debug}"/> </condition> - <patternset id="c.src.files"> - <include name="${rootrel.generated.c.jocl}/*.c"/> - </patternset> - <echo message="Compiling @{output.lib.name}" /> <cc outtype="shared" @@ -640,22 +682,46 @@ multithreaded="true" exceptions="false"> - <fileset dir="${project.root}"> - <patternset refid="c.src.files"/> - </fileset> + <compiler extends="@{compiler.cfg.id}" > + <fileset dir="${project.root}"> + <include name="${rootrel.generated.c.jocl}11/*.c"/> + </fileset> + <sysincludepath path="${java.includes.dir}"/> + <sysincludepath path="${java.includes.dir.platform}"/> + <sysincludepath path="${stub.includes.gluegen.cc}"/> + <includepath path="${jogl.root}/make/stub_includes/opengl"/> + <includepath path="${gen.includes.dir}/CL11"/> + <!-- This is for the generated headers for handwritten C code --> + <includepath path="${src.generated.c}" /> + <includepath path="${src.c}"/> + </compiler> <compiler extends="@{compiler.cfg.id}" > + <fileset dir="${project.root}"> + <include name="${rootrel.generated.c.jocl}12/*.c"/> + </fileset> <sysincludepath path="${java.includes.dir}"/> <sysincludepath path="${java.includes.dir.platform}"/> <sysincludepath path="${stub.includes.gluegen.cc}"/> <includepath path="${jogl.root}/make/stub_includes/opengl"/> - <includepath path="${gen.includes.dir}"/> + <includepath path="${gen.includes.dir}/CL12"/> <!-- This is for the generated headers for handwritten C code --> <includepath path="${src.generated.c}" /> <includepath path="${src.c}"/> + </compiler> - <!-- This must come last to not override real include paths --> - <!-- includepath path="stub_includes/macosx" if="isOSX" / --> + <compiler extends="@{compiler.cfg.id}" > + <fileset dir="${project.root}"> + <include name="${rootrel.generated.c.jocl}20/*.c"/> + </fileset> + <sysincludepath path="${java.includes.dir}"/> + <sysincludepath path="${java.includes.dir.platform}"/> + <sysincludepath path="${stub.includes.gluegen.cc}"/> + <includepath path="${jogl.root}/make/stub_includes/opengl"/> + <includepath path="${gen.includes.dir}/CL20"/> + <!-- This is for the generated headers for handwritten C code --> + <includepath path="${src.generated.c}" /> + <includepath path="${src.c}"/> </compiler> <linker extends="@{linker.cfg.id}" /> |