From 85ce2dbfb86e9c9d4882c676e5c7457e7367c2e9 Mon Sep 17 00:00:00 2001
From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com>
Date: Mon, 17 Oct 2016 13:53:56 -0400
Subject: [PATCH] Moved mandle sample tot he active part of the project.

---
 pom.xml                                       |  2 +-
 samples/mandel/.gitignore                     |  1 -
 samples/mandel/.project                       | 17 ----
 samples/mandel/build.xml                      | 85 -------------------
 samples/mandel/mandel-agent.bat               | 16 ----
 samples/mandel/mandel-agent.sh                |  7 --
 samples/mandel/mandel.bat                     | 14 ---
 samples/mandel/mandel.sh                      |  5 --
 samples/mandel/mandel2D.bat                   |  9 --
 samples/mandel/mandel2D.sh                    |  5 --
 .../com/syncleus/aparapi/examples/All.java    |  8 ++
 .../aparapi/examples}/mandel/Main.java        | 12 ++-
 .../aparapi/examples}/mandel/Main2D.java      | 12 ++-
 13 files changed, 31 insertions(+), 162 deletions(-)
 delete mode 100644 samples/mandel/.gitignore
 delete mode 100644 samples/mandel/.project
 delete mode 100644 samples/mandel/build.xml
 delete mode 100644 samples/mandel/mandel-agent.bat
 delete mode 100644 samples/mandel/mandel-agent.sh
 delete mode 100644 samples/mandel/mandel.bat
 delete mode 100644 samples/mandel/mandel.sh
 delete mode 100644 samples/mandel/mandel2D.bat
 delete mode 100644 samples/mandel/mandel2D.sh
 rename {samples/mandel/src/com/amd/aparapi/sample => src/main/java/com/syncleus/aparapi/examples}/mandel/Main.java (94%)
 rename {samples/mandel/src/com/amd/aparapi/sample => src/main/java/com/syncleus/aparapi/examples}/mandel/Main2D.java (94%)

diff --git a/pom.xml b/pom.xml
index c7741f76..7bb0d648 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,7 +86,7 @@
     </dependencies>
 
     <build>
-        <defaultGoal>exec:java</defaultGoal>
+        <defaultGoal>clean package exec:java</defaultGoal>
         <plugins>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
diff --git a/samples/mandel/.gitignore b/samples/mandel/.gitignore
deleted file mode 100644
index 840e7d31..00000000
--- a/samples/mandel/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/classes/
diff --git a/samples/mandel/.project b/samples/mandel/.project
deleted file mode 100644
index 6be9bbf8..00000000
--- a/samples/mandel/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>mandel</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/samples/mandel/build.xml b/samples/mandel/build.xml
deleted file mode 100644
index f0aaa763..00000000
--- a/samples/mandel/build.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="mandel" default="build" basedir=".">
-
-	<!-- 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">
-		<pathelement path="../../com.syncleus.aparapi/dist/aparapi.jar" />
-	</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>
-				<pathelement path="../../com.syncleus.aparapi/dist/aparapi.jar" />
-			</classpath>
-		</javac>
-		<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-mandel-gpu">
-		<java classname="com.syncleus.aparapi.sample.mandel.Main" fork="true">
-			<classpath refid="runtime.class.path" />
-			<sysproperty key="java.library.path" path="..\..\com.syncleus.aparapi.jni\dist" />
-			<sysproperty key="com.syncleus.aparapi.executionMode" value="GPU" />
-		</java>
-	</target>
-
-	<target name="run-mandel-jtp">
-		<java classname="com.syncleus.aparapi.sample.mandel.Main" fork="true">
-			<classpath refid="runtime.class.path" />
-			<sysproperty key="java.library.path" path="..\..\com.syncleus.aparapi.jni\dist" />
-			<sysproperty key="com.syncleus.aparapi.executionMode" value="JTP" />
-		</java>
-	</target>
-
-	<target name="run-mandel2d-gpu">
-		<java classname="com.syncleus.aparapi.sample.mandel.Main2D" fork="true">
-			<classpath refid="runtime.class.path" />
-			<sysproperty key="java.library.path" path="..\..\com.syncleus.aparapi.jni\dist" />
-			<sysproperty key="com.syncleus.aparapi.executionMode" value="GPU" />
-		</java>
-	</target>
-
-	<target name="run-mandel2d-jtp">
-		<java classname="com.syncleus.aparapi.sample.mandel.Main2D" fork="true">
-			<classpath refid="runtime.class.path" />
-			<sysproperty key="java.library.path" path="..\..\com.syncleus.aparapi.jni\dist" />
-			<sysproperty key="com.syncleus.aparapi.executionMode" value="JTP" />
-		</java>
-	</target>
-
-	<target name="run-agent-gpu">
-		<java classname="com.syncleus.aparapi.sample.mandel.Main" fork="true">
-			<classpath refid="runtime.class.path" />
-			<sysproperty key="java.library.path" path="..\..\com.syncleus.aparapi.jni\dist" />
-			<sysproperty key="com.syncleus.aparapi.executionMode" value="GPU" />
-			<sysproperty key="com.syncleus.aparapi.useAgent" value="true" />
-		</java>
-	</target>
-
-	<target name="run-agent-jtp">
-		<java classname="com.syncleus.aparapi.sample.mandel.Main" fork="true">
-			<classpath refid="runtime.class.path" />
-			<sysproperty key="java.library.path" path="..\..\com.syncleus.aparapi.jni\dist" />
-			<sysproperty key="com.syncleus.aparapi.executionMode" value="JTP" />
-			<sysproperty key="com.syncleus.aparapi.useAgent" value="true" />
-		</java>
-	</target>
-
-</project>
diff --git a/samples/mandel/mandel-agent.bat b/samples/mandel/mandel-agent.bat
deleted file mode 100644
index 3035db89..00000000
--- a/samples/mandel/mandel-agent.bat
+++ /dev/null
@@ -1,16 +0,0 @@
-java ^
- -agentpath:../../com.syncleus.aparapi.jni/dist/aparapi_x86_64.dll ^
- -Djava.library.path=../../com.syncleus.aparapi.jni/dist ^
- -Dcom.syncleus.aparapi.useAgent=true ^
- -Dcom.syncleus.aparapi.executionMode=%1 ^
- -Dcom.syncleus.aparapi.logLevel=OFF^
- -Dcom.syncleus.aparapi.enableVerboseJNI=false ^
- -Dcom.syncleus.aparapi.enableProfiling=false ^
- -Dcom.syncleus.aparapi.enableShowGeneratedOpenCL=true ^
- -Dcom.syncleus.aparapi.enableVerboseJNIOpenCLResourceTracking=false ^
- -Dcom.syncleus.aparapi.dumpFlags=true ^
- -Dcom.syncleus.aparapi.enableInstructionDecodeViewer=false ^
- -classpath ../../com.syncleus.aparapi/dist/aparapi.jar;mandel.jar ^
- com.syncleus.aparapi.sample.mandel.Main
-
-
diff --git a/samples/mandel/mandel-agent.sh b/samples/mandel/mandel-agent.sh
deleted file mode 100644
index e1e1de7b..00000000
--- a/samples/mandel/mandel-agent.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-java\
- -agentpath:../../com.syncleus.aparapi.jni/dist/libaparapi_x86_64.so\
- -Djava.library.path=../../com.syncleus.aparapi.jni/dist\
- -Dcom.syncleus.aparapi.useAgent=true\
- -Dcom.syncleus.aparapi.executionMode=$1\
- -classpath ../../com.syncleus.aparapi/dist/aparapi.jar:mandel.jar\
- com.syncleus.aparapi.sample.mandel.Main
diff --git a/samples/mandel/mandel.bat b/samples/mandel/mandel.bat
deleted file mode 100644
index 99a13326..00000000
--- a/samples/mandel/mandel.bat
+++ /dev/null
@@ -1,14 +0,0 @@
-java ^
- -Djava.library.path=../../com.syncleus.aparapi.jni/dist ^
- -Dcom.syncleus.aparapi.executionMode=%1 ^
- -Dcom.syncleus.aparapi.logLevel=OFF^
- -Dcom.syncleus.aparapi.enableVerboseJNI=false ^
- -Dcom.syncleus.aparapi.enableProfiling=false ^
- -Dcom.syncleus.aparapi.enableShowGeneratedOpenCL=true ^
- -Dcom.syncleus.aparapi.enableVerboseJNIOpenCLResourceTracking=false ^
- -Dcom.syncleus.aparapi.dumpFlags=true ^
- -Dcom.syncleus.aparapi.enableInstructionDecodeViewer=false ^
- -classpath ../../com.syncleus.aparapi/dist/aparapi.jar;mandel.jar ^
- com.syncleus.aparapi.sample.mandel.Main
-
-
diff --git a/samples/mandel/mandel.sh b/samples/mandel/mandel.sh
deleted file mode 100644
index 80eb4fbd..00000000
--- a/samples/mandel/mandel.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-java\
- -Djava.library.path=../../com.syncleus.aparapi.jni/dist\
- -Dcom.syncleus.aparapi.executionMode=$1\
- -classpath ../../com.syncleus.aparapi/dist/aparapi.jar:mandel.jar\
- com.syncleus.aparapi.sample.mandel.Main
diff --git a/samples/mandel/mandel2D.bat b/samples/mandel/mandel2D.bat
deleted file mode 100644
index 671efc13..00000000
--- a/samples/mandel/mandel2D.bat
+++ /dev/null
@@ -1,9 +0,0 @@
-java ^
- -Djava.library.path=../../com.syncleus.aparapi.jni/dist ^
- -Dcom.syncleus.aparapi.executionMode=%1 ^
- -Dcom.syncleus.aparapi.enableProfiling=false ^
- -Dcom.syncleus.aparapi.enableShowGeneratedOpenCL=true ^
- -classpath ../../com.syncleus.aparapi/dist/aparapi.jar;mandel.jar ^
- com.syncleus.aparapi.sample.mandel.Main2D
-
-
diff --git a/samples/mandel/mandel2D.sh b/samples/mandel/mandel2D.sh
deleted file mode 100644
index 0f6cd851..00000000
--- a/samples/mandel/mandel2D.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-java\
- -Djava.library.path=../../com.syncleus.aparapi.jni/dist\
- -Dcom.syncleus.aparapi.executionMode=$1\
- -classpath ../../com.syncleus.aparapi/dist/aparapi.jar:mandel.jar\
- com.syncleus.aparapi.sample.mandel.Main2D
diff --git a/src/main/java/com/syncleus/aparapi/examples/All.java b/src/main/java/com/syncleus/aparapi/examples/All.java
index 64f19103..4628fa2c 100644
--- a/src/main/java/com/syncleus/aparapi/examples/All.java
+++ b/src/main/java/com/syncleus/aparapi/examples/All.java
@@ -16,6 +16,8 @@ public class All {
     public static void main(String[] _args) {
         System.out.println("Select which example to run:");
         System.out.println("  1) Game of Life");
+        System.out.println("  2) Mandelbrot");
+        System.out.println("  3) Mandlebrot 2D");
         System.out.println();
 
         Scanner in = new Scanner(System.in);
@@ -49,6 +51,12 @@ public class All {
             case "1":
                 com.syncleus.aparapi.examples.life.Main.main(null);
                 break;
+            case "2":
+                com.syncleus.aparapi.examples.mandel.Main.main(null);
+                break;
+            case "3":
+                com.syncleus.aparapi.examples.mandel.Main2D.main(null);
+                break;
             default:
                 System.out.println("Invalid selection.");
         }
diff --git a/samples/mandel/src/com/amd/aparapi/sample/mandel/Main.java b/src/main/java/com/syncleus/aparapi/examples/mandel/Main.java
similarity index 94%
rename from samples/mandel/src/com/amd/aparapi/sample/mandel/Main.java
rename to src/main/java/com/syncleus/aparapi/examples/mandel/Main.java
index 31ac28b0..c70ca65d 100644
--- a/samples/mandel/src/com/amd/aparapi/sample/mandel/Main.java
+++ b/src/main/java/com/syncleus/aparapi/examples/mandel/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.
@@ -36,7 +46,7 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 
 */
 
-package com.syncleus.aparapi.sample.mandel;
+package com.syncleus.aparapi.examples.mandel;
 
 import com.syncleus.aparapi.Kernel;
 import com.syncleus.aparapi.*;
diff --git a/samples/mandel/src/com/amd/aparapi/sample/mandel/Main2D.java b/src/main/java/com/syncleus/aparapi/examples/mandel/Main2D.java
similarity index 94%
rename from samples/mandel/src/com/amd/aparapi/sample/mandel/Main2D.java
rename to src/main/java/com/syncleus/aparapi/examples/mandel/Main2D.java
index c5e4c316..46114eb4 100644
--- a/samples/mandel/src/com/amd/aparapi/sample/mandel/Main2D.java
+++ b/src/main/java/com/syncleus/aparapi/examples/mandel/Main2D.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.
@@ -36,7 +46,7 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 
 */
 
-package com.syncleus.aparapi.sample.mandel;
+package com.syncleus.aparapi.examples.mandel;
 
 import com.syncleus.aparapi.Kernel;
 import com.syncleus.aparapi.*;
-- 
GitLab