cupyx.jit._interface._JitRawKernel#

class cupyx.jit._interface._JitRawKernel(func, mode, device)[source]#

JIT CUDA kernel object.

The decorator :func:cupyx.jit.rawkernel converts the target function to an object of this class. This class is not inteded to be instantiated by users.

Methods

__call__(grid, block, args, shared_mem=0, stream=None)[source]#

Calls the CUDA kernel.

The compilation will be deferred until the first function call. CuPy’s JIT compiler infers the types of arguments at the call time, and will cache the compiled kernels for speeding up any subsequent calls.

Parameters
  • grid (tuple of int) – Size of grid in blocks.

  • block (tuple of int) – Dimensions of each thread block.

  • args (tuple) – Arguments of the kernel. The type of all elements must be bool, int, float, complex, NumPy scalar or cupy.ndarray.

  • shared_mem (int) – Dynamic shared-memory size per thread block in bytes.

  • stream (cupy.cuda.Stream) – CUDA stream.

__getitem__(grid_and_block)[source]#

Numba-style kernel call.

__eq__(value, /)#

Return self==value.

__ne__(value, /)#

Return self!=value.

__lt__(value, /)#

Return self<value.

__le__(value, /)#

Return self<=value.

__gt__(value, /)#

Return self>value.

__ge__(value, /)#

Return self>=value.

Attributes

cached_code#

Returns next(iter(self.cached_codes.values())).

This proprety method is for debugging purpose. The return value is not guaranteed to keep backward compatibility.

cached_codes#

Returns a dict that has input types as keys and codes values.

This proprety method is for debugging purpose. The return value is not guaranteed to keep backward compatibility.