Skip to content

Commit aa7a0b0

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

File tree

3 files changed

+46
-28
lines changed

3 files changed

+46
-28
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: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ class device_type(Enum):
2929
"""
3030
An :class:`enum.Enum` of supported SYCL device types.
3131
32-
Accepted enum values are
33-
34-
``all``:
35-
``accelerator``
36-
``automatic``
37-
``cpu``
38-
``custom``
39-
``gpu``
32+
| ``all``
33+
| ``accelerator``
34+
| ``automatic``
35+
| ``cpu``
36+
| ``custom``
37+
| ``gpu``
4038
4139
:Example:
4240
.. code-block:: python
@@ -65,13 +63,11 @@ class backend_type(Enum):
6563
"""
6664
An :class:`enum.Enum` of supported SYCL backends.
6765
68-
Accepted enum values are
69-
70-
``all``:
71-
``cuda``
72-
``hip``
73-
``level_zero``
74-
``opencl``
66+
| ``all``
67+
| ``cuda``
68+
| ``hip``
69+
| ``level_zero``
70+
| ``opencl``
7571
7672
:Example:
7773
.. code-block:: python
@@ -95,6 +91,11 @@ class event_status_type(Enum):
9591
"""
9692
An :class:`enum.Enum` of SYCL event states.
9793
94+
| ``unknown_status``
95+
| ``submitted``
96+
| ``running``
97+
| ``complete``
98+
9899
:Example:
99100
.. code-block:: python
100101
@@ -114,12 +115,10 @@ class global_mem_cache_type(Enum):
114115
"""
115116
An :class:`enum.Enum` of global memory cache types for a device.
116117
117-
Accepted enum values are
118-
119-
``indeterminate``:
120-
``none``
121-
``read_only``
122-
``read_write``
118+
| ``indeterminate``
119+
| ``none``
120+
| ``read_only``
121+
| ``read_write``
123122
124123
:Example:
125124
.. code-block:: python

0 commit comments

Comments
 (0)