The source code of the
Rootbeer compiler is laid out on Github, with which you can run almost any Java code on a GPU, and also easily split a Java program into fragments for a CPU / GPU.
The compiler is published under the MIT license, it has been thoroughly tested and is quite suitable for use. According to the author, this is the most advanced Java bytecode translator to the CUDA platform. Apparently, OpenCL is
also supported .
The author of the program is Phil Pratt-Szeliga, a teacher at the University of Syracuse.
It is necessary to clarify that there is no magic in the GPU, and some programs on the GPU run much slower than on the CPU. Another thing, if the program is able to run a large number of parallel threads. To do this, you need to write a special algorithm with optimization for mass parallelism.
')
If there is concurrency in a Java program, Rootbeer will detect it automatically. In this case, on specific tasks, the performance increase can be dozens of times. For example, during
testing, the multiplication of dense 4096x4096 matrices in Java with Rootbeer accelerated 67 times, the Fourier transform (not FFT) - 54 times.
Rootbeer uses a tool for static analysis and conversion of Java
Soot bytecode.
The list of
non- supported Java functions in the compiler: garbage collector, native methods, reflections (reflection), dynamic method invocation.