This repository contains the files required to use ArrayFire from Java.
-
The latest version of ArrayFire. You can download here
- All the pre-requisites for ArrayFire still apply.
-
The latest version of
JAVA SDK
. Make sure there is an environmental variableJAVA_HOME
pointing to the root directory of java sdk installation. -
make
GNU Make
onLinux
nmake
onWindows
-
C++ compiler
gcc/g++
on LinuxVisual Studio 2012
forWindows
.
-
OSX support coming soon.
-
src/
: Contains the source files for the ArrayFire Java wrapperjava_wrapper.cpp
The JNI wrapper filejava_wrapper.h
The JNI API definitions
-
com/
: Contains the Java source files implementingArray
andImage
classes -
lib/
,lib64/
: 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 changeAF_PATH
to the right location
-
To build the JNI Wrapper for ArrayFire use
make cuda
to build using CUDAmake opencl
to build using OpenCL
-
To build the examples do one of the following from the examples directory
make cuda run
to use build and run examples using CUDAmake opencl run
to use build and run examples using OpenCL
-
To build the JNI Wrapper for ArrayFire
- Verify if the following macros are correctly defined in the file
Makefile.Windows
.- Ensure that
VC_ROOT
points to Visual-C (VC) installation path. - Ensure that
WINSDK_X64
points to Windows SDK X64 library path.
- Ensure that
- Launch
Developer command prompt for Visual Studio 2012
. cd <Repository root>
.nmake /F Makefile.Windows af_java
to build wrapper dll using CUDA.- OpenCL support coming soon.
- Verify if the following macros are correctly defined in the file
-
To build and run the examples
nmake /F Makefile.Windows examples
to build all examples.nmake /F Makefile.Windows
to build and run all examples.
- TODO
- Please check the LICENSE file in the root directory