- java.lang.Object
-
- com.ibm.cuda.CudaModule
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CudaModule.Cache
TheCache
class provides a simple mechanism to avoid reloading modules repeatedly.
-
Constructor Summary
Constructors Constructor 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, InputStream input)
Loads a module on the specified device from the given input stream using the default options.CudaModule(CudaDevice device, InputStream input, CudaJitOptions options)
Loads a module on the specified device from the given input stream using the specified options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CudaFunction
getFunction(String name)
Returns the function of the specified name from this module.CudaGlobal
getGlobal(String name)
Returns the global variable of the specified name from this module.CudaSurface
getSurface(String name)
Returns the surface of the specified name from this module.CudaTexture
getTexture(String name)
Returns the texture of the specified name from this module.void
unload()
Unloads this module from the associated device.
-
-
-
Constructor Detail
-
CudaModule
public CudaModule(CudaDevice device, byte[] image) throws CudaException
Loads a module on the specified device, using the given image and the default options.- Parameters:
device
- the specified deviceimage
- the module image- Throws:
CudaException
- if a CUDA exception occursSecurityException
- if a security manager exists and the calling thread does not have permission to load GPU modules
-
CudaModule
public CudaModule(CudaDevice device, byte[] image, CudaJitOptions options) throws CudaException
Loads a module on the specified device, using the given image and the given options.- Parameters:
device
- the specified deviceimage
- the module imageoptions
- the desired options- Throws:
CudaException
- if a CUDA exception occursSecurityException
- if a security manager exists and the calling thread does not have permission to load GPU modules
-
CudaModule
public CudaModule(CudaDevice device, InputStream input) throws CudaException, IOException
Loads a module on the specified device from the given input stream using the default options.- Parameters:
device
- the specified deviceinput
- a stream containing the module image- Throws:
CudaException
- if a CUDA exception occursIOException
- if an I/O error occurs readinginput
SecurityException
- if a security manager exists and the calling thread does not have permission to load GPU modules
-
CudaModule
public CudaModule(CudaDevice device, InputStream input, CudaJitOptions options) throws CudaException, IOException
Loads a module on the specified device from the given input stream using the specified options.- Parameters:
device
- the specified deviceinput
- a stream containing the module imageoptions
- the desired options- Throws:
CudaException
- if a CUDA exception occursIOException
- if an I/O error occurs readinginput
SecurityException
- if a security manager exists and the calling thread does not have permission to load GPU modules
-
-
Method Detail
-
getFunction
public CudaFunction getFunction(String name) throws CudaException
Returns the function of the specified name from this module.- Parameters:
name
- the link-name of the desired function- Returns:
- the function of the specified name
- Throws:
CudaException
- if a CUDA exception occursIllegalStateException
- if this module has been unloaded (seeunload()
)
-
getGlobal
public CudaGlobal getGlobal(String name) throws CudaException
Returns the global variable of the specified name from this module.- Parameters:
name
- the link-name of the desired global variable- Returns:
- the global variable of the specified name
- Throws:
CudaException
- if a CUDA exception occursIllegalStateException
- if this module has been unloaded (seeunload()
)
-
getSurface
public CudaSurface getSurface(String name) throws CudaException
Returns the surface of the specified name from this module.- Parameters:
name
- the link-name of the desired surface- Returns:
- the surface of the specified name
- Throws:
CudaException
- if a CUDA exception occursIllegalStateException
- if this module has been unloaded (seeunload()
)
-
getTexture
public CudaTexture getTexture(String name) throws CudaException
Returns the texture of the specified name from this module.- Parameters:
name
- the link-name of the desired texture- Returns:
- the texture of the specified name
- Throws:
CudaException
- if a CUDA exception occursIllegalStateException
- if this module has been unloaded (seeunload()
)
-
unload
public void unload() throws CudaException
Unloads this module from the associated device.Note that this has no effect on any
caches
.- Throws:
CudaException
- if a CUDA exception occurs
-
-