diff --git a/pom.xml b/pom.xml index 0704589de76da5b46ccaf93ca162c1a72532c2da..47abf25043b40560c2c32ba535d166cbf0c20a1c 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ </snapshots> </repository> </repositories> - + <dependencies> <dependency> <groupId>com.syncleus.aparapi</groupId> @@ -88,6 +88,16 @@ <build> <defaultGoal>package</defaultGoal> <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <configuration> + <mainClass>com.syncleus.aparapi.examples.All</mainClass> + <arguments> + <argument>com.syncleus.aparapi.executionMode=GPU</argument> + </arguments> + </configuration> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> diff --git a/src/main/java/com/syncleus/aparapi/examples/All.java b/src/main/java/com/syncleus/aparapi/examples/All.java new file mode 100644 index 0000000000000000000000000000000000000000..64f19103899fa30a21ddc6a160c913a76767f9fc --- /dev/null +++ b/src/main/java/com/syncleus/aparapi/examples/All.java @@ -0,0 +1,57 @@ +/** + * 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; + +import java.util.Scanner; + +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(); + + Scanner in = new Scanner(System.in); + boolean running = true; + while(running) + { + System.out.print("Enter your selection, or q/Q to quit: "); + if( in.hasNextLine() ) + { + String line = in.nextLine(); + running = selected(line); + System.out.println(); + } + else + try { + Thread.sleep(100); + } + catch(InterruptedException ex) { + return; + } + } + } + + private static boolean selected(String line) + { + if( line.toUpperCase().equals("Q") ) + return false; + + switch(line) + { + case "1": + com.syncleus.aparapi.examples.life.Main.main(null); + break; + default: + System.out.println("Invalid selection."); + } + return true; + } +}