Skip to content

Commit

Permalink
Show kernel code
Browse files Browse the repository at this point in the history
Discuss about new kernel launch parameter syntax.
  • Loading branch information
chudur-budur committed Jul 11, 2023
1 parent 7d168a2 commit f8a8d24
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/sources/user_manual/kernel_programming/writing_kernels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,30 @@ result of vector summation:

.. literalinclude:: ./../../../../numba_dpex/examples/kernel/vector_sum.py
:language: python
:lines: 27-28
:lines: 11-15
:caption: **EXAMPLE:** Invocation of the vector sum kernel
:name: ex_kernel_invocation_vector_sum

.. note::
Each kernel is compiled once, but it can be called multiple times with different global and local sizes settings.


Kernel invocation (New Syntax)
------------------------------

Since the release 0.20.0 (Phoenix), we have introduced new kernel launch parameter
syntax for specifying ``global_size`` and ``local_size`` that similar to ``SYCL``'s
``range`` and ``ndrange`` classes. The ``global_size`` and ``local_size`` can now
be specified with ``numba_dpex``'s ``Range`` and ``NdRange`` classes.

.. literalinclude:: ./../../../../numba_dpex/examples/kernel/vector_sum.py
:language: python
:lines: 11-15
:caption: **EXAMPLE:** Invocation of the vector sum kernel
:name: ex_kernel_invocation_vector_sum



Kernel indexing functions
-------------------------

Expand Down

0 comments on commit f8a8d24

Please sign in to comment.