From 68daebffe6dadf9da2981ff4ccc019625991b3de Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Date: Thu, 1 Dec 2016 23:14:20 -0500 Subject: [PATCH] Added getting started page. --- source/index.html.haml | 12 ++-- source/introduction/about.html.md | 37 ----------- source/introduction/getting-started.html.md | 73 ++++++++++++++++++++- 3 files changed, 78 insertions(+), 44 deletions(-) diff --git a/source/index.html.haml b/source/index.html.haml index f5cbc02..57c956a 100644 --- a/source/index.html.haml +++ b/source/index.html.haml @@ -45,9 +45,9 @@ description: Open-source framework for executing native Java code on the GPU. %i.material-icons settings %p.promo-caption Flexible %p.light.center The full power and flexibility of OpenCL coding is fully exposed. All the low level calls as well as the ability to manipulate or post kernel files are still accessible to developers. -.divider -.section - .row.center - %h3.light.header Aparapi Showcase - %p.col.s8.offset-s2.caption Checkout what people are creating with Aparapi. Get inspired by these projects and you can even submit your own projects to be showcased here. - %a.btn-large.waves-effect.waves-light{:href => "http://aparapi.com"} Explore our Showcase \ No newline at end of file +-#.divider +-#.section +-# .row.center +-# %h3.light.header Aparapi Showcase +-# %p.col.s8.offset-s2.caption Checkout what people are creating with Aparapi. Get inspired by these projects and you can even submit your own projects to be showcased here. +-# %a.btn-large.waves-effect.waves-light{:href => "http://aparapi.com"} Explore our Showcase \ No newline at end of file diff --git a/source/introduction/about.html.md b/source/introduction/about.html.md index 6f10c03..a084a27 100644 --- a/source/introduction/about.html.md +++ b/source/introduction/about.html.md @@ -1,43 +1,6 @@ --- title: About --- -# What is Aparapi? - -Aparapi allows Java developers to take advantage of the compute power of GPU and APU devices by executing data parallel code fragments on the GPU rather than being confined to the local CPU. It does this by converting Java bytecode to OpenCL at runtime and executing on the GPU, if for any reason Aparapi can't execute on the GPU it will execute in a Java thread pool. - -We like to think that for the appropriate workload this extends Java's 'Write Once Run Anywhere' to include GPU devices. - -With Aparapi we can take a sequential loop such as this (which adds each element from inA and inB arrays and puts the result in result). - -```java - -final float inA[] = .... // get a float array of data from somewhere -final float inB[] = .... // get a float array of data from somewhere -assert (inA.length == inB.length); -final float result = new float[inA.length]; - -for (int i = 0; i < array.length; i++) { - result[i] = intA[i] + inB[i]; -} -``` - -And refactor the sequential loop to the following form: - -```java - -Kernel kernel = new Kernel() { - @Override - public void run() { - int i = getGlobalId(); - result[i] = intA[i] + inB[i]; - } -}; - -Range range = Range.create(result.length); -kernel.execute(range); -``` - -In the above code we extend com.syncleus.aparapi.Kernel base class and override the Kernel.run() method to express our data parallel algorithm. We initiate the execution of the Kernel(over a specific range 0..results.length) using Kernel.execute(range). # About the Name diff --git a/source/introduction/getting-started.html.md b/source/introduction/getting-started.html.md index ed458db..4334cb3 100644 --- a/source/introduction/getting-started.html.md +++ b/source/introduction/getting-started.html.md @@ -1,4 +1,75 @@ --- title: Getting Started --- -**Hello World!** +A framework for executing native Java code on the GPU. + +**Licensed under the Apache Software License v2** + +Aparapi allows developers to write native Javacode capable of being executed directly on a graphics card GPU by converting Java byte code to an OpenCL kernel dynamically at runtime. Because it is backed by OpenCL Aparapi is compatible with all OpenCL compatible Graphics Cards. + +A GPU has a unique architecture that causes them to behave differently than a CPU. One of the most noticeable differences is that while a typical CPU has less than a dozen cores a high end GPU may have hundreds of cores. This makes them uniquely suited for data-parallel computation that can result in speedups hundreds of times more than what is capable with your average CPU. This can mean the difference between needing a whole data center to house your application versus just one or two computers, potentially saving millions in server costs. + +Aparapi was originally a project conceived and developed by AMD corporation. It was later abandoned by AMD and sat mostly-idle for several years. Despite this there were some failed efforts by the community to keep the project alive, but without a clear community leader no new releases ever came. Eventually we came along and rescued the project, and modernized the project. Finally after such a long wait the first Aparapi release in 5 years was published and the community continues to push forward with renewed excitement. + +For detailed documentation see [Aparapi.com](http://Aparapi.com) or check out the [latest Javadocs](http://www.javadoc.io/doc/com.syncleus.ferma/ferma). + +For support please use [Gitter](https://gitter.im/Syncleus/aparapi) or the [official Aparapi mailing list](https://groups.google.com/a/syncleus.com/d/forum/aparapi-list). + +Please file bugs and feature requests on [Github](https://github.com/Syncleus/aparapi/issues). + +## Dependency + +To include Aparapi in your project of choice include the following Maven dependency into your build. + +```xml + +<dependency> + <groupId>com.syncleus.aparapi</groupId> + <artifactId>aparapi</artifactId> + <version>1.0.0</version> +</dependency> +``` + +## Obtaining the Source + +The official source repository for Aparapi is located in the Syncleus Github repository and can be cloned using the +following command. + +```bash + +git clone https://github.com/Syncleus/aparapi.git +``` + +## Getting Started + +With Aparapi we can take a sequential loop such as this (which adds each element from inA and inB arrays and puts the result in result). + +```java + +final float inA[] = .... // get a float array of data from somewhere +final float inB[] = .... // get a float array of data from somewhere +assert (inA.length == inB.length); +final float result = new float[inA.length]; + +for (int i = 0; i < array.length; i++) { + result[i] = intA[i] + inB[i]; +} +``` + +And refactor the sequential loop to the following form: + +```java + +Kernel kernel = new Kernel() { + @Override + public void run() { + int i = getGlobalId(); + result[i] = intA[i] + inB[i]; + } +}; + +Range range = Range.create(result.length); +kernel.execute(range); +``` + +In the above code we extend com.syncleus.aparapi.Kernel base class and override the Kernel.run() method to express our data parallel algorithm. We initiate the execution of the Kernel(over a specific range 0..results.length) using Kernel.execute(range). -- GitLab