public final class CudaModule
extends java.lang.Object
CudaModule class represents a module that has been loaded
on a CUDA-capable device.
When no longer required, a module must be unloaded (see unload()).
| Modifier and Type | Class and Description |
|---|---|
static class |
CudaModule.Cache
The
Cache class provides a simple mechanism to avoid reloading
modules repeatedly. |
| Constructor and Description |
|---|
CudaModule(CudaDevice device,
byte[] image)
Loads a module on the specified device, using the given image and the
default options.
|
CudaModule(CudaDevice device,
byte[] image,
CudaJitOptions options)
Loads a module on the specified device, using the given image and the
given options.
|
CudaModule(CudaDevice device,
java.io.InputStream input)
Loads a module on the specified device from the given input stream using
the default options.
|
CudaModule(CudaDevice device,
java.io.InputStream input,
CudaJitOptions options)
Loads a module on the specified device from the given input stream using
the specified options.
|
| Modifier and Type | Method and Description |
|---|---|
CudaFunction |
getFunction(java.lang.String name)
Returns the function of the specified name from this module.
|
CudaGlobal |
getGlobal(java.lang.String name)
Returns the global variable of the specified name from this module.
|
CudaSurface |
getSurface(java.lang.String name)
Returns the surface of the specified name from this module.
|
CudaTexture |
getTexture(java.lang.String name)
Returns the texture of the specified name from this module.
|
void |
unload()
Unloads this module from the associated device.
|
public CudaModule(CudaDevice device, byte[] image) throws CudaException
device - the specified deviceimage - the module imageCudaException - if a CUDA exception occursjava.lang.SecurityException - if a security manager exists and the calling thread
does not have permission to load GPU modulespublic CudaModule(CudaDevice device, byte[] image, CudaJitOptions options) throws CudaException
device - the specified deviceimage - the module imageoptions - the desired optionsCudaException - if a CUDA exception occursjava.lang.SecurityException - if a security manager exists and the calling thread
does not have permission to load GPU modulespublic CudaModule(CudaDevice device, java.io.InputStream input) throws CudaException, java.io.IOException
device - the specified deviceinput - a stream containing the module imageCudaException - if a CUDA exception occursjava.io.IOException - if an I/O error occurs reading inputjava.lang.SecurityException - if a security manager exists and the calling thread
does not have permission to load GPU modulespublic CudaModule(CudaDevice device, java.io.InputStream input, CudaJitOptions options) throws CudaException, java.io.IOException
device - the specified deviceinput - a stream containing the module imageoptions - the desired optionsCudaException - if a CUDA exception occursjava.io.IOException - if an I/O error occurs reading inputjava.lang.SecurityException - if a security manager exists and the calling thread
does not have permission to load GPU modulespublic CudaFunction getFunction(java.lang.String name) throws CudaException
name - the link-name of the desired functionCudaException - if a CUDA exception occursjava.lang.IllegalStateException - if this module has been unloaded (see unload())public CudaGlobal getGlobal(java.lang.String name) throws CudaException
name - the link-name of the desired global variableCudaException - if a CUDA exception occursjava.lang.IllegalStateException - if this module has been unloaded (see unload())public CudaSurface getSurface(java.lang.String name) throws CudaException
name - the link-name of the desired surfaceCudaException - if a CUDA exception occursjava.lang.IllegalStateException - if this module has been unloaded (see unload())public CudaTexture getTexture(java.lang.String name) throws CudaException
name - the link-name of the desired textureCudaException - if a CUDA exception occursjava.lang.IllegalStateException - if this module has been unloaded (see unload())public void unload()
throws CudaException
Note that this has no effect on any caches.
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.
DRAFT internal-b00