public static int cuLaunchKernel(
        CUfunction f,
        int gridDimX,
        int gridDimY,
        int gridDimZ,
        int blockDimX,
        int blockDimY,
        int blockDimZ,
        int sharedMemBytes,
        CUstream hStream,
        Pointer kernelParams,
        Pointer extra)
    {
        return checkResult(cuLaunchKernelNative(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams, extra));
    }
public static int cuLaunchKernel ( CUfunction f , int gridDimX , int gridDimY , int gridDimZ , int blockDimX , int blockDimY , int blockDimZ , int sharedMemBytes , CUstream hStream , Pointer kernelParams , Pointer extra ) { return checkResult ( cuLaunchKernelNative ( f , gridDimX , gridDimY , gridDimZ , blockDimX , blockDimY , blockDimZ , sharedMemBytes , hStream , kernelParams , extra ) ) ; }
Launches a CUDA function.

<div>
<div>
<table>
<tr>
<td>CUresult cuLaunchKernel           </td>
<td>(</td>
<td>CUfunction&nbsp;</td>
<td> <em>f</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td>unsigned int&nbsp;</td>
<td> <em>gridDimX</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td>unsigned int&nbsp;</td>
<td> <em>gridDimY</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td>unsigned int&nbsp;</td>
<td> <em>gridDimZ</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td>unsigned int&nbsp;</td>
<td> <em>blockDimX</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td>unsigned int&nbsp;</td>
<td> <em>blockDimY</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td>unsigned int&nbsp;</td>
<td> <em>blockDimZ</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td>unsigned int&nbsp;</td>
<td> <em>sharedMemBytes</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td>CUstream&nbsp;</td>
<td> <em>hStream</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td>void **&nbsp;</td>
<td> <em>kernelParams</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td>void **&nbsp;</td>
<td> <em>extra</em></td>
<td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>
<div>
<p>
Invokes the kernel <code>f</code> on a <code>gridDimX</code> x
<code>gridDimY</code> x <code>gridDimZ</code> grid of blocks. Each
block contains <code>blockDimX</code> x <code>blockDimY</code> x
<code>blockDimZ</code> threads.
<p>
<code>sharedMemBytes</code> sets the amount of dynamic shared memory
that will be available to each thread block.
<p>
cuLaunchKernel() can optionally be associated to a stream by passing a
non-zero <code>hStream</code> argument.
<p>
Kernel parameters to <code>f</code> can be specified in one of two
ways:
<p>
1) Kernel parameters can be specified via <code>kernelParams</code>.
If <code>f</code> has N parameters, then <code>kernelParams</code>
needs to be an array of N pointers. Each of <code>kernelParams</code>[0]
through <code>kernelParams</code>[N-1] must point to a region of memory
from which the actual kernel parameter will be copied. The number of
kernel parameters and their offsets and sizes do not need to be
specified as that information is retrieved directly from the kernel's
image.
<p>
2) Kernel parameters can also be packaged by the application into a
single buffer that is passed in via the <code>extra</code> parameter.
This places the burden on the application of knowing each kernel
parameter's size and alignment/padding within the buffer. Here is an
example of using the <code>extra</code> parameter in this manner:
<div>
<pre>    <span>size_t</span> argBufferSize;
<span>char</span> argBuffer[256];

<span>// populate argBuffer and argBufferSize</span>

<span>void</span> *config[] = {
CU_LAUNCH_PARAM_BUFFER_POINTER, argBuffer,
CU_LAUNCH_PARAM_BUFFER_SIZE,    &amp;argBufferSize,
CU_LAUNCH_PARAM_END
};
status = cuLaunchKernel(f, gx, gy, gz, bx, by, bz, sh, s, NULL,
config);
</pre>
</div>
<p>
The <code>extra</code> parameter exists to allow cuLaunchKernel to take
additional less commonly used arguments. <code>extra</code> specifies
a list of names of extra settings and their corresponding values. Each
extra setting name is immediately followed by the corresponding value.
The list must be terminated with either NULL or
CU_LAUNCH_PARAM_END.
<p>
<ul>
<li>CU_LAUNCH_PARAM_END, which indicates the end of the <code>extra</code>
array;
</li>
<li>CU_LAUNCH_PARAM_BUFFER_POINTER, which specifies that
the next value in <code>extra</code> will be a pointer to a buffer
containing all the kernel parameters for launching kernel
<code>f</code>;
</li>
<li>CU_LAUNCH_PARAM_BUFFER_SIZE, which specifies
that the next value in <code>extra</code> will be a pointer to a size_t
containing the size of the buffer specified with
CU_LAUNCH_PARAM_BUFFER_POINTER;
</li>
</ul>
<p>
The error CUDA_ERROR_INVALID_VALUE will be returned if kernel parameters
are specified with both <code>kernelParams</code> and <code>extra</code>
(i.e. both <code>kernelParams</code> and <code>extra</code> are
non-NULL).
<p>
Calling cuLaunchKernel() sets persistent function state that is the
same as function state set through the following deprecated APIs:
<p>
cuFuncSetBlockShape() cuFuncSetSharedSize() cuParamSetSize()
cuParamSeti() cuParamSetf() cuParamSetv()
<p>
When the kernel <code>f</code> is launched via cuLaunchKernel(), the
previous block shape, shared size and parameter info associated with
<code>f</code> is overwritten.
<p>
Note that to use cuLaunchKernel(), the kernel <code>f</code> must
either have been compiled with toolchain version 3.2 or later so that
it will contain kernel parameter information, or have no kernel
parameters. If either of these conditions is not met, then
cuLaunchKernel() will return CUDA_ERROR_INVALID_IMAGE.
<p>
</div>
</div>

@return CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_HANDLE,
CUDA_ERROR_INVALID_IMAGE, CUDA_ERROR_INVALID_VALUE,
CUDA_ERROR_LAUNCH_FAILED, CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES,
CUDA_ERROR_LAUNCH_TIMEOUT, CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING,
CUDA_ERROR_SHARED_OBJECT_INIT_FAILED

@see JCudaDriver#cuCtxGetCacheConfig
@see JCudaDriver#cuCtxSetCacheConfig
@see JCudaDriver#cuFuncSetCacheConfig
@see JCudaDriver#cuFuncGetAttribute