Skip to content

Commit a4fc6c1

Browse files
Omar Atiecursoragent
authored andcommitted
style(cuda.core): apply pre-commit ruff format and regenerate _stream.pyi
Fix pre-commit.ci failures on ruff-format and stubgen-pyx-cuda-core. Co-authored-by: Cursor <[email protected]>
1 parent d221efb commit a4fc6c1

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎cuda_core/cuda/core/_stream.pyi‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class StreamOptions:
2727
higher priority. (Default to lowest priority)
2828
synchronization_policy : SynchronizationPolicyType | None, optional
2929
CPU wait policy applied when synchronizing this stream from the host.
30+
Maps to ``CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY`` via
31+
``cuStreamSetAttribute``. (Default to None, leaving the driver default)
3032
3133
"""
3234
nonblocking: cython.bint = True
@@ -115,10 +117,14 @@ class Stream:
115117

116118
@property
117119
def synchronization_policy(self):
118-
"""Return the stream's CPU wait policy for host-side synchronization."""
120+
"""Return the stream's CPU wait policy for host-side synchronization.
121+
122+
Maps to ``CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY``, queried via
123+
``cuStreamGetAttribute``.
124+
"""
119125

120126
@synchronization_policy.setter
121-
def synchronization_policy(self, policy) -> None:
127+
def synchronization_policy(self, policy: object):
122128
"""Set the stream's CPU wait policy for subsequent work on this stream."""
123129

124130
def sync(self) -> None:

‎cuda_core/tests/test_stream.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,7 @@ def test_stream_synchronization_policy_default(init_cuda):
514514
def test_stream_options_synchronization_policy(init_cuda):
515515
from cuda.core.typing import SynchronizationPolicyType
516516

517-
stream = Device().create_stream(
518-
options=StreamOptions(synchronization_policy=SynchronizationPolicyType.YIELD)
519-
)
517+
stream = Device().create_stream(options=StreamOptions(synchronization_policy=SynchronizationPolicyType.YIELD))
520518
assert stream.synchronization_policy == SynchronizationPolicyType.YIELD
521519
stream.close()
522520

0 commit comments

Comments
 (0)