Wiki
Clone wikiAccelJava / 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:
Support | Native (Desktop) | Android |
---|---|---|
C | Yes | Yes |
Emulated CUDA | Not yet | Not yet |
CUDA | Not yet | Not 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
Project Status
Updated