Skip to content

Commit eed7990

Browse files
Merge pull request #1414 from IntelPython/docs/improve-doc-strings
Improve docstring for kernel_api functions. af226f3
1 parent ba11dac commit eed7990

File tree

24 files changed

+641
-521
lines changed

24 files changed

+641
-521
lines changed

dev/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 77c7ed92725ec04ee213bdd81322e999
3+
config: 63040eaeab372d0bca2060603001fe58
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

dev/_sources/autoapi/numba_dpex/core/boxing/index.rst.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ Overview
2424
* - :py:obj:`RangeType <numba_dpex.core.boxing.RangeType>`
2525
- Numba-dpex type corresponding to
2626
* - :py:obj:`NdRange <numba_dpex.core.boxing.NdRange>`
27-
- A class to encapsulate all kernel launch parameters.
27+
- Analogue to the :sycl_ndrange:`sycl::nd_range <>` class.
2828
* - :py:obj:`Range <numba_dpex.core.boxing.Range>`
29-
- A data structure to encapsulate a single kernel launch parameter.
29+
- Analogue to the :sycl_range:`sycl::range <>` class.
3030
* - :py:obj:`USMNdArray <numba_dpex.core.boxing.USMNdArray>`
3131
- A type class to represent dpctl.tensor.usm_ndarray.
3232
* - :py:obj:`NdRange <numba_dpex.core.boxing.NdRange>`
33-
- A class to encapsulate all kernel launch parameters.
33+
- Analogue to the :sycl_ndrange:`sycl::nd_range <>` class.
3434
* - :py:obj:`Range <numba_dpex.core.boxing.Range>`
35-
- A data structure to encapsulate a single kernel launch parameter.
35+
- Analogue to the :sycl_range:`sycl::range <>` class.
3636

3737

3838
.. list-table:: Function
@@ -80,7 +80,7 @@ Classes
8080

8181
.. py:class:: NdRange(global_size, local_size)
8282
83-
A class to encapsulate all kernel launch parameters.
83+
Analogue to the :sycl_ndrange:`sycl::nd_range <>` class.
8484

8585
The NdRange defines the index space for a work group as well as
8686
the global index space. It is passed to parallel_for to execute
@@ -131,7 +131,7 @@ Classes
131131
132132
Bases: :py:obj:`tuple`
133133

134-
A data structure to encapsulate a single kernel launch parameter.
134+
Analogue to the :sycl_range:`sycl::range <>` class.
135135

136136
The range is an abstraction that describes the number of elements
137137
in each dimension of buffers and index spaces. It can contain
@@ -225,7 +225,7 @@ Classes
225225

226226
.. py:class:: NdRange(global_size, local_size)
227227
228-
A class to encapsulate all kernel launch parameters.
228+
Analogue to the :sycl_ndrange:`sycl::nd_range <>` class.
229229

230230
The NdRange defines the index space for a work group as well as
231231
the global index space. It is passed to parallel_for to execute
@@ -276,7 +276,7 @@ Classes
276276
277277
Bases: :py:obj:`tuple`
278278

279-
A data structure to encapsulate a single kernel launch parameter.
279+
Analogue to the :sycl_range:`sycl::range <>` class.
280280

281281
The range is an abstraction that describes the number of elements
282282
in each dimension of buffers and index spaces. It can contain

dev/_sources/autoapi/numba_dpex/kernel_api/atomic_fence/index.rst.txt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,30 @@ Overview
2222
:class: summarytable
2323

2424
* - :py:obj:`atomic_fence <numba_dpex.kernel_api.atomic_fence.atomic_fence>`\ (memory_order, memory_scope)
25-
- The function for performing memory fence across all work-items.
25+
- Performs a memory fence operations across all work-items.
2626

2727

2828

2929

3030
Functions
3131
---------
32-
.. py:function:: atomic_fence(memory_order, memory_scope)
32+
.. py:function:: atomic_fence(memory_order: numba_dpex.kernel_api.memory_enums.MemoryOrder, memory_scope: numba_dpex.kernel_api.memory_enums.MemoryScope)
3333
34-
The function for performing memory fence across all work-items.
35-
Modeled after ``sycl::atomic_fence`` function.
36-
It provides control over re-ordering of memory load
37-
and store operations. The ``atomic_fence`` function acts as a
38-
fence across all work-items and devices specified by a
39-
memory_scope argument.
34+
Performs a memory fence operations across all work-items.
4035

41-
Args:
42-
memory_order: The memory synchronization order.
36+
The function is equivalent to the ``sycl::atomic_fence`` function and
37+
controls the order of memory accesses (loads and stores) by individual
38+
work-items.
4339

44-
memory_scope: The set of work-items and devices to which
45-
the memory ordering constraints apply.
40+
.. important::
41+
The function is a no-op during CPython execution and only available in
42+
JIT compiled mode of execution.
4643

44+
:param memory_order: The memory synchronization order.
45+
:type memory_order: MemoryOrder
46+
:param memory_scope: The set of work-items and devices to which
47+
the memory ordering constraints apply.
48+
:type memory_scope: MemoryScope
4749

4850

4951

dev/_sources/autoapi/numba_dpex/kernel_api/atomic_ref/index.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Overview
2222
:class: summarytable
2323

2424
* - :py:obj:`AtomicRef <numba_dpex.kernel_api.atomic_ref.AtomicRef>`
25-
- Analogue to the ``sycl::atomic_ref`` class.
25+
- Analogue to the :sycl_atomic_ref:`sycl::atomic_ref <>` class.
2626

2727

2828

@@ -32,7 +32,7 @@ Classes
3232

3333
.. py:class:: AtomicRef(ref, index, memory_order=MemoryOrder.RELAXED, memory_scope=MemoryScope.DEVICE, address_space=None)
3434
35-
Analogue to the ``sycl::atomic_ref`` class.
35+
Analogue to the :sycl_atomic_ref:`sycl::atomic_ref <>` class.
3636

3737
An atomic reference is a view into a data container that can be then updated
3838
atomically using any of the ``fetch_*`` member functions of the class.

dev/_sources/autoapi/numba_dpex/kernel_api/barrier/index.rst.txt

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,41 @@ Overview
2222
:class: summarytable
2323

2424
* - :py:obj:`group_barrier <numba_dpex.kernel_api.barrier.group_barrier>`\ (group, fence_scope)
25-
- Performs a barrier operation across all work-items in a work group.
25+
- Performs a barrier operation across all work-items in a work-group.
2626

2727

2828

2929

3030
Functions
3131
---------
32-
.. py:function:: group_barrier(group: numba_dpex.kernel_api.index_space_ids.Group, fence_scope=MemoryScope.WORK_GROUP)
32+
.. py:function:: group_barrier(group: numba_dpex.kernel_api.index_space_ids.Group, fence_scope: numba_dpex.kernel_api.memory_enums.MemoryScope = MemoryScope.WORK_GROUP)
3333
34-
Performs a barrier operation across all work-items in a work group.
34+
Performs a barrier operation across all work-items in a work-group.
3535

36-
The function is modeled after the ``sycl::group_barrier`` function. It
37-
synchronizes work within a group of work items. All the work-items
36+
The function is equivalent to the ``sycl::group_barrier`` function. It
37+
synchronizes work within a group of work-items. All the work-items
3838
of the group must execute the barrier call before any work-item
3939
continues execution beyond the barrier.
4040

41-
The ``group_barrier`` performs mem-fence operations ensuring that memory
41+
The ``group_barrier`` performs a memory fence operation ensuring that memory
4242
accesses issued before the barrier are not re-ordered with those issued
43-
after the barrier: all work-items in group G execute a release fence prior
43+
after the barrier. All work-items in group G execute a release fence prior
4444
to synchronizing at the barrier, all work-items in group G execute an
4545
acquire fence afterwards, and there is an implicit synchronization of these
4646
fences as if provided by an explicit atomic operation on an atomic object.
4747

48-
:param fence_scope: scope of any memory consistency
49-
:type fence_scope: optional
50-
:param operations that are performed by the barrier.:
48+
.. important::
49+
The function is not implemented yet for pure CPython execution and is
50+
only supported in JIT compiled mode of execution.
51+
52+
:param group: Indicates the work-group inside which the barrier is to
53+
be executed.
54+
:type group: Group
55+
:param fence_scope: scope of any memory
56+
consistency operations that are performed by the barrier.
57+
:type fence_scope: MemoryScope) (optional
58+
59+
:raises NotImplementedError: When the function is called directly from Python.
5160

5261

5362

0 commit comments

Comments
 (0)