Wiki

Clone wiki

AccelJava / Home

AccelJava

Accelerate your Java project with native sequential and parallel code, without any JNI. Linking to external system libraries and including files is easy.

@Include(libs={"m"}, headers={"math.h"})
public class Kernels extends AccelModule {
  public native int arraySum(final int[] array, final int n); /*-{
    int tmp = 0, i;
    for (i = 0; i < n; i++) {
      tmp += array[i];
    }
    return tmp;
  }-*/

  /** Call the sqrtf function from the linked math library */
  public native float sqrt(final float input); /*-{
    return sqrtf(input);
  }-*/

  public static void run() {
    int array[] = {1,2,3,4,5};
    new Kernels().arraySum(array, array.length);
    new Kernels().sqrt(25.0);
  }
}

Native Support

AccelJava supports multiple native languages and multiple compile targets:

SupportNative (Desktop)Android
CYesYes
Emulated CUDANot yetNot yet
CUDANot yetNot yet

Download

Stable

V1.0 RC2 - Download

Unstable

$ git clone https://bitbucket.org/wetherbeei/acceljava.git

Install/Run

$ cd acceljava
$ ant test
$ sudo ant install

See INSTALL.txt for full instructions and dependencies.

Documentation/Examples

Android Overview

Project Status

https://www.pivotaltracker.com/projects/537279/stories

Updated