Multi-backend Java Object Oriented Facade API for OpenCL.
OpenCL libraries come and go in Java, some are great but then one day the lead developper goes on to greener pastures and you are left with code that needs to be rewritten to take advantage of a new up-to-date library with better support. Maybe a particular library has a bug or does not support the function you need? or it does not give you access to the underlying native pointers, making difficult to process large buffers/images or interoperate with hardware? or maybe it just does not support your exotic OS of choice. To protect your code from complete rewrites ClearCL offers a very clean and complete API to write your code against. Changing backend requires just changing one line of code.
ClearVolume 2.0 GPU code will be built on top of ClearCL to offer flexibility and robsutness against OpenCL library idiosyncrasies and eventual deprecation.
- Implemented backends: JOCL (www.jocl.org/) and JavaCL (github.com/nativelibs4java/JavaCL).
- Full support of OpenCL 1.2
- Support for offheap memory (> 2G) via CoreMem (http://github.com/ClearControl/CoreMem)
- Automatic backend selection (different backends works better on some platforms).
- Automatic device selection via kernel benchmarking.
- Supports OpenCL 1.0/1.1 devices by automatically using alternative functions.
- Full support for events
- Improve robustness: ClearCL is used the current ClearVolume ImageJ plugin.
- Basic set of OpenCL kernels for image processing: denoising, deconvolution, image quality, correlation, projection...
- Scatter-gather for processing images and buffers that don't fit in GPU mem.
- Upload-and-scaledown functionality to load and scale down images into GPU memory
- Live-coding infrastructire to be able to edit kernel code and immediately see the result.
- Integration with imglib2 and FiJi.
Find the latest version on BinTray
compile 'net.clearvolume:clearcl:0.3.36'
repositories {
maven {
url "http://dl.bintray.com/clearvolume/ClearVolume"
}
}
<dependency>
<groupId>net.clearvolume</groupId>
<artifactId>clearcl</artifactId>
<version>0.3.36</version>
<type>pom</type>
</dependency>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-clearvolume-ClearVolume</id>
<name>bintray</name>
<url>http://dl.bintray.com/clearvolume/ClearVolume</url>
</repository>
Just check the test (here)[https://github.com/ClearVolume/ClearCL/blob/master/src/java/clearcl/test/ClearCLTests.java] to learn how to use ClearCL. More tests are coming...
- Clone the project
- run the Gradle Wrapper that comes with the repo:
./gradlew cleanEclipse eclipse build
./gradlew idea build
Implementing backends simply consists in implementing classes against this interface.
OpenCL binding libraries such as (or wthin) JOCL, JavaCL, Jogamp, and LWJGL encapsulate native pointers/handles using specific classes. ClearCL backends further encapsulate these within ClearCLPeerPointers. This pointer wrapper class is not exposed by the Object Oriented API but instead is only used from within the backend implementations and within the OO classes.
- Loic Royer ( royer -at- mpi-cbg -point- de )
- you?