Skip to content

Commit 56e92b9

Browse files
committed
Improve developer guide examples and style
- Fix nogil example to show multiple driver calls as described - Remove em dashes throughout, replacing with commas or rewording
1 parent e72f8a0 commit 56e92b9

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

cuda_core/docs/source/developer-guide.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ To support this, we suggest organizing content from most important to
4242
least important: principal classes first, then supporting classes, then
4343
implementation details. This way, readers can start at the top and
4444
immediately see what matters most. Unlike C/C++ where definitions must
45-
precede uses, Python imposes no such constraintwe're free to optimize
45+
precede uses, Python imposes no such constraint, so we're free to optimize
4646
for the reader.
4747

4848
These are guidelines, not rules. Place helper functions near their call
@@ -118,7 +118,7 @@ element comes first among the definitions.
118118

119119
Other public classes and functions follow. These might include auxiliary
120120
classes (e.g., ``DeviceMemoryResourceOptions``), abstract base classes,
121-
or additional exports. Organize them logicallyby related functionality
121+
or additional exports. Organize them logically, such as by related functionality
122122
or typical usage.
123123

124124
.. _8-public-module-functions:
@@ -604,7 +604,7 @@ Helper Functions
604604

605605
When a class grows long or a method becomes deeply nested, consider
606606
extracting implementation details into helper functions. The goal is to
607-
keep class definitions easy to navigate—readers shouldn't have to scroll
607+
keep class definitions easy to navigate. Readers shouldn't have to scroll
608608
through hundreds of lines to understand a class's interface.
609609

610610
In Cython files, helpers are typically ``cdef`` or ``cdef inline``
@@ -1147,7 +1147,7 @@ points to the caller:
11471147
11481148
warnings.warn(message, UserWarning, stacklevel=3)
11491149
1150-
The value depends on call depthtypically ``stacklevel=2`` for direct
1150+
The value depends on call depth: typically ``stacklevel=2`` for direct
11511151
calls, ``stacklevel=3`` when called through a helper.
11521152

11531153
CUDA-Specific Patterns
@@ -1181,9 +1181,10 @@ Group multiple driver calls in a single block:
11811181

11821182
.. code:: python
11831183
1184-
cdef int low, high
1184+
cdef int low, high, value
11851185
with nogil:
11861186
HANDLE_RETURN(cydriver.cuCtxGetStreamPriorityRange(&low, &high))
1187+
HANDLE_RETURN(cydriver.cuDeviceGetAttribute(&value, attr, device_id))
11871188
11881189
Raising Exceptions from ``nogil`` Context
11891190
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1213,7 +1214,7 @@ two phases:
12131214
better performance.
12141215

12151216
This approach separates correctness from optimization. Getting the logic
1216-
right firstwith Python's better error messages and stack tracesoften
1217+
right first, with Python's better error messages and stack traces, often
12171218
saves time overall.
12181219

12191220
Python Implementation

0 commit comments

Comments
 (0)