concept JavaCL in category opencl

This is an excerpt from Manning's book OpenCL in Action: How to Accelerate Graphics and Computation.
At the start of chapter 8, I described all the advantages of coding host applications using the C++ Wrapper API: object-oriented programming, no need to call malloc, and the simplicity of the function calls. JavaCL provides these advantages as well, but in most cases, the JavaCL methods are even simpler to work with than the C++ functions.
JavaCL is a Java binding for OpenCL released by Olivier Chafik as part of the NativeLibs4Java toolset. JavaCL enables developers to build full-featured OpenCL host applications, and the only drawback I’ve encountered is that it currently doesn’t support OpenCL 1.1. This is probably because Mac OS doesn’t support OpenCL 1.1 yet.
In coding a JavaCL application, the first class you need to know is JavaCL. The static methods of this class construct and return other OpenCL-related objects. For example, its listPlatforms method returns an array of CLPlatform objects and serves the same purpose as the C function clGetPlatformIds.
In addition to getBestDevice, JavaCL also provides createBestContext, which returns a CLContext containing the device that, by default, has the most compute units. With this method, you can create a context with a single line of code, such as the following:
CLContext context = JavaCL.createBestContext();If you’d rather create contexts with multiple devices, you can call the createContext method provided by both the JavaCL class and the CLPlatform class. The full signature for this method is as follows: