kernel.rst 1.41 KB
Newer Older
root's avatar
root committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Custom kernels
==============

.. autosummary::
   :toctree: generated/

   cupy.ElementwiseKernel
   cupy.ReductionKernel
   cupy.RawKernel
   cupy.RawModule
   cupy.fuse


JIT kernel definition
---------------------

Supported Python built-in functions include: :obj:`range`, :func:`len`, :func:`max`, :func:`min`.

.. note:: If loop unrolling is needed, use :func:`cupyx.jit.range` instead of the built-in :obj:`range`.

.. autosummary::
   :toctree: generated/

   cupyx.jit.rawkernel
   cupyx.jit.threadIdx
   cupyx.jit.blockDim
   cupyx.jit.blockIdx
   cupyx.jit.gridDim
   cupyx.jit.grid
   cupyx.jit.gridsize
   cupyx.jit.laneid
   cupyx.jit.warpsize
   cupyx.jit.range
   cupyx.jit.syncthreads
   cupyx.jit.syncwarp
   cupyx.jit.shfl_sync
   cupyx.jit.shfl_up_sync
   cupyx.jit.shfl_down_sync
   cupyx.jit.shfl_xor_sync
   cupyx.jit.shared_memory
   cupyx.jit.atomic_add
   cupyx.jit.atomic_sub
   cupyx.jit.atomic_exch
   cupyx.jit.atomic_min
   cupyx.jit.atomic_max
   cupyx.jit.atomic_inc
   cupyx.jit.atomic_dec
   cupyx.jit.atomic_cas
   cupyx.jit.atomic_and
   cupyx.jit.atomic_or
   cupyx.jit.atomic_xor
   cupyx.jit.cg.this_grid
   cupyx.jit.cg.this_thread_block
   cupyx.jit.cg.sync
   cupyx.jit.cg.memcpy_async
   cupyx.jit.cg.wait
   cupyx.jit.cg.wait_prior
   cupyx.jit._interface._JitRawKernel


Kernel binary memoization
-------------------------

.. autosummary::
   :toctree: generated/

   cupy.memoize
   cupy.clear_memo