Skip to content

Commit 48fdce3

Browse files
committed
Add constants.rst for documenting dpctl constants
Also adds custom formatting for Enums into `index.rst`
1 parent 3a459ee commit 48fdce3

File tree

3 files changed

+38
-16
lines changed

3 files changed

+38
-16
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.. _dpctl_constants:
2+
3+
Constants
4+
========================
5+
6+
The following constants are defined in :py:mod:`dpctl`:
7+
8+
.. currentmodule:: dpctl
9+
10+
.. autodata:: backend_type
11+
12+
.. autodata:: device_type
13+
14+
.. autodata:: event_status_type
15+
16+
.. autodata:: global_mem_cache_type

docs/doc_sources/api_reference/dpctl/index.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@
6464

6565
.. rubric:: Enums
6666

67-
.. autosummary::
68-
:toctree: generated
69-
:nosignatures:
67+
.. list-table::
68+
:widths: 10 50
7069

71-
device_type
72-
backend_type
73-
event_status_type
74-
global_mem_cache_type
70+
* - :py:class:`dpctl.device_type`
71+
- An :class:`enum.Enum` of supported SYCL device types.
72+
* - :py:class:`dpctl.backend_type`
73+
- An :class:`enum.Enum` of supported SYCL backends.
74+
* - :py:class:`dpctl.event_status_type`
75+
- An :class:`enum.Enum` of SYCL event states.
76+
* - :py:class:`dpctl.global_mem_cache_type`
77+
- An :class:`enum.Enum` of global memory cache types for a device.
7578

7679
.. rubric:: Exceptions
7780

dpctl/enum_types.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ class device_type(Enum):
2929
"""
3030
An :class:`enum.Enum` of supported SYCL device types.
3131
32-
Accepted enum values are
33-
34-
``all``:
32+
Accepted enum values are:
33+
``all``
3534
``accelerator``
3635
``automatic``
3736
``cpu``
@@ -65,9 +64,8 @@ class backend_type(Enum):
6564
"""
6665
An :class:`enum.Enum` of supported SYCL backends.
6766
68-
Accepted enum values are
69-
70-
``all``:
67+
Accepted enum values are:
68+
``all``
7169
``cuda``
7270
``hip``
7371
``level_zero``
@@ -95,6 +93,12 @@ class event_status_type(Enum):
9593
"""
9694
An :class:`enum.Enum` of SYCL event states.
9795
96+
Accepted enum values are:
97+
``unknown_status``
98+
``submitted``
99+
``running``
100+
``complete``
101+
98102
:Example:
99103
.. code-block:: python
100104
@@ -114,9 +118,8 @@ class global_mem_cache_type(Enum):
114118
"""
115119
An :class:`enum.Enum` of global memory cache types for a device.
116120
117-
Accepted enum values are
118-
119-
``indeterminate``:
121+
Accepted enum values are:
122+
``indeterminate``
120123
``none``
121124
``read_only``
122125
``read_write``

0 commit comments

Comments
 (0)