Concepts Of Java APARAPI

Java APARAPI  is an API for expressing data parallel workloads  in Java and a run time component having the ability of converting the Java byte code of compatible workloads into Open CL  so that it can be made to run of executed on a different kind of GPU devices.

In short It is an APL for data parallel Java.  Allows suitable code to be executed on GPU through Open CL.

APARAPI  is a contraction of A PAR(allel). hence it is pronounced as { ap-per-rap-ee)

APARAPI has been tested with AMD’s Open CL enabled drivers and devices  as well as a limited set of NVidia devices and drivers on both Windows and Linux platforms.

For the appropriate workload this extends Java’s “Write Once Run Anywhere” to include GPU devices.

Data Types in APARAPI:

  • Primitive data types in Java like boolean, byte, short, int, long, and float and one-dimensional arrays are supported by APARAPI.
  • APARAPI support for the primitive data type double and that would be completely depend on your graphics card, driver, and OpenCL version.
  • The primitive data type char is not supported.

Arrays in APARAPI:

  •  aparapi support only one-dimensional arrays .
  • Aliasing of arrays cant be done either by passing arguments to the other methods or by direct local assignment.

Methods in APARAPI:

  • APARAPI does not support static methods.
  • Not only static methods it also does not support methods with varagrgs argument lists.

Few Constraints of APARAPI:

  • Throw, Catch or Finally such kind of excpections are not supported here.
  • Method or blocks which are synchronized are not supported.
  • Some of the simple loops and conditions are only supported by APARAPI.
  • Complex loops like switch, break, continue are not supported.
  • ArrayIndexOutOfBoundsException will not be generated by array accesses when you run on GPU.
  • ArithmeticExceptions will not be generated when you run on GPU.

Some of the pro’s and con’s of the concept of APARAPI are:

Pro’s:

  • Writing code of creating buffers are eliminated.
  •  Setting kernel arguments explicitly is not needed.
  • There is no need of querying for the platform and devices.
  • If GPU is not found still the Aparapi transforms the kernel code to use either JTP(Java Thread Pool) or CPU. Its not required to check explicitly if GPU is present or not and no need of explicitly creating threads to manage data parallelism.
  • APARAPI project is an open source.

Con’s:

  • APARAPI does not support the local memory.
  •  There is no gaurente that it would reach highly optimized open CLC wrapper performance for complex and difficult mathematical operations.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s