Skip to content

Commit

Permalink
Merge pull request #1291 from chudur-budur/fix/nuke-default-local-size
Browse files Browse the repository at this point in the history
Remove DEFAULT_LOCAL_SIZE completely from the code da3d1a0
  • Loading branch information
github-actions[bot] committed Jan 23, 2024
1 parent 6098c20 commit 0d50743
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 30 deletions.
27 changes: 0 additions & 27 deletions dev/_sources/user_guide/kernel_programming/writing_kernels.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,6 @@ storing the result of vector summation:
:name: ex_kernel_declaration_vector_sum


.. Kernel Invocation
.. ------------------
.. When a kernel is launched you must specify the *global size* and the *local size*,
.. which determine the hierarchy of threads, that is the order in which kernels
.. will be invoked.
.. The following syntax is used in ``numba-dpex`` for kernel invocation with
.. specified global and local sizes:
.. ``kernel_function_name[global_size, local_size](kernel arguments)``
.. In the following example we invoke kernel ``kernel_vector_sum`` with global size
.. specified via variable ``global_size``, and use ``numba_dpex.DEFAULT_LOCAL_SIZE``
.. constant for setting local size to some default value:
.. .. code-block:: python
.. import numba_dpex as ndpx
.. global_size = 10
.. kernel_vector_sum[global_size, ndpx.DEFAULT_LOCAL_SIZE](a, b, c)
.. .. note::
.. Each kernel is compiled once, but it can be called multiple times with different global and local sizes settings.
Kernel Invocation
------------------

Expand Down
2 changes: 1 addition & 1 deletion dev/_sources/user_guide/programming_model.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Specifying the execution queue is done using Python context manager:
with dpctl.device_context(q):
# apply the kernel to elements of X, writing value into Y,
# while executing using given queue
numba_dpex_poly[X.size, numba_dpex.DEFAULT_LOCAL_SIZE](X, Y)
numba_dpex_poly[numba_dpex.Range(X.size)](X, Y)
The argument to ``device_context`` can be a queue object, a device object for
which a temporary queue will be created, or a filter selector string. Thus we
Expand Down
2 changes: 1 addition & 1 deletion dev/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/user_guide/programming_model.html
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ <h2>Specifying offload target<a class="headerlink" href="#specifying-offload-tar
<span class="k">with</span> <span class="n">dpctl</span><span class="o">.</span><span class="n">device_context</span><span class="p">(</span><span class="n">q</span><span class="p">):</span>
<span class="c1"># apply the kernel to elements of X, writing value into Y,</span>
<span class="c1"># while executing using given queue</span>
<span class="n">numba_dpex_poly</span><span class="p">[</span><span class="n">X</span><span class="o">.</span><span class="n">size</span><span class="p">,</span> <span class="n">numba_dpex</span><span class="o">.</span><span class="n">DEFAULT_LOCAL_SIZE</span><span class="p">](</span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">)</span>
<span class="n">numba_dpex_poly</span><span class="p">[</span><span class="n">numba_dpex</span><span class="o">.</span><span class="n">Range</span><span class="p">(</span><span class="n">X</span><span class="o">.</span><span class="n">size</span><span class="p">)](</span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">)</span>
</pre></div>
</div>
<p>The argument to <code class="docutils literal notranslate"><span class="pre">device_context</span></code> can be a queue object, a device object for
Expand Down

0 comments on commit 0d50743

Please sign in to comment.