jcuda.org
Java bindings for CUDA
This site contains Java bindings for
NVIDIA® CUDA™
and related libraries.
To use these libraries, you need a CUDA-enabled GPU device and the
NVIDIA
driver with CUDA support and the CUDA Toolkit from the NVIDIA website.
The APIs of the libraries on this site have been kept close to the original APIs.
The functions of all libraries 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.
See the section about the
pointer handling
for more information.
A forum for discussion about JCuda can be found at
http://forum.byte-welt.de/forumdisplay.php?f=87&langid=2. Feel free
to post your questions and discuss all aspects of JCuda there. Apart from that, any
feedback that helps to improve the APIs and the
functionalities of the libraries is welcome.
News
2012-04-12: Early beta of JNpp uploaded
-
An early beta version of JNpp is available in the
Downloads section.
JNpp offers Java bindings for the NVIDIA Performance Primitives library,
which contains thousands of functions for efficient image processing.
See the JNpp page for details.
2012-03: Bug report
2012-02-08: Update to JCuda 0.4.1
-
This version is intended for CUDA 4.1, build 28. Not all functionalities
could be tested extensively, specifically those that require a
compute capability >=2 or a Linux OS.
-
The source code, documentation and binaries are available in the
downloads section.
If you would like to contribute by providing binaries for a
system configuration that is not available yet, please
contact me.
2012-01-02: Update to JCuda 0.4.1RC2b
-
This update is a Release Candidate. Not all functionalities
could be tested extensively, specifically those that require a
compute capability >=2 or a Linux OS.
-
The source code, documentation and binaries for 32 bit Windows are available
in the downloads section.
Other binaries will follow soon. If you would like to contribute by
providing binaries for a system configuration that is not available yet,
please contact me.
-
This update contains bindings for the new versions of CUBLAS and CUSPARSE.
These are offered via the
JCublas2 and JCusparse2
classes, respectively. The new versions are integrated as separate native
libraries, and the old versions are still available for backward compatibility.
The new versions of CUBLAS and CUSPARSE are inherently asynchronous. See
the notes about asynchronous operations
for details.
-
This update contains bindings for CUDPP 2.0. Since the CUDPP library is no
longer part of the CUDA SDK, the CUDPP DLL has to be compiled from the source
code that is available at
http://code.google.com/p/cudpp/.
A sample demonstrating the application of the hash functions of CUDPP 2.0
has been added in the Samples section.
-
The old linux- and MacOS makefiles have been removed. The preferred way
to compile the native libraries is now
CMake.
-
The KernelLauncher class from the Utilities
package has been updated. It now uses PTX files instead of CUBIN files, which
makes it less dependent on the Compute Capability of the target device.
-
Some bugs have been fixed. See the
change log for details.
2011-06-20: Update to JCuda 0.4.0-beta1
-
The source code, documentation and binaries for 32 bit Windows are available
in the downloads section.
Other binaries will follow soon. If you would like to contribute by
providing binaries for a system configuration that is not available yet,
please contact me.
-
Important notes:
-
Parts of JCuda have been refactored for release 0.4.0. Thus, this version
is still tagged as a 'beta' version. Although all tests have passed so
far, the new version could not yet be tested extensively on all operating
systems and architectures. Especially the new functions in CUDA 4.0, for
unified addressing and peer operations could not be tested due to limited
hardware capabilities.
-
The new API of CUBLAS (aka "CUBLAS2") has not been implemented yet.
It will be part of the final release.
-
The CUDPP library is no longer part of the NVIDIA CUDA SDK. Thus,
some versions of the native libraries for JCudpp may be omitted
in future releases.
-
Some bugs have been fixed. See the
change log for details.
-
A small Tutorial was set up that
shows how to get started with JCuda.
-
Some new Samples have been added
to show the new kernel invocation API of CUDA 4.0: The
JCudaVectorAdd and
JCudaDriverSample are small, simple
examples that show the new API and may, together with the
Tutorial, serve as starting
points for own development.
2011-05-24: Update to JCuda 0.4.0RC2
-
The source code, documentation and binaries for 32 and 64 bit Windows are available
in the downloads section.
Other binaries will follow soon. If you would like to contribute by
providing binaries for a system configuration that is not available yet,
please contact me.
-
Important notes:
-
Parts of JCuda have been refactored for this release. Thus, version 0.4.0RC2
is only a Release Candidate. It could not yet be tested extensively
on other operating systems and architectures. Especially the new functions for
unified addressing and peer operations could not be tested due to limited
hardware capabilities.
-
The new API of CUBLAS (aka "CUBLAS2") has not been implemented yet.
It will be part of the final release.
-
Some bugfixes involved minor modifications of the API. See the
change log for details.
-
The CUDPP library is no longer part of the NVIDIA CUDA SDK. Thus,
some versions of the native libraries for JCudpp may be omitted
in future releases.
-
Some bugs have been fixed. See the change log for details.
2011-02-14: Update to JCuda 0.3.2a
-
This version fixes a bug which caused an invalid memory size to be reported
for devices with >2GB memory on 64bit systems. The updated binaries for
64bit Windows (and, although unaffected by this bug, for 32 bit Windows and
Linux) are available in the downloads
section. Other binaries will follow soon.
2011-01-24: JCuda/JOGL interoperability samples updated.
-
The samples section contains
updated samples showing the JCuda/JOGL interoperability based on
the latest version of JOGL from JogAmp.org.
2010-11-22: Update for CUDA 3.2 final
-
Only a minor bugfix for the final release of JCuda 0.3.2. The updated
binaries for 32 bit Windows are available in the
downloads section. Other binaries
will follow soon.
2010-11-10: JCuda ImageJ Plugin section added
2010-10-21: JCuda 0.3.2 RC is now available. For registered and unregistered developers...
-
The source code, documentation and binaries for 32bit Windows are available
in the downloads section.
Other binaries will follow soon. If you would like to contribute by
providing binaries for a system configuration that is not available yet,
please contact me.
-
The new NVIDIA CUDA libraries are now also provided for JCuda:
- JCurand: Java bindings for CURAND, the NVIDIA CUDA random number generator
- JCusparse: Java bindings for CUSPARSE, the NVIDIA CUDA sparse matrix library
Samples showing how to use these libraries are available in
the samples section.
-
Important notes:
-
Version 0.3.2RC is only a Release Candidate. It could not yet
be tested extensively on other operating systems and architectures.
-
Parts of the CUDA API have changed slightly in version 3.2.
These changes directly show up in the API of JCuda 0.3.2.
Most functions of the CUDA driver API that are related to memory management
originally used
unsigned int values for memory sizes. These
had been represented as int values on Java side. But since
an unsigned int can not be used to represent large memory
blocks (for example, the total memory of a device with 6 GB of RAM) these
values are now represented using a size_t in CUDA 3.2.
For JCuda, this means that some functions are now taking long
values instead of int values. Fortunately, in most cases this
will not require any modification of existing code since it is covered by
the standard Java widening conventions. The only cases where a minor
modification will be required is for functions that had been using a
pointer to an unsigned int. For example, the function
for obtaining the total and free memory of a device:
CUresult cuMemGetInfo(unsigned int *free, unsigned int *total)
int cuMemGetInfo(int[] free, int[] total)
With CUDA 3.2, this function changed:
CUresult cuMemGetInfo(size_t *free, size_t *total)
int cuMemGetInfo(long[] free, long[] total)
Thus, it might be necessary to replace some int[] arrays in
existing code with long[] arrays. However, this modification
has not been so significant that a deprecation model or different versions
of these functions would be justified.
-
The
cuComplex and cuDoubleComplex types
have been moved from the package jcuda.jcublas into the package
jcuda, since these types are used in JCublas as well as in
JCusparse.
-
Some bugs have been fixed. See the change log for details.
2010-08-30: Matrix inversion sample uploaded
-
The samples section now contains a
matrix inversion example which loads and executes several CUDA kernels
to perform a Gauss elimination. The original kernels and the host implementation
have been developed by Christoph Wagner (Hochschule Mannheim) in his diploma
thesis in the ZAFH-AMSER project,
based on a presentation by Christian Heinrich (Fraunhofer SCAI).
2010-07-26:
Utilities package uploaded
-
The Utilities section
contains an archive with several utility classes for JCuda, including
an updated version of the "KernelLauncher" class, which simplifies the
setup and execution of kernels using the Driver API.
(
Change log)
Libraries
The following libraries are currently available:
| JCuda |
Java bindings for the CUDA runtime and driver API.
This is the base for all other libraries on this site. It
allows interacting with a CUDA device, by providing methods
for device- and event management, allocating memory on the
device and copying memory between the device and the host
system. Additionally, the library comprises bindings for
the CUDA driver API, which allows loading and executing
PTX- and CUBIN files and launching CUDA kernels from Java.
|
The following are special-purpose libraries which are using
JCuda as a common platform:
| JCublas |
Java bindings for CUBLAS, the NVIDIA CUDA BLAS library.
This library makes it possible to use CUBLAS, the NVIDIA CUDA implementation of the
Basic Linear Algebra Subprograms, in Java applications.
|
| JCufft |
Java bindings for the NVIDIA CUDA FFT library.
This library provides methods for using CUFFT, the NVIDIA CUDA implementation
of Fast Fourier Transforms in Java applications.
|
| JCudpp |
Java bindings for CUDPP, the CUDA Data Parallel Primitives Library.
This library enables Java applications to use the CUDA Data Parallel
Primitives Library, which contains methods for
sparse-matrix-vector-multiplications, parallel scans and sorting.
|
| JCurand |
Java bindings for CURAND, the NVIDIA CUDA random number generator.
JCurand offers GPU-accelerated random number generation for Java, using
the CURAND random number generator.
|
| JCusparse |
Java bindings for CUSPARSE, the NVIDIA CUDA sparse matrix library.
With JCusparse it is possible to use the sparse matrix level 1,2 and 3
BLAS functions and sparse matrix conversion routines provided by CUSPARSE.
|
|