Skip to content

Commit b38750d

Browse files
author
Diptorup Deb
authored
Docs/0.8.0 api docs (#477)
* Final few changes to API docs. * Add version entry of 0.8.0
1 parent 7eafc30 commit b38750d

File tree

11 files changed

+154
-84
lines changed

11 files changed

+154
-84
lines changed

docs/conf.in

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,21 @@
88
# import os
99
# import sys
1010
# sys.path.insert(0, os.path.abspath('.'))
11-
import textwrap
11+
from docutils.parsers.rst import directives
12+
from sphinx.ext.autosummary import Autosummary, get_documenter
13+
from sphinx.util.inspect import safe_getattr
14+
15+
import dpctl
1216

1317
# -- Project information -----------------------------------------------------
1418

1519
project = "Data-parallel Control (dpctl)"
1620
copyright = "2020, Intel Corp."
1721
author = "Intel Corp."
1822

19-
version = "@CURRENT_RELEASE@"
23+
version = dpctl.__version__.strip(".dirty")
2024
# The full version, including alpha/beta/rc tags
21-
release = "@CURRENT_RELEASE@"
25+
release = dpctl.__version__.strip(".dirty")
2226

2327

2428
# -- General configuration ---------------------------------------------------
@@ -53,7 +57,9 @@ if use_doxyrest == "ON":
5357
# rst files.
5458
import fileinput
5559

56-
with fileinput.FileInput("@DOXYREST_OUTPUT_DIR@/global.rst", inplace=True) as file:
60+
with fileinput.FileInput(
61+
"@DOXYREST_OUTPUT_DIR@/global.rst", inplace=True
62+
) as file:
5763
for line in file:
5864
print(line.replace("typedefDPCTL_C_EXTERN_C_BEGIN", ""), end="")
5965

@@ -143,36 +149,6 @@ if generate_multiversion == "ON":
143149
(version, DOC_SITE_NAME + version + "/index.html")
144150
)
145151

146-
# Add an "autoclassmembers" directive that acts the same way as
147-
# "autoclass", but does not print out the class doc.
148-
149-
from sphinx.ext.autodoc import ClassDocumenter, ObjectMembers
150-
from sphinx.ext.autodoc.importer import get_class_members
151-
152-
153-
class ClassMembersDocumenter(ClassDocumenter):
154-
"""
155-
Documenter for only class members and skips the class and __init__
156-
docstrings.
157-
"""
158-
159-
objtype = "classmembers"
160-
161-
def add_directive_header(self, sig):
162-
pass
163-
164-
def get_doc(self, encoding=None, ignore=None):
165-
return None
166-
167-
168-
# Add an "autoautosummary" directive to add a summary table of class
169-
# members and attributes.
170-
# See https://stackoverflow.com/questions/20569011/python-sphinx-autosummary-automated-listing-of-member-functions
171-
172-
from docutils.parsers.rst import directives
173-
from sphinx.ext.autosummary import Autosummary, get_documenter
174-
from sphinx.util.inspect import safe_getattr
175-
176152

177153
class AutoAutoSummary(Autosummary):
178154
"""Create a summary for methods and attributes (autosummary).
@@ -210,7 +186,9 @@ class AutoAutoSummary(Autosummary):
210186
if "methods" in self.options:
211187
methods = self.get_members(app, c, ["method"], ["__init__"])
212188
self.content = [
213-
"%s" % method for method in methods if not method.startswith("_")
189+
"%s" % method
190+
for method in methods
191+
if not method.startswith("_")
214192
]
215193
if "private_methods" in self.options:
216194
private_methods = self.get_members(app, c, ["method"], ["__init__"])
@@ -222,11 +200,12 @@ class AutoAutoSummary(Autosummary):
222200
if "attributes" in self.options:
223201
attribs = self.get_members(app, c, ["attribute", "property"])
224202
self.content = [
225-
"%s" % attrib for attrib in attribs if not attrib.startswith("_")
203+
"%s" % attrib
204+
for attrib in attribs
205+
if not attrib.startswith("_")
226206
]
227207
return super().run()
228208

229209

230210
def setup(app):
231211
app.add_directive("autoautosummary", AutoAutoSummary)
232-
app.add_autodocumenter(ClassMembersDocumenter)

docs/doc_versions.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0.8.0
12
0.7.0
23
0.6.1
34
latest

docs/docfiles/dpctl.memory_api.rst

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,3 @@ Functions
2828
---------
2929

3030
.. autofunction:: dpctl.memory.as_usm_memory
31-
32-
Comparison with Rapids Memory Manager (RMM)
33-
-------------------------------------------
34-
35-
RMM implements DeviceBuffer which is Cython native class wrapping around something similar to ``std::vector<unsigned char, custom_cuda_allocator (calls resource manager)>`` which is called device_buffer.
36-
37-
DeviceBuffer stores a unique pointer to an instance of this class. DeviceBuffer implements ``__cuda_array_interface__``. Direct constructors always allocate
38-
new memory and copy provided inputs into the newly allocated array.
39-
40-
Zero-copy construction is possible from a ``unique_ptr<device_ buffer>``, with
41-
the ownership being moved to the Cython extension instance.
42-
43-
DeviceBuffer provides ``__reduce__`` method to support pickling (which works by copying content of the device buffer to host) and provides the following set of routines, among others:
44-
45-
- ``copy_to_host(host_buf_obj)`` to copy content of the underlying device_buffer to a host buffer
46-
- ``copy_from_host(host_buf_obf)`` to copy content of the host buffer into memory of underlying device_buffer
47-
- ``copy_from_device(cuda_ary_obj)`` to copy device memory underlying cuda_ary_obj Python object implementing ``__cuda_array_interface__`` to the memory underlying DeviceBuffer instance.
48-
49-
RMM's methods are declared nogil.

docs/docfiles/dpctl_pyapi.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
dpctl Python API
55
################
66

7+
.. currentmodule:: dpctl
8+
79
.. automodule:: dpctl
810

911
Sub-modules
@@ -26,11 +28,11 @@ Classes
2628
.. toctree::
2729
:maxdepth: 1
2830

29-
dpctl_pyapi/SyclContext
30-
dpctl_pyapi/SyclDevice
31-
dpctl_pyapi/SyclEvent
32-
dpctl_pyapi/SyclPlatform
33-
dpctl_pyapi/SyclQueue
31+
dpctl.SyclContext : A Python class representing cl::sycl::context <dpctl_pyapi/SyclContext>
32+
dpctl.SyclDevice : A Python class representing cl::sycl::device <dpctl_pyapi/SyclDevice>
33+
dpctl.SyclEvent : A Python class representing cl::sycl::event <dpctl_pyapi/SyclEvent>
34+
dpctl.SyclPlatform : A Python class representing cl::sycl::event <dpctl_pyapi/SyclPlatform>
35+
dpctl.SyclQueue : A Python class representing cl::sycl::event <dpctl_pyapi/SyclQueue>
3436

3537
Enumerations
3638
------------

docs/docfiles/dpctl_pyapi/SyclContext.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
dpctl.SyclContext
55
#################
66

7+
.. currentmodule:: dpctl
8+
79
.. autoclass:: dpctl.SyclContext
810

911
.. rubric:: Attributes:

docs/docfiles/dpctl_pyapi/SyclDevice.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
dpctl.SyclDevice
55
################
66

7-
.. autoclass:: dpctl.SyclDevice
7+
.. currentmodule:: dpctl
8+
9+
.. autoclass:: SyclDevice
810

911
.. rubric:: Attributes:
1012

docs/docfiles/dpctl_pyapi/SyclEvent.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
dpctl.SyclEvent
55
###############
66

7+
.. currentmodule:: dpctl
8+
79
.. autoclass:: dpctl.SyclEvent
810

911
.. rubric:: Public methods:
1012

1113
.. autoautosummary:: dpctl.SyclEvent
1214
:methods:
1315

14-
1516
Detail
1617
======
1718

docs/docfiles/dpctl_pyapi/SyclPlatform.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
dpctl.SyclPlatform
55
##################
66

7+
.. currentmodule:: dpctl
78

89
.. autoclass:: dpctl.SyclPlatform
910

@@ -12,11 +13,6 @@ dpctl.SyclPlatform
1213
.. autoautosummary:: dpctl.SyclPlatform
1314
:attributes:
1415

15-
.. rubric:: Private methods:
16-
17-
.. autoautosummary:: dpctl.SyclPlatform
18-
:private_methods:
19-
2016
.. rubric:: Public methods:
2117

2218
.. autoautosummary:: dpctl.SyclPlatform

docs/docfiles/dpctl_pyapi/SyclQueue.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
dpctl.SyclQueue
55
###############
66

7+
.. currentmodule:: dpctl
8+
79
.. autoclass:: dpctl.SyclQueue
810

911
.. rubric:: Attributes:

0 commit comments

Comments
 (0)