This repository contains the files required to use ArrayFire from Java.
-
The latest version of ArrayFire. You can get ArrayFire using one of the following:
-
The latest version of
JAVA SDK
. It has been tested with OpenJDK 1.7 and OpenJDK 1.8. Make sure there is an environmental variableJAVA_HOME
pointing to the root directory of java sdk installation. -
CUDA
- Tested for CUDA 7.5
-
make
GNU Make
on Linux
-
C++ compiler
gcc
orclang
on Linux
-
OSX and Windows support coming soon
-
src/
: Contains the source files for the ArrayFire Java wrapper*.cpp
The JNI wrapper filesjni_helper.h
The JNI API helper functions
-
com/
: Contains the Java source files implementing algorithms -
lib/
: The location where the JNI library is stored -
examples
: contains a few examples demonstrating the usage
After you the necessary pre-requisites, edit the following paramets
- Open
Makefile
and changeJAVA_HOME
together withAF_PATH
to the right location
-
To build the JNI Wrapper for ArrayFire use
make cuda
to build using CUDA- alternatively, you can pass in environment variables to the
Makefile
like this:JAVA_HOME=<path to the Java SDK> AF_PATH=<path to ArrayFire> make cuda
- alternatively, you can pass in environment variables to the
make opencl
to build using OpenCL- alternatively, you can pass in environment variables to the
Makefile
like this:JAVA_HOME=<path to the Java SDK> AF_PATH=<path to ArrayFire> make cuda
- alternatively, you can pass in environment variables to the
-
To build the examples do one of the following from the examples directory
make cuda run
to use build and run examples using CUDA- alternatively, you can pass in environment variables to the
Makefile
like this:JAVA_HOME=<path to the Java SDK> AF_PATH=<path to ArrayFire> make cuda
- alternatively, you can pass in environment variables to the
make opencl run
to use build and run examples using OpenCL- alternatively, you can pass in environment variables to the
Makefile
like this:JAVA_HOME=<path to the Java SDK> AF_PATH=<path to ArrayFire> make cuda
- alternatively, you can pass in environment variables to the
- TODO
- Please check the LICENSE file in the root directory