JavaCL uses JNA, JOCL uses JNI instead, so I expect JavaCL to show better cross-platform compatibility, while JOCL should generally turn out to have better performance. JOCL gets tested alongside JOGL2, which should make it easy to use GL objects in CL and vice versa. JavaCL is able to generate its context from the current GL context. JavaCL is protected by the GPL, JOCL is distributed under the BSD license.
What else can be said about these two approaches? Are there any good comparisons out there?
JavaCL: http://code.google.com/p/javacl/
JOCL: http://jogamp.org/jocl/www/
(Disclaimer: I'm the author of JavaCL and BridJ)
In addition to its JNA-based version, JavaCL has a fully-functional BridJ port that's entirely licensed under BSD (as BridJ is itself BSD-licensed).
FYI BridJ offers significantly lower per-call overhead than JNA, nearing JNI performance while still being very portable (it's currently released with 32 and 64 bits binaries for Windows, Linux and MacOS X, but other platforms are planned).
The performance of low-level bindings is not the only thing to consider, though. While the object-oriented APIs of JavaCL and JOCL look similar, you have to look after the extra goodies. I don't know about JOCL, but JavaCL ships with :
JavaCL is also used by ScalaCL (general-purpose OpenCL-backed collections + Scala compiler plugin to optimize code), which is a nice way of avoiding to write any kernel at all (albeit still in heavy development as of this writing).
Another thing to consider is the easy availability of binaries for standard platforms (Windows, Linux and MacOS X at least) and integration to build systems such as Maven. JavaCL used to be the best IMHO, but things might have changed (and for sure will change).
Finally, Marco Hutter's JOCL is another OpenCL binding, but with no high-level API. It might prove to be faster than OpenCL4Java (JavaCL) or JOCL for low-level calls, though.
EDIT: JavaCL is now covered by a chapter in Matthew Scarpino's OpenCL in Action book.
Raquel Medina Dominguez have written a paper for his "Ingeniería en Informática" degree titled "Evaluating different Java bindings for OpenCL". This paper compares JogAmp JOCL, JOCL and JavaCL. It scores the tree projects on performance, easy to use and memory consumption. The paper include set-up instructions that will help you getting started using any of the three Java OpenCL binding implementations.
http://e-archivo.uc3m.es/handle/10016/17183?locale=en - Evaluating different Java bindings for OpenCL PDF: http://e-archivo.uc3m.es/bitstream/10016/17183/5/finalversionPFC_Raquel_Medina.pdf Conclusions on page 40.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With