jocl.org
Java bindings for OpenCL
This site contains Java bindings for OpenCL, the
Open Computing
Language.
OpenCL allows writing programs for heterogeneous platforms that utilize CPUs or GPUs. More
information about OpenCL may be found at the
Khronos OpenCL website.
The following implementations of OpenCL are currently available:
General information about Java bindings for OpenCL
There are several libraries providing Java bindings for OpenCL. Here is
an overview of some of these libraries:
-
The JOCL that is available here
This library offers Java-Bindings for OpenCL that are very similar to
the original OpenCL API. The functions are provided as static methods,
and semantics and signatures of these methods have been kept consistent
with the original library functions, except for the language-specific
limitations of Java. The OpenCL API may be very verbose at some points,
and this is not hidden or simplified, but simply offered by JOCL as-it-is.
-
The goal of this library is to provide an object-oriented abstraction
of OpenCL for Java. This simplifies the usage and may be found more natural and
convenient for most Java Programmers. The library also offers a low-level
interface, which is generated using the GlueGen library. This interface
is similar to the OpenCL API, but not really intended to be used by clients,
and mainly serves as the basis for the object-oriented wrapper.
-
This library also offers an object-oriented abstraction of OpenCL for Java.
It has a low-level interface which is based on JNA and generated using
the JNAerator library. The low-level interface serves as the basis for
the object-oriented wrapper but is not intended to be used by clients.
Note that JavaCL is part of the
NativeLibs4Java project, which also contains
ScalaCL,
a library for accessing OpenCL with Scala.
-
OpenCL support in LWJGL
The Lightweight Java Game Library (LWJGL) has been extended
to also support OpenCL. The original OpenCL API is mapped to
a similar Java API, and extended with convenience methods.
As an alternative for Java developers who want to benefit from the computing
power of their GPU without having to learn OpenCL, there is a library called
Aparapi:
It allows a seamless integration of GPU workloads into Java Code. The Java bytecode
will be converted into OpenCL code and executed on the GPU, transparently for the user.
Even if there is no OpenCL implementation, the same code will still run on the
CPU in a Java Thread Pool, taking advantage of multiple CPU cores.
Source code repository
The source code of JOCL is available at GitHub:
https://github.com/gpu/JOCL
Maven dependency
JOCL is available in Maven Central, under the following coordinates:
<dependency>
<groupId>org.jocl</groupId>
<artifactId>jocl</artifactId>
<version>2.0.0</version>
</dependency>
JOCLBlast is available in Maven Central, under the following coordinates:
<dependency>
<groupId>org.jocl</groupId>
<artifactId>jocl-blast</artifactId>
<version>1.2.0</version>
</dependency>
Further information is available in the
Downloads section.
News
2017-11-15: Release of JOCLBlast 1.2.0
-
JOCLBlast 1.2.0 has been released, and is available in Maven Central
2017-10-25: Release of JOCLBlast 1.1.0
-
JOCLBlast 1.1.0 has been released, and is available in Maven Central
2017-09-06: Release of JOCLBlast 1.0.1
-
JOCLBlast 1.0.1 has been released, and is available in Maven Central
2017-05-25: Release of JOCLBlast
-
JOCLBlast 0.11.0 has been released, and is available in Maven Central
2016-10-04: Release of JOCLBlast
-
JOCLBlast 0.9.0 has been released, and is available in Maven Central
2016-07-06: Release of JOCLBlast
-
JOCLBlast 0.8.0 has been released, and is available in Maven Central
2016-05-23: Release of JOCLBlast
-
JOCLBlast 0.7.1 has been released, and is available in Maven Central
2016-05-12: Release of JOCL and JOCLBlast
-
JOCL 2.0.0 has been released, and is available in Maven Central
-
JOCLBlast 0.7.0 has been released, and is available in Maven Central
2016-04-08: JOCL-based bindings for BLAS libraries
2015-02-04: Update to version 0.2.0-RC (Release Candidate)
-
The release candidate of JOCL with support for OpenCL 2.0 is
available in the downloads
section. Currently, it is supplied with Windows 64bit binaries.
When the binaries for the other operating systems are available,
the new version will be added to the central Maven repository.
2014-10-22: Scala samples uploaded
-
Piotr Tarsa has ported some of the JOCL samples to Scala.
They can be found on the Samples page.
2013-04-05: Update to version 0.1.9
-
The latest version of JOCL, with support for OpenCL 1.2 is now
available in the downloads
section and in the central Maven repository:
<dependency>
<groupId>org.jocl</groupId>
<artifactId>jocl</artifactId>
<version>0.1.9</version>
</dependency>
2012-08-22: Version 0.1.8 (Release Candidate)
- Update for OpenCL 1.2 support
- This version should be considered as a release candidate.
JOCL has undergone an internal refactoring to allow different
versions for the underlying OpenCL implementation
Additionally, the binaries for Linux 64bit are still missing.
Once they are available, the final version will be uploaded
and made available in the Maven repository.
2012-07-16: OpenCL cloth simulation demo updated
- The JOCL Cloth simulation demo has been
updated. A bug in the simple renderer library has been fixed, which
caused a rendering failure with newer NVIDIA drivers. Additionally,
a new method for subdividing the edge set for the Java based
simulation method has been implemented.
2012-05-07: OpenCL cloth simulation demo updated
- The JOCL Cloth simulation demo has been
updated. It now allows selecting the OpenCL platform and device for
the execution. Additionally, it uses some utility classes for JOCL
that are currently developed. Once the API of these classes is more
stable, they will be available as a separate library.
2011-10-19: OpenCL cloth simulation demo uploaded
2011-08-23: Version 0.1.7
- CLException now provides the CL status code that caused the exception
- Vendor-independent constants from the CL extensions have been added
-
The native libraries now contain a version number in their name, and
the behavior of the native library loading utility class has changed.
See the change log for details.
2011-08-23: Samples updated
-
Most of the samples have been updated to use an initialization
scheme that better supports multiple OpenCL platforms.
Additionally, the OpenGL-related samples have been updated
to properly work with the newest OpenGL versions, which require
a vertex array object to be created whenever a vertex buffer
object is used.
2011-03-30: Version 0.1.6
-
The latest version of JOCL contains only a bugfix for MacOS:
The MacOS library could not be loaded from the JAR
file due to a wrong assumption about the library
extension.
2011-03-28: Version 0.1.5 available in the Maven repository
-
The latest version of JOCL, including binaries for 32/64bit
Windows, 32/64 bit Linux and 64bit MacOS, is now available
in the central Maven repository:
<dependency>
<groupId>org.jocl</groupId>
<artifactId>jocl</artifactId>
<version>0.1.5</version>
</dependency>
Thanks to Kashif Rasul for providing the 64 bit Linux and MacOS binaries.
2011-03-14: Update to version 0.1.5 - fixed memory leak
-
The downloads section
contains an updated archive with JOCL version 0.1.5, including
an important fix of a memory leak for clEnqueue* operations.
The archive currently contains the Windows 32 and 64 bit binaries.
Other binaries will follow soon.
2011-02-14: Linux 32bit library added
-
The binary distribution archive which is available in the
downloads section
now also contains Linux 32bit libraries.
2011-02-01: JOCL is now available via the Central Maven Repository
-
Maven users can now add a dependency to JOCL inside their POM:
<dependency>
<groupId>org.jocl</groupId>
<artifactId>jocl</artifactId>
<version>0.1.4d</version>
</dependency>
-
The mechanism for loading the native library has been extended
so that it may load the library directly from the JAR. The
current version contains the native libraries for
32 and 64 bit Windows, 64 bit Linux and 64 bit MacOS.
Additional native libraries may be placed in the
java.library.path and will then be loaded from
the local file system.
(
Change log)