- java.lang.Object
-
- com.ibm.cuda.CudaKernel
-
public class CudaKernel extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CudaKernel.Parameters
TheParameters
class represents the actual parameters in akernel
launch.
-
Constructor Summary
Constructors Constructor Description CudaKernel(CudaModule module, CudaFunction function)
Creates a new kernel object in the given module whose entry point is the specified function.CudaKernel(CudaModule module, String functionName)
Creates a new kernel object in the given module whose entry point is the function with the specified name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAttribute(int attribute)
Returns the value of the specified @{code attribute} for thefunction
associated with this kernel.void
launch(CudaGrid grid, CudaKernel.Parameters parameters)
Launches this kernel.void
launch(CudaGrid grid, Object... parameters)
Launches this kernel.void
setCacheConfig(CudaDevice.CacheConfig config)
Configures the cache for thefunction
associated with this kernel.void
setSharedMemConfig(CudaDevice.SharedMemConfig config)
Configures the shared memory of thefunction
associated with this kernel.
-
-
-
Constructor Detail
-
CudaKernel
public CudaKernel(CudaModule module, CudaFunction function)
Creates a new kernel object in the given module whose entry point is the specified function.- Parameters:
module
- the module containing the kernel codefunction
- the entry point of the kernel
-
CudaKernel
public CudaKernel(CudaModule module, String functionName) throws CudaException
Creates a new kernel object in the given module whose entry point is the function with the specified name.- Parameters:
module
- the module containing the kernel codefunctionName
- the name of the entry point of the kernel- Throws:
CudaException
- if a CUDA exception occurs
-
-
Method Detail
-
getAttribute
public final int getAttribute(int attribute) throws CudaException
Returns the value of the specified @{code attribute} for thefunction
associated with this kernel.- Parameters:
attribute
- the attribute to be queried (see CudaFunction.ATTRIBUTE_XXX)- Returns:
- the attribute value
- Throws:
CudaException
- if a CUDA exception occurs
-
launch
public final void launch(CudaGrid grid, Object... parameters) throws CudaException
Launches this kernel. The launch configuration is given bygrid
and the actual parameter values are specified byparameters
.Each parameter value must be one of the following:
- a boxed primitive value
- a CudaBuffer object
- null
- Parameters:
grid
- the launch configurationparameters
- the actual parameter values- Throws:
CudaException
- if a CUDA exception occursIllegalArgumentException
- ifparameters
contains any unsupported types
-
launch
public final void launch(CudaGrid grid, CudaKernel.Parameters parameters) throws CudaException
Launches this kernel. The launch configuration is given bygrid
and the actual parameter values are specified byparameters
.- Parameters:
grid
- the launch configurationparameters
- the actual parameter values- Throws:
CudaException
- if a CUDA exception occursIllegalArgumentException
- ifparameters
does not contain the correct number of values
-
setCacheConfig
public final void setCacheConfig(CudaDevice.CacheConfig config) throws CudaException
Configures the cache for thefunction
associated with this kernel.- Parameters:
config
- the desired cache configuration- Throws:
CudaException
- if a CUDA exception occurs
-
setSharedMemConfig
public final void setSharedMemConfig(CudaDevice.SharedMemConfig config) throws CudaException
Configures the shared memory of thefunction
associated with this kernel.- Parameters:
config
- the desired shared memory configuration- Throws:
CudaException
- if a CUDA exception occurs
-
-