APARAPI is a comprehensive framework for execution OpenCL kernels from Java. APARAPI
has two major components: a Java bytecode to OpenCL translator and a runtime which
enables execution of OpenCL kernels and data transfers.

The APARAPI translator operates by inspecting the Java bytecode being executed at 
runtime and generating OpenCL kernels based on that inspection. Some of this inspection
involves in-depth source analysis of conditionals in order to uncover loops, if-else 
statements, and other high-level programming constructs that are obfuscated by bytecode.
Most bytecode statements are directly translatable to OpenCL statements.

The APARAPI runtime handles a number of concerns for the programmer, including
1) using JNI to interface JVM execution with the C/C++ OpenCL API, 2) transferring
data to and from the device while maintaining a mapping of Java arrays to OpenCL
buffers and determining data structures accessible from the kernel, 3) launching 
OpenCL kernels on OpenCL devices, and 4) querying OpenCL for
available devices and platforms in the current system. Its API is built to 
resemble the Java Runnable class, and requires implementation of a \textit{run()} 
method in \textit{com.amd.aparapi.Kernel}. This \textit{run()} method provides the 
translator with an entry point to the kernel to be translated. The APARAPI 
runtime uses the functionality listed previously
to execute the \textit{run()} method (and any methods it calls)
on an OpenCL device.

In this work, we use APARAPI's translator to 
translate the body of forall loops to OpenCL kernels. 
We prepared static version of APARAPI translator in order to avoid runtime transformation overheads.
We also generate our own JNI glue code between the HJ runtime and OpenCL kernels.
