Skip to content

Commit 7e25688

Browse files
committed
populate API references; clean up & polish docs
1 parent f3e7469 commit 7e25688

File tree

12 files changed

+117
-32
lines changed

12 files changed

+117
-32
lines changed

cuda_core/cuda/core/experimental/_launcher.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,14 @@ def _cast_to_3_tuple(self, cfg):
103103

104104

105105
def launch(kernel, config, *kernel_args):
106-
"""Launches a :obj:`Kernel` object with launch-time configuration.
107-
108-
Invokes a :obj:`Kernel` object with specified launch-time
109-
configurations.
106+
"""Launches a :obj:`~cuda.core.experimental._module.Kernel`
107+
object with launch-time configuration.
110108
111109
Parameters
112110
----------
113-
kernel : :obj:`Kernel`
111+
kernel : :obj:`~cuda.core.experimental._module.Kernel`
114112
Kernel to launch.
115-
config : Any
113+
config : :obj:`LaunchConfig`
116114
Launch configurations inline with options provided by
117115
:obj:`LaunchConfig` dataclass.
118116
*kernel_args : Any

cuda_core/cuda/core/experimental/_module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def _lazy_init():
4848
class Kernel:
4949
"""Represent a compiled kernel that had been loaded onto the device.
5050
51-
Kernel instances can execution when passed directly into a
52-
launch function.
51+
Kernel instances can execution when passed directly into the
52+
:func:`~cuda.core.experimental.launch` function.
5353
5454
Directly creating a :obj:`Kernel` is not supported, and they
5555
should instead be created through a :obj:`ObjectCode` object.

cuda_core/cuda/core/experimental/_program.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99

1010
class Program:
11-
"""Represent a compilation machinery to process programs into :obj:`ObjectCode`.
11+
"""Represent a compilation machinery to process programs into
12+
:obj:`~cuda.core.experimental._module.ObjectCode`.
1213
1314
This object provides a unified interface to multiple underlying
1415
compiler libraries. Compilation support is enabled for a wide
@@ -19,7 +20,7 @@ class Program:
1920
code : Any
2021
String of the CUDA Runtime Compilation program.
2122
code_type : Any
22-
String of the code type. Only "c++" is currently supported.
23+
String of the code type. Currently only ``"c++"`` is supported.
2324
2425
"""
2526

@@ -74,7 +75,7 @@ def compile(self, target_type, options=(), name_expressions=(), logs=None):
7475
7576
Returns
7677
-------
77-
:obj:`ObjectCode`
78+
:obj:`~cuda.core.experimental._module.ObjectCode`
7879
Newly created code object.
7980
8081
"""
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
7+
{% block methods %}
8+
{% if methods %}
9+
.. rubric:: {{ _('Methods') }}
10+
11+
{% for item in methods %}
12+
.. automethod:: {{ item }}
13+
{%- endfor %}
14+
15+
{% endif %}
16+
{% endblock %}
17+
18+
{% block attributes %}
19+
{% if attributes %}
20+
.. rubric:: {{ _('Attributes') }}
21+
22+
{% for item in attributes %}
23+
.. autoattribute:: {{ item }}
24+
{%- endfor %}
25+
{% endif %}
26+
{% endblock %}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
7+
{% block methods %}
8+
.. automethod:: __init__
9+
{% endblock %}
10+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
:members: __new__
7+
:special-members: __new__
8+
:exclude-members: count, index, __reduce__, __reduce_ex__, __repr__, __hash__, __str__, __getnewargs__

cuda_core/docs/source/api.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,26 @@
33
``cuda.core.experimental`` API Reference
44
========================================
55

6+
All of the APIs listed (or cross-referenced from) below are considered *experimental*
7+
and subject to future changes without deprecation notice. Once stablized they will be
8+
moved out of the ``experimental`` namespace.
9+
10+
611
CUDA runtime
712
------------
813

914
.. autosummary::
1015
:toctree: generated/
1116

1217
Device
18+
launch
19+
20+
:template: dataclass.rst
21+
22+
EventOptions
23+
StreamOptions
24+
LaunchConfig
25+
1326

1427
CUDA compilation toolchain
1528
--------------------------
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
:orphan:
2+
3+
.. This page is to generate documentation for private classes exposed to users,
4+
i.e., users cannot instantiate it by themselves but may use it's properties
5+
or methods via returned values from public APIs. These classes must be referred
6+
in public APIs returning their instances.
7+
8+
.. currentmodule:: cuda.core.experimental
9+
10+
CUDA runtime
11+
------------
12+
13+
.. autosummary::
14+
:toctree: generated/
15+
16+
_memory.Buffer
17+
_stream.Stream
18+
_event.Event
19+
20+
21+
CUDA compilation toolchain
22+
--------------------------
23+
24+
.. autosummary::
25+
:toctree: generated/
26+
27+
_module.Kernel
28+
_module.ObjectCode

cuda_core/docs/source/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
'sphinx.ext.autosummary',
3535
'sphinx.ext.napoleon',
3636
'myst_nb',
37-
'enum_tools.autoenum'
37+
'enum_tools.autoenum',
38+
'sphinx_copybutton',
3839
]
3940

4041
# Add any paths that contain templates here, relative to this directory.
@@ -77,3 +78,6 @@
7778
# relative to this directory. They are copied after the builtin static files,
7879
# so a file named "default.css" will overwrite the builtin "default.css".
7980
html_static_path = ['_static']
81+
82+
# skip cmdline prompts
83+
copybutton_exclude = '.linenos, .gp'

cuda_core/docs/source/install.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,19 @@
55
`cuda.core` is supported on all platforms that CUDA is supported. Specific
66
dependencies are as follows:
77

8-
* Driver: Linux (450.80.02 or later) Windows (456.38 or later)
9-
* CUDA Toolkit 12.0 to 12.6
8+
| | CUDA 11 | CUDA 12 |
9+
|------------------ | ------------ | ----------- |
10+
| CUDA Toolkit [^1] | 11.2 - 11.8 | 12.0 - 12.6 |
11+
| Driver | 450.80.02+ (Linux), 452.39+ (Windows) | 525.60.13+ (Linux), 527.41+ (Windows) |
1012

11-
12-
## Installing from PyPI
13-
14-
Coming soon!
15-
16-
17-
## Installing from Conda
18-
19-
Coming soon!
13+
[^1]: Including `cuda-python`.
2014

2115

2216
## Installing from Source
2317

24-
```shell
18+
```console
2519
$ git clone https://github.com/NVIDIA/cuda-python
2620
$ cd cuda-python/cuda_core
2721
$ pip install .
2822
```
29-
For now `cuda-python` (`cuda-bindings` later) is a required dependency.
23+
For now `cuda-python` (`cuda-bindings` later) 11.x or 12.x is a required dependency.

0 commit comments

Comments
 (0)