Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all 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 16 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 14 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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _dpctl_tensor_constants:

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

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

Expand Down
37 changes: 30 additions & 7 deletions 37 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 @@ -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: <backend_type.opencl: 5>
"""

Expand All @@ -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: <event_status_type.complete: 4>
"""

Expand All @@ -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: <global_mem_cache_type.read_write: 4>
"""

Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.