Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/doc_sources/api_reference/dpctl/constants.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _dpctl_constants:

Constants
========================

The following constants are defined in :py:mod:`dpctl`:

.. currentmodule:: dpctl

.. autodata:: device_type

.. autodata:: backend_type

.. autodata:: event_status_type

.. autodata:: global_mem_cache_type
14 changes: 14 additions & 0 deletions docs/doc_sources/api_reference/dpctl/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@
has_cpu_devices
has_accelerator_devices

.. rubric:: Enums

.. list-table::
:widths: 10 50

* - :py:class:`dpctl.device_type`
- An :class:`enum.Enum` of supported SYCL device types.
* - :py:class:`dpctl.backend_type`
- An :class:`enum.Enum` of supported SYCL backends.
* - :py:class:`dpctl.event_status_type`
- An :class:`enum.Enum` of SYCL event states.
* - :py:class:`dpctl.global_mem_cache_type`
- An :class:`enum.Enum` of global memory cache types for a device.

.. rubric:: Exceptions

.. autosummary::
Expand Down
31 changes: 27 additions & 4 deletions dpctl/enum_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@

class device_type(Enum):
"""
An enumeration of supported SYCL device types.
An :class:`enum.Enum` of supported SYCL device types.

| ``all``
| ``accelerator``
| ``automatic``
| ``cpu``
| ``custom``
| ``gpu``

:Example:
.. code-block:: python
Expand All @@ -54,7 +61,13 @@ class device_type(Enum):

class backend_type(Enum):
"""
An enumeration of supported SYCL backends.
An :class:`enum.Enum` of supported SYCL backends.

| ``all``
| ``cuda``
| ``hip``
| ``level_zero``
| ``opencl``

:Example:
.. code-block:: python
Expand All @@ -76,7 +89,12 @@ class backend_type(Enum):

class event_status_type(Enum):
"""
An enumeration of SYCL event states.
An :class:`enum.Enum` of SYCL event states.

| ``unknown_status``
| ``submitted``
| ``running``
| ``complete``

:Example:
.. code-block:: python
Expand All @@ -95,7 +113,12 @@ class event_status_type(Enum):

class global_mem_cache_type(Enum):
"""
An enumeration of global memory cache types for a device.
An :class:`enum.Enum` of global memory cache types for a device.

| ``indeterminate``
| ``none``
| ``read_only``
| ``read_write``

:Example:
.. code-block:: python
Expand Down
Loading