diff --git a/docs/doc_sources/api_reference/dpctl/constants.rst b/docs/doc_sources/api_reference/dpctl/constants.rst new file mode 100644 index 0000000000..a7a44a69d1 --- /dev/null +++ b/docs/doc_sources/api_reference/dpctl/constants.rst @@ -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 diff --git a/docs/doc_sources/api_reference/dpctl/index.rst b/docs/doc_sources/api_reference/dpctl/index.rst index 2547bbdf32..11f86ecb21 100644 --- a/docs/doc_sources/api_reference/dpctl/index.rst +++ b/docs/doc_sources/api_reference/dpctl/index.rst @@ -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:: diff --git a/docs/doc_sources/api_reference/dpctl/tensor.constants.rst b/docs/doc_sources/api_reference/dpctl/tensor.constants.rst index 2cb9f770d2..6c166a3fa6 100644 --- a/docs/doc_sources/api_reference/dpctl/tensor.constants.rst +++ b/docs/doc_sources/api_reference/dpctl/tensor.constants.rst @@ -1,7 +1,7 @@ .. _dpctl_tensor_constants: Constants -======================== +========= The following constants are defined in :py:mod:`dpctl.tensor`: diff --git a/dpctl/enum_types.py b/dpctl/enum_types.py index 56168ff788..627ba31ac7 100644 --- a/dpctl/enum_types.py +++ b/dpctl/enum_types.py @@ -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 @@ -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 @@ -63,7 +76,7 @@ class backend_type(Enum): # create a SYCL device with OpenCL backend using filter selector d = dpctl.SyclDevice("opencl") - print(d.backend) + d.backend # Possible output: """ @@ -76,14 +89,19 @@ 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 import dpctl ev = dpctl.SyclEvent() - print(ev.execution_status ) + ev.execution_status # Possible output: """ @@ -95,14 +113,19 @@ 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 import dpctl dev = dpctl.SyclDevice() - print(dev.global_mem_cache_type) + dev.global_mem_cache_type # Possible output: """