Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DEFAULT_LOCAL_SIZE completely from the code #1291

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions docs/source/user_guide/kernel_programming/writing_kernels.rst
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 docs/source/user_guide/programming_model.rst
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
1 change: 0 additions & 1 deletion numba_dpex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ def parse_sem_version(version_string: str) -> Tuple[int, int, int]:
sub_group_barrier,
)

DEFAULT_LOCAL_SIZE = []
load_dpctl_sycl_interface()
del load_dpctl_sycl_interface

Expand Down
2 changes: 1 addition & 1 deletion numba_dpex/vectorizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def to_host(self, devary, queue):
copy_to_numpy_from_usm_obj(devary_memview, hostary)

def launch(self, func, count, queue, args):
func[count, dpex.DEFAULT_LOCAL_SIZE](*args)
func[dpex.Range(count)](*args)

def device_array(self, shape, dtype, queue):
size = np.prod(shape)
Expand Down
Loading