Skip to content

Commit b87710a

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

File tree

3 files changed

+51
-10
lines changed

3 files changed

+51
-10
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: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,16 @@ class device_type(Enum):
3131
3232
Accepted enum values are
3333
34-
``all``:
34+
``all``
35+
3536
``accelerator``
37+
3638
``automatic``
39+
3740
``cpu``
41+
3842
``custom``
43+
3944
``gpu``
4045
4146
:Example:
@@ -67,10 +72,14 @@ class backend_type(Enum):
6772
6873
Accepted enum values are
6974
70-
``all``:
75+
``all``
76+
7177
``cuda``
78+
7279
``hip``
80+
7381
``level_zero``
82+
7483
``opencl``
7584
7685
:Example:
@@ -95,6 +104,16 @@ class event_status_type(Enum):
95104
"""
96105
An :class:`enum.Enum` of SYCL event states.
97106
107+
Accepted enum values are
108+
109+
``unknown_status``
110+
111+
``submitted``
112+
113+
``running``
114+
115+
``complete``
116+
98117
:Example:
99118
.. code-block:: python
100119
@@ -116,9 +135,12 @@ class global_mem_cache_type(Enum):
116135
117136
Accepted enum values are
118137
119-
``indeterminate``:
138+
``indeterminate``
139+
120140
``none``
141+
121142
``read_only``
143+
122144
``read_write``
123145
124146
:Example:

0 commit comments

Comments
 (0)