JCudaMP: OpenMP/Java on CUDA

  • Authors:
  • Georg Dotzler;Ronald Veldema;Michael Klemm

  • Affiliations:
  • University of Erlangen-Nuremberg, Martensstr, Erlangen, Germany;University of Erlangen-Nuremberg, Martensstr, Erlangen, Germany;University of Erlangen-Nuremberg, Martensstr, Erlangen, Germany

  • Venue:
  • Proceedings of the 3rd International Workshop on Multicore Software Engineering
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present an OpenMP framework for Java that can exploit an available graphics card as an application accelerator. Dynamic languages (Java, C#, etc.) pose a challenge here because of their write-once-run-everywhere approach. This renders it impossible to make compile-time assumptions on whether and which type of accelerator or graphics card might be available in the system at run-time. We present an execution model that dynamically analyzes the running environment to find out what hardware is attached. Based on the results it dynamically rewrites the bytecode and generates the necessary gpGPU code on-the-fly. Furthermore, we solve two extra problems caused by the combination of Java and CUDA. First, CUDA-capable hardware usually has little memory (compared to main memory). However, as Java is a pointer-free language, array data can be stored in main memory and buffered in GPU memory. Second, CUDA requires one to copy data to and from the graphics card's memory explicitly. As modern languages use many small objects, this would involve many copy operations when done naively. This is exacerbated because Java uses arrays-of-arrays to implement multi-dimensional arrays. A clever copying technique and two new array packages allow for more efficient use of CUDA.