public class CudaKernel
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CudaKernel.Parameters
The
Parameters class represents the actual parameters in
a kernel launch. |
Constructor and 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,
java.lang.String functionName)
Creates a new kernel object in the given module whose entry point
is the function with the specified name.
|
Modifier and Type | Method and Description |
---|---|
int |
getAttribute(int attribute)
Returns the value of the specified @{code attribute} for the
function associated with this kernel. |
void |
launch(CudaGrid grid,
CudaKernel.Parameters parameters)
Launches this kernel.
|
void |
launch(CudaGrid grid,
java.lang.Object... parameters)
Launches this kernel.
|
void |
setCacheConfig(CudaDevice.CacheConfig config)
Configures the cache for the
function associated
with this kernel. |
void |
setSharedMemConfig(CudaDevice.SharedMemConfig config)
Configures the shared memory of the
function
associated with this kernel. |
public CudaKernel(CudaModule module, CudaFunction function)
module
- the module containing the kernel codefunction
- the entry point of the kernelpublic CudaKernel(CudaModule module, java.lang.String functionName) throws CudaException
module
- the module containing the kernel codefunctionName
- the name of the entry point of the kernelCudaException
- if a CUDA exception occurspublic final int getAttribute(int attribute) throws CudaException
function
associated with this kernel.attribute
- the attribute to be queried (see CudaFunction.ATTRIBUTE_XXX)CudaException
- if a CUDA exception occurspublic final void launch(CudaGrid grid, java.lang.Object... parameters) throws CudaException
grid
and the actual parameter values are specified by parameters
.
Each parameter value must be one of the following:
grid
- the launch configurationparameters
- the actual parameter valuesCudaException
- if a CUDA exception occursjava.lang.IllegalArgumentException
- if parameters
contains any unsupported typespublic final void launch(CudaGrid grid, CudaKernel.Parameters parameters) throws CudaException
grid
and the actual parameter values are specified by parameters
.grid
- the launch configurationparameters
- the actual parameter valuesCudaException
- if a CUDA exception occursjava.lang.IllegalArgumentException
- if parameters
does not contain the correct number of valuespublic final void setCacheConfig(CudaDevice.CacheConfig config) throws CudaException
function
associated
with this kernel.config
- the desired cache configurationCudaException
- if a CUDA exception occurspublic final void setSharedMemConfig(CudaDevice.SharedMemConfig config) throws CudaException
function
associated with this kernel.config
- the desired shared memory configurationCudaException
- if a CUDA exception occursEclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 2013, 2023 IBM Corp. and others.