java.lang.Object
com.ibm.cuda.CudaKernel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classTheParametersclass represents the actual parameters in akernellaunch. -
Constructor Summary
ConstructorsConstructorDescriptionCudaKernel(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 intgetAttribute(int attribute) Returns the value of the specified @{code attribute} for thefunctionassociated with this kernel.final voidlaunch(CudaGrid grid, CudaKernel.Parameters parameters) Launches this kernel.final voidLaunches this kernel.final voidsetCacheConfig(CudaDevice.CacheConfig config) Configures the cache for thefunctionassociated with this kernel.final voidConfigures the shared memory of thefunctionassociated 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 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
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
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
Configures the cache for thefunctionassociated with this kernel.- Parameters:
config- the desired cache configuration- Throws:
CudaException- if a CUDA exception occurs
-