diff --git a/examples/oopnbody/.gitignore b/examples/oopnbody/.gitignore deleted file mode 100644 index 840e7d3120ee3206168d49bf62df2c269c38e17e..0000000000000000000000000000000000000000 --- a/examples/oopnbody/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/classes/ diff --git a/examples/oopnbody/.project b/examples/oopnbody/.project deleted file mode 100644 index 87e9909a7b5c0a0524657fcb74a08eea0fac60c4..0000000000000000000000000000000000000000 --- a/examples/oopnbody/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>oopnbody</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/examples/oopnbody/README.txt b/examples/oopnbody/README.txt deleted file mode 100644 index d5fa243059d72a46e8fac2beaef35d7fa68f261a..0000000000000000000000000000000000000000 --- a/examples/oopnbody/README.txt +++ /dev/null @@ -1,20 +0,0 @@ -oopnbody readme - December 2012 - -This demo is an example of an Aparapi experimental feature to allow some -limited use of java objects in kernels, based on the regular nbody demo. - -There is limited support in Aparapi for using arrays of java objects in kernels, -where a kernel accesses the objects by indexing into the object array and the -only member functions on the objects that can be called -are bean-style getters and setters, where if the object -has a data member "foo" the getter will be named "getFoo" and so on. - -The types of the object fields accessed in a kernel in this way must be basic -types otherwise in line with Aparapi usage. - -This may allow a more natural java programming style. This is implemented by -copying the referenced object fields into C-style arrays of structs to pass to -OpenCL. Then when the kernel completes the data is replaced into the original -java object. The extra copying may result in lower performance than explicit -use of basic type arrays in the original java source. - diff --git a/examples/oopnbody/build.xml b/examples/oopnbody/build.xml deleted file mode 100644 index 2bc434cfd9d8b1ea7a4971f9096cb4bff66db5fe..0000000000000000000000000000000000000000 --- a/examples/oopnbody/build.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0"?> - -<project name="oopnbody" default="build" basedir="."> - - <echo>This project REQUIRES NBODY to be built first!!!</echo> - - <!-- 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" /> - - <property name="nbody.path" value="../nbody" /> - <property name="libs.root" value=".libs" /> - - <property name="jogl.all.jar" value="jogl-all.jar" /> - <property name="jogl.all.natives.macosx.jar" value="jogl-all-natives-macosx-universal.jar" /> - <property name="jogl.all.natives.windows.i586.jar" value="jogl-all-natives-windows-i586.jar" /> - <property name="jogl.all.natives.windows.amd64.jar" value="jogl-all-natives-windows-amd64.jar" /> - <property name="jogl.all.natives.linux.i586.jar" value="jogl-all-natives-linux-i586.jar" /> - <property name="jogl.all.natives.linux.amd64.jar" value="jogl-all-natives-linux-amd64.jar" /> - - <property name="gluegen.rt.jar" value="gluegen-rt.jar" /> - <property name="gluegen.rt.natives.macosx.jar" value="gluegen-rt-natives-macosx-universal.jar" /> - <property name="gluegen.rt.natives.windows.i586.jar" value="gluegen-rt-natives-windows-i586.jar" /> - <property name="gluegen.rt.natives.windows.amd64.jar" value="gluegen-rt-natives-windows-amd64.jar" /> - <property name="gluegen.rt.natives.linux.i586.jar" value="gluegen-rt-natives-linux-i586.jar" /> - <property name="gluegen.rt.natives.linux.amd64.jar" value="gluegen-rt-natives-linux-amd64.jar" /> - - <path id="compiler.class.path"> - <pathelement path="../../com.syncleus.aparapi/dist/aparapi.jar" /> - <pathelement path="${nbody.path}/${libs.root}/${jogl.all.jar}" /> - <pathelement path="${nbody.path}/${libs.root}/${jogl.all.natives.macosx.jar}" /> - <pathelement path="${nbody.path}/${libs.root}/${jogl.all.natives.windows.i586.jar}" /> - <pathelement path="${nbody.path}/${libs.root}/${jogl.all.natives.windows.amd64.jar}" /> - <pathelement path="${nbody.path}/${libs.root}/${jogl.all.natives.linux.i586.jar}" /> - <pathelement path="${nbody.path}/${libs.root}/${jogl.all.natives.linux.amd64.jar}" /> - <pathelement path="${nbody.path}/${libs.root}/${gluegen.rt.jar}" /> - <pathelement path="${nbody.path}/${libs.root}/${gluegen.rt.natives.macosx.jar}" /> - <pathelement path="${nbody.path}/${libs.root}/${gluegen.rt.natives.windows.i586.jar}" /> - <pathelement path="${nbody.path}/${libs.root}/${gluegen.rt.natives.windows.amd64.jar}" /> - <pathelement path="${nbody.path}/${libs.root}/${gluegen.rt.natives.linux.i586.jar}" /> - <pathelement path="${nbody.path}/${libs.root}/${gluegen.rt.natives.linux.amd64.jar}" /> - <pathelement path="classes" /> - </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 refid="compiler.class.path" /> - </javac> - <copy todir="classes/com/amd/aparapi/examples/oopnbody" file="src/com/amd/aparapi/examples/oopnbody/particle.jpg" /> - <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"> - <java classname="com.syncleus.aparapi.examples.oopnbody.Main" fork="true"> - <classpath refid="runtime.class.path" /> - <sysproperty key="java.library.path" path="..\..\com.syncleus.aparapi.jni\dist;jogamp" /> - <sysproperty key="com.syncleus.aparapi.executionMode" value="JTP" /> - <sysproperty key="bodies" value="16384" /> - <sysproperty key="height" value="800" /> - <sysproperty key="width" value="800" /> - </java> - </target> - - <target name="run-gpu"> - <java classname="com.syncleus.aparapi.examples.oopnbody.Main" fork="true"> - <classpath refid="runtime.class.path" /> - <sysproperty key="java.library.path" path="..\..\com.syncleus.aparapi.jni\dist;jogamp" /> - <sysproperty key="com.syncleus.aparapi.executionMode" value="GPU" /> - <sysproperty key="bodies" value="16384" /> - <sysproperty key="height" value="800" /> - <sysproperty key="width" value="800" /> - </java> - </target> - - <target name="run" depends="run-gpu" /> - -</project> diff --git a/examples/oopnbody/nbody.bat b/examples/oopnbody/nbody.bat deleted file mode 100644 index dc0380e1f6fe754e9b0ef8aa9c3e02d4947bf60f..0000000000000000000000000000000000000000 --- a/examples/oopnbody/nbody.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off - -java ^ - -Djava.library.path=..\..\com.syncleus.aparapi.jni\dist;..\third-party\jogamp ^ - -Dcom.syncleus.aparapi.executionMode=%1 ^ - -Dcom.syncleus.aparapi.enableProfiling=false ^ - -Dcom.syncleus.aparapi.enableShowGeneratedOpenCL=true ^ - -Dbodies=%2 ^ - -Dheight=600 ^ - -Dwidth=600 ^ - -classpath ..\third-party\jogamp\jogl-all.jar;..\third-party\jogamp\gluegen-rt.jar;..\..\com.syncleus.aparapi\dist\aparapi.jar;oopnbody.jar ^ - com.syncleus.aparapi.examples.oopnbody.Main - - diff --git a/examples/oopnbody/nbody.sh b/examples/oopnbody/nbody.sh deleted file mode 100755 index 7bb262be17213b5879f6a81a64ec1a1f12cbc8d9..0000000000000000000000000000000000000000 --- a/examples/oopnbody/nbody.sh +++ /dev/null @@ -1,12 +0,0 @@ - -java \ - -Djava.library.path=../../com.syncleus.aparapi.jni/dist:../third-party/jogamp \ - -Dcom.syncleus.aparapi.executionMode=$1 \ - -Dcom.syncleus.aparapi.logLevel=INFO \ - -Dcom.syncleus.aparapi.enableShowGeneratedOpenCL=true \ - -Dbodies=$2 \ - -Dheight=800 \ - -Dwidth=1200 \ - -classpath ../third-party/jogamp/jogl-all.jar:../third-party/jogamp/gluegen-rt.jar:../../com.syncleus.aparapi/dist/aparapi.jar:oopnbody.jar \ - com.syncleus.aparapi.examples.oopnbody.Main - diff --git a/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/duke.jpg b/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/duke.jpg deleted file mode 100644 index 2729fd2fc9cef1a95cb291aa633fb037fd6cf9ab..0000000000000000000000000000000000000000 Binary files a/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/duke.jpg and /dev/null differ diff --git a/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/moon.jpg b/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/moon.jpg deleted file mode 100644 index 40a6668a778f30a5898620873eb89ebbe9e8741e..0000000000000000000000000000000000000000 Binary files a/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/moon.jpg and /dev/null differ diff --git a/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/particle.jpg b/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/particle.jpg deleted file mode 100644 index 70e28ac5ea0a5ae58736f61f46ef5a326fbfbde0..0000000000000000000000000000000000000000 Binary files a/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/particle.jpg and /dev/null differ diff --git a/src/main/java/com/syncleus/aparapi/examples/All.java b/src/main/java/com/syncleus/aparapi/examples/All.java index 038dc2dbb8507fb593e41878619bb62e516fdc97..084a40fbc59b6fba961d03d969210fee71c15062 100644 --- a/src/main/java/com/syncleus/aparapi/examples/All.java +++ b/src/main/java/com/syncleus/aparapi/examples/All.java @@ -48,6 +48,7 @@ public class All { System.out.println(" 31) NBody"); System.out.println(" 32) NBody - Local"); System.out.println(" 33) NBody - Sequential"); + System.out.println(" 34) OOPN Body"); System.out.println(); Scanner in = new Scanner(System.in); @@ -177,6 +178,9 @@ public class All { case "33": com.syncleus.aparapi.examples.nbody.Seq.main(args); break; + case "34": + com.syncleus.aparapi.examples.oopnbody.Main.main(args); + break; default: System.out.println("Invalid selection."); } diff --git a/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/Body.java b/src/main/java/com/syncleus/aparapi/examples/oopnbody/Body.java similarity index 77% rename from examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/Body.java rename to src/main/java/com/syncleus/aparapi/examples/oopnbody/Body.java index 06f0f286a2a880ad498698a95c17426e3e1eb2a7..36bf2e3108d890f594b8a0343d8223c2e896e5d0 100644 --- a/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/Body.java +++ b/src/main/java/com/syncleus/aparapi/examples/oopnbody/Body.java @@ -1,3 +1,13 @@ +/** + * This product currently only contains code developed by authors + * of specific components, as identified by the source code files. + * + * Since product implements StAX API, it has dependencies to StAX API + * classes. + * + * For additional credits (generally to people who reported problems) + * see CREDITS file. + */ package com.syncleus.aparapi.examples.oopnbody; import java.util.List; diff --git a/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/Main.java b/src/main/java/com/syncleus/aparapi/examples/oopnbody/Main.java similarity index 92% rename from examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/Main.java rename to src/main/java/com/syncleus/aparapi/examples/oopnbody/Main.java index 1816549cfa57c80e9ea1ffec856dc2e9faa949a2..7c6b8d486194b04f3b0d089cf6617475aecdf920 100644 --- a/examples/oopnbody/src/com/amd/aparapi/examples/oopnbody/Main.java +++ b/src/main/java/com/syncleus/aparapi/examples/oopnbody/Main.java @@ -1,3 +1,13 @@ +/** + * This product currently only contains code developed by authors + * of specific components, as identified by the source code files. + * + * Since product implements StAX API, it has dependencies to StAX API + * classes. + * + * For additional credits (generally to people who reported problems) + * see CREDITS file. + */ /* Copyright (c) 2010-2011, Advanced Micro Devices, Inc. All rights reserved. @@ -48,16 +58,16 @@ import java.util.List; import java.util.ArrayList; import java.util.Arrays; -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLEventListener; -import javax.media.opengl.GLException; -import javax.media.opengl.GLProfile; -import javax.media.opengl.awt.GLCanvas; -import javax.media.opengl.fixedfunc.GLLightingFunc; -import javax.media.opengl.glu.GLU; +import com.jogamp.opengl.GL; +import com.jogamp.opengl.GL2; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLEventListener; +import com.jogamp.opengl.GLException; +import com.jogamp.opengl.GLProfile; +import com.jogamp.opengl.awt.GLCanvas; +import com.jogamp.opengl.fixedfunc.GLLightingFunc; +import com.jogamp.opengl.glu.GLU; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel;