Skip to content

Commit 0cb2181

Browse files
Merge pull request #1659 from bdmoore1/bdmoore1-api-reference-doc-review
2 parents 0df3bec + 3deca07 commit 0cb2181

14 files changed

+39
-40
lines changed

docs/doc_sources/api_reference/dpctl/examples/usm_ndarray.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
.. rubric:: Use :meth:`usm_ndarray.device` to specify placement of new array
1313

1414
.. code-block:: python
15-
:caption: Create an USM-device empty array on the same device as another array
15+
:caption: Create a USM-device empty array on the same device as another array
1616
1717
from dpctl import tensor
1818

docs/doc_sources/api_reference/dpctl/memory.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
:py:mod:`dpctl.memory`
55
======================
66

7-
Subpackage :py:mod:`dpctl.memory` exposes Unified Shared Memory(USM) operations.
7+
Subpackage :py:mod:`dpctl.memory` exposes Unified Shared Memory (USM) operations.
88

99
Unified Shared Memory is a pointer-based memory management in SYCL guaranteeing that
1010
the host and all devices use a `unified address space <sycl_unified_address_space_>`_.
11-
Quoting from the SYCL specification:
11+
As described in the SYCL specification:
1212

1313
.. _sycl_unified_address_space: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_unified_addressing
1414

docs/doc_sources/api_reference/dpctl/program.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
=======================
55

66
:py:mod:`dpctl.program` provides a way to create a SYCL kernel
7-
from either an OpenCL program source code represented as a string
7+
from either an OpenCL* program source code represented as a string
88
or a SPIR-V binary file.
99

1010
It implements creation of interoperability

docs/doc_sources/api_reference/dpctl/sycl_usm_array_interface.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Python objects representing USM allocations, such as :py:class:`dpctl.memory.MemoryUSMDevice`,
77
:py:class:`dpctl.memory.MemoryUSMShared`, :py:class:`dpctl.memory.MemoryUSMHost`,
88
or :py:class:`dpctl.tensor.usm_ndarray`, distinguish themselves from other Python objects
9-
by providing ``__sycl_usm_array_interface__`` attribute describing the allocation in a
9+
by providing the ``__sycl_usm_array_interface__`` attribute describing the allocation in a
1010
Python dictionary with the following fields:
1111

1212
``"shape"``
@@ -32,23 +32,22 @@ Python dictionary with the following fields:
3232
is read-only).
3333

3434
``"strides"``
35-
an optional tuple of integers describing number of array elements needed to jump
35+
An optional tuple of integers describing number of array elements needed to jump
3636
to the next array element in the corresponding dimensions. The default value of ``None``
3737
implies a C-style contiguous (row-major compact) layout of the array.
3838

3939
``"offset"``
40-
an optional Python integer encoding offset in number of elements from the pointer
40+
An optional Python integer encoding offset in number of elements from the pointer
4141
provided in ``"data"`` field to the array element with zero indices. Default: `0`.
4242

4343
``"syclobj"``
4444
Python object from which SYCL context to which represented USM allocation is bound.
4545

4646
============================================== =======================================
47-
Filter selector string Platform's default context for platform
48-
the SYCL device selected by the
49-
:ref:`filter selector string <filter_selector_string>`
50-
is a part of.
51-
:py:class:`dpctl.SyclContext` An explicitly provided context
47+
Filter selector string The default context of the platform
48+
selected by
49+
:ref:`filter selector string <filter_selector_string>`.
50+
:py:class:`dpctl.SyclContext` An explicitly provided context.
5251
Python capsule with name ``"SyclContextRef"`` A Python capsule carrying a
5352
``DPCTLSyclContextRef`` opaque pointer.
5453
:py:class:`dpctl.SyclQueue` An explicitly provided queue which
@@ -61,7 +60,7 @@ Python dictionary with the following fields:
6160
============================================== =======================================
6261

6362
``"version"``
64-
version of the interface. At present, the only supported value is `1`.
63+
Version of the interface. At present, the only supported value is `1`.
6564

6665

6766
.. _numpy_array_interface: https://numpy.org/doc/stable/reference/arrays.interface.html

docs/doc_sources/api_reference/dpctl/tensor.data_type_functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Data type functions
44
===================
55

6-
Package :py:mod:`dpctl.tensor` contains the following data type functions conforming
6+
The package :py:mod:`dpctl.tensor` contains the following data type functions conforming
77
to `Python Array API specification <array_api_data_type_fns_>`_:
88

99
.. _array_api_data_type_fns: https://data-apis.org/array-api/latest/API_specification/data_type_functions.html

docs/doc_sources/api_reference/dpctl/tensor.data_types.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ Data types
2828
+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2929
| ``uint64`` | A 64-bit unsigned integer type capable of representing :math:`v` subject to :math:`0 \le v < 2^{64}` |
3030
+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
31-
| ``float16`` | An IEEE-754 half-precision (16-bits) binary floating-point number (see `IEEE 754-2019`_) |
31+
| ``float16`` | An IEEE-754 half-precision (16-bit) binary floating-point number (see `IEEE 754-2019`_) |
3232
+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
33-
| ``float32`` | An IEEE-754 single-precision (32-bits) binary floating-point number (see `IEEE 754-2019`_) |
33+
| ``float32`` | An IEEE-754 single-precision (32-bit) binary floating-point number (see `IEEE 754-2019`_) |
3434
+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
35-
| ``float64`` | An IEEE-754 double-precision (64-bits) binary floating-point number (see `IEEE 754-2019`_) |
35+
| ``float64`` | An IEEE-754 double-precision (64-bit) binary floating-point number (see `IEEE 754-2019`_) |
3636
+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
3737
| ``complex64`` | Single-precision (64-bit) complex floating-point number whose real and imaginary components are IEEE 754 single-precision (32-bit) binary floating-point numbers (see `IEEE 754-2019`_) |
3838
+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -48,7 +48,7 @@ Half-precision floating-point type ``float16`` is supported only for devices who
4848
Double-precision floating-point type ``float64`` and double-precision complex floating-point type ``complex128`` are supported only for devices whose attribute :attr:`dpctl.SyclDevice.has_aspect_fp64`
4949
evaluates to ``True``.
5050

51-
Requests to create an instance of array object for these types on devices where these prerequisites are not met will raise an exception.
51+
If prerequisites are not met, requests to create an instance of an array object for these types will raise an exception.
5252

5353
.. TODO: provide a note on support for sub-normal numbers
5454
@@ -118,7 +118,7 @@ Type promotion rules govern the behavior of an array library when a function doe
118118
a dedicated implementation for the data type(s) of the input array(s).
119119

120120
In such a case, input arrays may be cast to data types for which a dedicated implementation
121-
exists. e.g., when :data:`sin` is applied to array of integral values.
121+
exists. For example, when :data:`sin` is applied to array of integral values.
122122

123123
Type promotion rules used in :py:mod:`dpctl.tensor` are consistent with the
124124
Python Array API specification's `type promotion rules <https://data-apis.org/array-api/latest/API_specification/type_promotion.html>`_

docs/doc_sources/api_reference/dpctl/tensor.inspection.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Inspection API
55

66

77
:mod:`dpctl.tensor` implements a way to introspect implementation- and device-
8-
capabilities of array library as specified in
8+
capabilities of an array library as specified in
99
`Python Array API standard <array_api_inspection>`_:
1010

1111
.. currentmodule:: dpctl.tensor

docs/doc_sources/api_reference/dpctl/tensor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
.. currentmodule:: dpctl.tensor
99

10-
:py:mod:`dpctl.tensor` provides a reference implementation of
10+
:py:mod:`dpctl.tensor` provides a reference implementation of the
1111
:array_api:`Python Array API <>` specification. The implementation
1212
uses :ref:`data-parallel <parallelism_definitions>` algorithms suitable for execution on accelerators,
1313
such as GPUs.

docs/doc_sources/api_reference/dpctl_capi.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _dpctl_capi:
22

3-
:py:mod:`dpctl` C-API
3+
:py:mod:`dpctl` C API
44
=====================
55

66
:py:mod:`dpctl` core classes are implemented in Cython. C declarations for Python objects
@@ -41,7 +41,7 @@ Exported typedefs
4141
4242
.. c:struct:: PySyclProgramType
4343
44-
In order to check whether a particular Python objct is an instance of :py:class:`dpctl.SyclQueue` one would write:
44+
To check whether a particular Python object is an instance of :py:class:`dpctl.SyclQueue`:
4545

4646
.. code-block:: C
4747
:caption: Check if an object is of type :c:struct:`PySyclQueueType`
@@ -123,7 +123,7 @@ API for :c:struct:`Py_MemoryObject`
123123
.. c:function:: DPCTLSyclUSMRef Memory_GetUsmPointer(struct Py_MemoryObject *o)
124124
125125
:param o: Input object
126-
:returns: Opaque pointer to USM allocation represented by Python object
126+
:returns: Opaque pointer to USM allocation represented by Python object.
127127
128128
.. c:function:: DPCTLSyclContextRef Memory_GetSyclContext(struct Py_MemoryObject *o)
129129
@@ -172,24 +172,24 @@ API for :c:struct:`PyUSMArrayObject`
172172
.. c:function:: Py_ssize_t * UsmNDArray_GetShape(struct PyUSMArrayObject *arr)
173173
174174
:param arr: Input object
175-
:returns: Pointer to array of sizes of array along each dimension
175+
:returns: Pointer to array of sizes of array along each dimension.
176176
177177
The array has at least as many elements as returned by :c:func:`UsmNDArray_GetNDim`
178178
applied to input object ``arr``.
179179
180180
.. c:function:: Py_ssize_t * UsmNDArray_GetStrides(struct PyUSMArrayObject *arr)
181181
182182
:param arr: Input object
183-
:returns: Pointer to array of strides of array along each dimension
184-
:returns: NULL if array is C- or F-contiguous
183+
:returns: Pointer to array of strides of array along each dimension.
184+
:returns: NULL if array is C- or F-contiguous.
185185
186186
The array has at least as many elements as returned by :c:func:`UsmNDArray_GetNDim`
187187
applied to input object ``arr``.
188188
189189
.. c:function:: int UsmNDarray_GetTypenum(struct PyUSMArrayObject *arr)
190190
191191
:param arr: Input object
192-
:returns: An integer encoding the type of array elements
192+
:returns: An integer encoding the type of array elements.
193193
194194
The encoding is consistent with that integral values corresponding to enums
195195
used by :py:mod:`numpy`. See `NumPy Dtype C-API <https://numpy.org/doc/stable/reference/c-api/dtype.html#enumerated-types>`_.
@@ -202,7 +202,7 @@ API for :c:struct:`PyUSMArrayObject`
202202
.. c:function:: int UsmNDarray_GetFlags(struct PyUSMArrayObject *arr)
203203
204204
:param arr: Input object
205-
:returns: An integer encoding flags attribute of the array
205+
:returns: An integer encoding flags attribute of the array.
206206
207207
The flag encodes whether the array is C-contiguous, F-contiguous,
208208
whether it is read-only, or can be modified.
@@ -219,12 +219,12 @@ API for :c:struct:`PyUSMArrayObject`
219219
220220
:param arr: Input object
221221
:returns: Offset of zero multi-index array element from the beginning of
222-
the USM allocation
222+
the USM allocation.
223223
224224
.. c:function:: void UsmNDArray_SetWritableFlag(struct PyUSMArrayObject *arr, int flag)
225225
226226
:param arr: Input object
227-
:param flags: Whether to set writable flag of the array to read-only, or to writable
227+
:param flags: Whether to set writable flag of the array to read-only, or to writable.
228228
229229
Non-zero value of ``flag`` parameter sets the array flag bit to writable, a zero-value
230230
of ``flag`` parameter sets the flag bit of the array to read-only.

docs/doc_sources/api_reference/dpctl_cmake.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
CMake support
44
=============
55

6-
:py:mod:`dpctl` comes with configuration file `dpctl-config.cmake` which is installed
6+
:py:mod:`dpctl` comes with the configuration file `dpctl-config.cmake` which is installed
77
on the `standard search path CMake uses to search for packages <cmake_find_package_search_paths_>`_.
88

9-
To build your extension that leverages :py:mod:`dpctl` include the following line in your cmake script:
9+
To build your extension that leverages :py:mod:`dpctl`, include the following line in your CMake script:
1010

1111
.. code-block:: cmake
1212

docs/doc_sources/api_reference/dpctl_cython.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ File ``_backend.pxd`` redefines symbols from :ref:`DPCTLSyclInterface library <l
3838

3939
File ``sycl.pxd`` provides casters from opaque types in "DPCTLSyclInterface" C library to SYCL C++ object pointers.
4040

41-
Please refer to `examples/cython <https://github.com/IntelPython/dpctl/blob/master/examples/cython>`_ folder in the project
41+
Please refer to the `examples/cython <https://github.com/IntelPython/dpctl/blob/master/examples/cython>`_ folder in the project
4242
repository for a collection of examples.

docs/doc_sources/api_reference/dpctl_pybind11.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pybind11 API
44
============
55

6-
:py:mod:`dpctl` builds on top of :ref:`C-API <dpctl_capi>` to integrate with
6+
:py:mod:`dpctl` builds on top of :ref:`C API <dpctl_capi>` to integrate with the
77
`pybind11 <pybind11_url>`_ Python extension generator.
88

99
.. code-block:: c++
@@ -23,7 +23,7 @@ pybind11 API
2323
m.def("get_device_name", &get_device_name);
2424
}
2525

26-
The extension should be compiled using Intel(R) oneAPI DPC++ compiler:
26+
The extension should be compiled using the Intel(R) oneAPI DPC++ compiler:
2727

2828
.. code-block:: bash
2929

docs/doc_sources/api_reference/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The package ``dpctl`` provides
1313
- :ref:`API objects <dpctl_utils_pyapi>` in :py:mod:`dpctl.utils` namespace
1414
* SYCL-based Python array library
1515
- :ref:`API objects <dpctl_tensor_pyapi>` in :py:mod:`dpctl.tensor` namespace
16-
* Python C-API
16+
* Python C API
1717
- :ref:`C API <dpctl_capi>` for working with Python classes defined in :mod:`dpctl`
1818
* Extension generators
1919
- :ref:`Declarations <dpctl_cython_api>` for classes defined in :py:mod:`dpctl` and supporting functions for use in `Cython <cython_docs_>`_.

docs/doc_sources/api_reference/libsyclinterface/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.. _libsyclinterface:
22

33
C Library SyclInterface
4-
=======================
4+
========================
55

6-
:py:mod:`dpctl` contains SyclInterface library that provides C API to a subset of functionality exposed in DPC++ runtime classes.
6+
:py:mod:`dpctl` contains the SyclInterface library which provides C APIs to a subset of functionality exposed in DPC++ runtime classes.
77

8-
The C-API was necessary to support :py:mod:`numba_dpex` project to use DPC++ runtime classes from LLVM it generates.
8+
The C API was necessary to support the :py:mod:`numba_dpex` project to use DPC++ runtime classes from LLVM it generates.
99

1010
Full :doc:`API reference <generated/index>` is generated using doxyrest from doxygen strings.
1111

0 commit comments

Comments
 (0)