public final class Cuda
extends java.lang.Object
Cuda
class provides general CUDA utilities.Modifier and Type | Method and Description |
---|---|
static java.nio.ByteBuffer |
allocatePinnedHostBuffer(long capacity)
Allocates a new direct byte buffer, backed by page-locked host memory;
enabling optimal performance of transfers to and from device memory.
|
static int |
getDeviceCount()
Returns the number of CUDA-capable devices available to the Java host.
|
static int |
getDriverVersion()
Returns a number identifying the driver version.
|
static int |
getRuntimeVersion()
Returns a number identifying the runtime version.
|
public static java.nio.ByteBuffer allocatePinnedHostBuffer(long capacity) throws CudaException
The position of the returned buffer will be zero; its limit and
capacity will be capacity
; its order will be
LITTLE_ENDIAN
.
Notes:
Integer.MAX_VALUE
- that limit also applies and is enforced here.CudaException
will be thrown if the driver is not installed because registration of that
host memory with the driver is integral to the behavior of this method.capacity
- the desired capacity, in bytes, of the bufferCudaException
- if a CUDA exception occursjava.lang.IllegalArgumentException
- if capacity
is negative or larger than Integer.MAX_VALUE
public static int getDeviceCount() throws CudaException
CudaException
- if a CUDA exception occurspublic static int getDriverVersion() throws CudaException
CudaException
will be thrown if the CUDA driver is not installed.CudaException
- if a CUDA exception occurspublic static int getRuntimeVersion() throws CudaException
CudaException
will be thrown if the CUDA driver is not installed.CudaException
- if a CUDA exception occursEclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 2013, 2025 IBM Corp. and others.