Skip to content

Commit 6e5fb12

Browse files
authored
DOCS: Grammar and spelling; Linking to objects (#1997)
1 parent 0f85061 commit 6e5fb12

10 files changed

Lines changed: 54 additions & 23 deletions

File tree

‎cuda_core/cuda/core/_device.pyx‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ cdef class DeviceProperties:
377377

378378
@property
379379
def gpu_overlap(self) -> bool:
380-
"""bool: Device can possibly copy memory and execute a kernel concurrently. Deprecated. Use instead async_engine_count."""
380+
"""bool: Device can possibly copy memory and execute a kernel concurrently. Deprecated. Use :attr:`~DeviceProperties.async_engine_count` instead."""
381381
return bool(self._get_cached_attribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP))
382382

383383
@property
@@ -662,7 +662,7 @@ cdef class DeviceProperties:
662662

663663
@property
664664
def read_only_host_register_supported(self) -> bool:
665-
"""bool: True if device supports using the cuMemHostRegister flag CU_MEMHOSTERGISTER_READ_ONLY to register memory that must be mapped as read-only to the GPU, False if not."""
665+
"""bool: True if device supports using the cuMemHostRegister flag CU_MEMHOSTREGISTER_READ_ONLY to register memory that must be mapped as read-only to the GPU, False if not."""
666666
return bool(
667667
self._get_cached_attribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED)
668668
)
@@ -841,12 +841,12 @@ cdef class DeviceProperties:
841841

842842
@property
843843
def mem_decompress_algorithm_mask(self) -> int:
844-
"""int: The returned valued shall be interpreted as a bitmask, where the individual bits are described by the CUmemDecompressAlgorithm enum."""
844+
"""int: The returned value shall be interpreted as a bitmask, where the individual bits are described by the CUmemDecompressAlgorithm enum."""
845845
return self._get_cached_attribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK)
846846

847847
@property
848848
def mem_decompress_maximum_length(self) -> int:
849-
"""int: The returned valued is the maximum length in bytes of a single decompress operation that is allowed."""
849+
"""int: The returned value is the maximum length in bytes of a single decompress operation that is allowed."""
850850
return self._get_cached_attribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH)
851851

852852
@property
@@ -897,7 +897,7 @@ cdef class DeviceProperties:
897897

898898
@property
899899
def host_memory_pools_supported(self) -> bool:
900-
"""bool: Device suports HOST location with the cuMemAllocAsync and cuMemPool family of APIs."""
900+
"""bool: Device supports HOST location with the cuMemAllocAsync and cuMemPool family of APIs."""
901901
return bool(
902902
self._get_cached_attribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED)
903903
)
@@ -1033,7 +1033,7 @@ class Device:
10331033
Parameters
10341034
----------
10351035
peer : Device | int
1036-
The peer device to check accessibility to. Can be a Device object or device ID.
1036+
The peer device to check accessibility to. Can be a :obj:`~_device.Device` object or device ID.
10371037
"""
10381038
peer = Device(peer)
10391039
cdef int d1 = <int> self.device_id
@@ -1253,7 +1253,7 @@ class Device:
12531253

12541254
Note
12551255
----
1256-
The newly context will not be set as current.
1256+
The newly created context will not be set as current.
12571257

12581258
Parameters
12591259
----------
@@ -1269,7 +1269,7 @@ class Device:
12691269
raise NotImplementedError("WIP: https://github.com/NVIDIA/cuda-python/issues/189")
12701270

12711271
def create_stream(self, obj: IsStreamT | None = None, options: StreamOptions | None = None) -> Stream:
1272-
"""Create a Stream object.
1272+
"""Create a :obj:`~_stream.Stream` object.
12731273

12741274
New stream objects can be created in two different ways:
12751275

@@ -1300,7 +1300,7 @@ class Device:
13001300
return Stream._init(obj=obj, options=options, device_id=self._device_id, ctx=self._context)
13011301

13021302
def create_event(self, options: EventOptions | None = None) -> Event:
1303-
"""Create an Event object without recording it to a Stream.
1303+
"""Create an :obj:`~_event.Event` object without recording it to a :obj:`~_stream.Stream`.
13041304

13051305
Note
13061306
----

‎cuda_core/cuda/core/_event.pyx‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,20 @@ cdef class Event:
213213

214214
@classmethod
215215
def from_ipc_descriptor(cls, ipc_descriptor: IPCEventDescriptor) -> Event:
216-
"""Import an event that was exported from another process."""
216+
"""Import an event that was exported from another process.
217+
218+
Parameters
219+
----------
220+
ipc_descriptor : :obj:`~_memory._ipc.IPCEventDescriptor`
221+
The IPC descriptor obtained from :attr:`~Event.ipc_descriptor` in
222+
another process.
223+
224+
Returns
225+
-------
226+
:obj:`~_event.Event`
227+
A new event backed by the imported IPC handle.
228+
229+
"""
217230
cdef cydriver.CUipcEventHandle data
218231
memcpy(data.reserved, <const void*><const char*>(ipc_descriptor._reserved), sizeof(data.reserved))
219232
cdef Event self = Event.__new__(cls)

‎cuda_core/cuda/core/_linker.pyx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class LinkerOptions:
188188
Attributes
189189
----------
190190
name : str, optional
191-
Name of the linker. If the linking succeeds, the name is passed down to the generated `ObjectCode`.
191+
Name of the linker. If the linking succeeds, the name is passed down to the generated :class:`ObjectCode`.
192192
arch : str, optional
193193
Pass the SM architecture value, such as ``sm_<CC>`` (for generating CUBIN) or
194194
``compute_<CC>`` (for generating PTX). If not provided, the current device's architecture

‎cuda_core/cuda/core/_memory/_buffer.pyx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ cdef class Buffer:
205205

206206
Parameters
207207
----------
208-
dst : :obj:`~_memory.Buffer`
209-
Source buffer to copy data from
208+
dst : :obj:`~_memory.Buffer`, optional
209+
Destination buffer to copy data to. If not provided, a new buffer
210+
is allocated using this buffer's memory resource.
210211
stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder`
211212
Keyword argument specifying the stream for the
212213
asynchronous copy

‎cuda_core/cuda/core/_memory/_device_memory_resource.pyx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ cdef class DeviceMemoryResource(_MemPool):
220220
Returns a tuple of sorted device IDs that currently have peer access to
221221
allocations from this memory pool.
222222
223-
When setting, accepts a sequence of Device objects or device IDs.
223+
When setting, accepts a sequence of :obj:`~_device.Device` objects or device IDs.
224224
Setting to an empty sequence revokes all peer access.
225225
226226
For non-owned pools (the default or current device pool), the state

‎cuda_core/cuda/core/_module.pyx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ cdef class KernelOccupancy:
307307
Returns
308308
-------
309309
:obj:`~MaxPotentialBlockSizeOccupancyResult`
310-
An object with `min_grid_size` amd `max_block_size` attributes encoding
310+
An object with `min_grid_size` and `max_block_size` attributes encoding
311311
the suggested launch configuration.
312312

313313
Note

‎cuda_core/cuda/core/_program.pyx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class ProgramOptions:
173173
Attributes
174174
----------
175175
name : str, optional
176-
Name of the program. If the compilation succeeds, the name is passed down to the generated `ObjectCode`.
176+
Name of the program. If the compilation succeeds, the name is passed down to the generated :class:`ObjectCode`.
177177
arch : str, optional
178178
Pass the SM architecture value, such as ``sm_<CC>`` (for generating CUBIN) or
179179
``compute_<CC>`` (for generating PTX). If not provided, the current device's architecture
@@ -272,13 +272,13 @@ class ProgramOptions:
272272
Disable the display of a diagnostic number for warning messages.
273273
Default: False
274274
diag_error : Union[int, list[int]], optional
275-
Emit error for a specified diagnostic message number or comma separated list of numbers.
275+
Emit error for a specified diagnostic message number or comma-separated list of numbers.
276276
Default: None
277277
diag_suppress : Union[int, list[int]], optional
278-
Suppress a specified diagnostic message number or comma separated list of numbers.
278+
Suppress a specified diagnostic message number or comma-separated list of numbers.
279279
Default: None
280280
diag_warn : Union[int, list[int]], optional
281-
Emit warning for a specified diagnostic message number or comma separated lis of numbers.
281+
Emit warning for a specified diagnostic message number or comma-separated list of numbers.
282282
Default: None
283283
brief_diagnostics : bool, optional
284284
Disable or enable showing source line and column info in a diagnostic.

‎cuda_core/cuda/core/_stream.pyx‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ cdef class Stream:
227227
def record(self, event: Event = None, options: EventOptions = None) -> Event:
228228
"""Record an event onto the stream.
229229

230-
Creates an Event object (or reuses the given one) by
230+
Creates an :obj:`~_event.Event` object (or reuses the given one) by
231231
recording on the stream.
232232

233233
Parameters
@@ -269,6 +269,13 @@ cdef class Stream:
269269
work is completed. This is done by recording a new :obj:`~_event.Event`
270270
on the stream and then waiting on it.
271271
272+
Parameters
273+
----------
274+
event_or_stream : :obj:`~_event.Event` | :obj:`~_stream.Stream`
275+
The event or stream to wait for. Objects supporting the
276+
``__cuda_stream__`` protocol are also accepted and treated as
277+
streams.
278+
272279
"""
273280
cdef Stream stream
274281
cdef EventHandle h_event
@@ -332,7 +339,7 @@ cdef class Stream:
332339
Note
333340
----
334341
Stream lifetime is not managed, foreign object must remain
335-
alive while this steam is active.
342+
alive while this stream is active.
336343

337344
Parameters
338345
----------

‎cuda_core/cuda/core/system/_system.pyx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ def get_driver_version_full(kernel_mode: bool = False) -> tuple[int, int, int]:
8888
def get_nvml_version() -> tuple[int, ...]:
8989
"""
9090
The version of the NVML library.
91+
92+
Returns
93+
-------
94+
version: tuple[int, ...]
95+
Tuple of integers representing the NVML version components.
9196
"""
9297
if not CUDA_BINDINGS_NVML_IS_COMPATIBLE:
9398
raise RuntimeError("NVML library is not available")
@@ -97,6 +102,11 @@ def get_nvml_version() -> tuple[int, ...]:
97102
def get_driver_branch() -> str:
98103
"""
99104
Retrieves the driver branch of the NVIDIA driver installed on the system.
105+
106+
Returns
107+
-------
108+
branch: str
109+
The driver branch string (e.g., ``"560"``, ``"open"``, etc.).
100110
"""
101111
if not CUDA_BINDINGS_NVML_IS_COMPATIBLE:
102112
raise RuntimeError("NVML library is not available")

‎cuda_core/docs/source/getting-started.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
.. SPDX-License-Identifier: Apache-2.0
33
44
.. currentmodule:: cuda.core
@@ -68,7 +68,7 @@ Don't forget to use :meth:`Device.set_current`!
6868
s = dev.create_stream()
6969
7070
Next, we compile the CUDA C++ kernel from earlier using the :class:`Program` class.
71-
The result of the compilation is saved as a CUBIN.
71+
The result of the compilation is saved as a CUBIN.
7272
Note the use of the ``name_expressions`` parameter to the :meth:`Program.compile` method to specify which kernel template instantiations to compile:
7373

7474
.. code-block:: python

0 commit comments

Comments
 (0)