Bit Tech reports Phil Pratt-Szeliga, an instructor at Syracuse University, has released the source code of Rootbeer - a compiler that enables Java programmers to take advantage of performance boosts delivered via GPGPU computing.
'When converting a serial program to a parallel program that can run on a graphics processing unit, the developer must choose what functions will run on the GPU' explains Pratt-Szeliga. 'For each function the developer chooses, he or she needs to manually write code to: serialise state to GPU memory; define the kernel code that the GPU will execute; control the kernel launch; and deserialise state back to CPU memory.'
Seeing that as far too many steps, Pratt-Szeliga developed Rootbeer, a compiler which allows programmers to access the power of the GPU directly within Java. 'Rootbeer [...] allows developers to simply write code in Java and the (de)serialisation, kernel code generation and kernel launch is done automatically,' Pratt-Szeliga explains. 'This is in contrast to Java language bindings for CUDA or OpenCL, where the developer still has to do these things manually.'
Rootbeer isn't suitable for every case, but it makes it a lot easier to tap into GPGPU computing directly within Java. Pratt-Szeliga and his team developed three performance examples to showcase Rootbeer's performance, the best-performing test case offers a 100x performance boost, but the worst example is 3x slower than its original version.