- java.lang.Object
-
- com.ibm.cuda.CudaKernel
-
public class CudaKernel extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCudaKernel.ParametersTheParametersclass represents the actual parameters in akernellaunch.
-
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 intgetAttribute(int attribute)Returns the value of the specified @{code attribute} for thefunctionassociated with this kernel.voidlaunch(CudaGrid grid, CudaKernel.Parameters parameters)Launches this kernel.voidlaunch(CudaGrid grid, Object... parameters)Launches this kernel.voidsetCacheConfig(CudaDevice.CacheConfig config)Configures the cache for thefunctionassociated with this kernel.voidsetSharedMemConfig(CudaDevice.SharedMemConfig config)Configures the shared memory of thefunctionassociated 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 CudaExceptionReturns the value of the specified @{code attribute} for thefunctionassociated 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 bygridand 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- ifparameterscontains any unsupported types
-
launch
public final void launch(CudaGrid grid, CudaKernel.Parameters parameters) throws CudaException
Launches this kernel. The launch configuration is given bygridand the actual parameter values are specified byparameters.- Parameters:
grid- the launch configurationparameters- the actual parameter values- Throws:
CudaException- if a CUDA exception occursIllegalArgumentException- ifparametersdoes not contain the correct number of values
-
setCacheConfig
public final void setCacheConfig(CudaDevice.CacheConfig config) throws CudaException
Configures the cache for thefunctionassociated 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 thefunctionassociated with this kernel.- Parameters:
config- the desired shared memory configuration- Throws:
CudaException- if a CUDA exception occurs
-
-