Class CudaKernel
java.lang.Object
com.ibm.cuda.CudaKernel
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
TheParameters
class represents the actual parameters in akernel
launch. -
Constructor Summary
ConstructorDescriptionCudaKernel
(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
Modifier and TypeMethodDescriptionfinal int
getAttribute
(int attribute) Returns the value of the specified @{code attribute} for thefunction
associated with this kernel.final void
launch
(CudaGrid grid, CudaKernel.Parameters parameters) Launches this kernel.final void
Launches this kernel.final void
setCacheConfig
(CudaDevice.CacheConfig config) Configures the cache for thefunction
associated with this kernel.final void
Configures the shared memory of thefunction
associated with this kernel.
-
Constructor Details
-
CudaKernel
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
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 Details
-
getAttribute
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
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
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
Configures the cache for thefunction
associated with this kernel.- Parameters:
config
- the desired cache configuration- Throws:
CudaException
- if a CUDA exception occurs
-