Skip to content

Commit 4d394aa

Browse files
committed
Address CodeRabbit comments
1 parent 324fe52 commit 4d394aa

4 files changed

Lines changed: 39 additions & 12 deletions

File tree

‎cuda_bindings_12/cuda/bindings/cyruntime.pxd‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0
44
#
55
# This code was automatically generated with version 12.9.0. Do not modify it directly.
6-
# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=da56544ab7133a98983b04b2a0e4f9593ac6efa502b02cc27682a8dc84d2e163
6+
# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3b4da42728210e76f79e896fe70d8167e7dff92ec533e35a6ee4cf78234c272c
77

88

99
# <<<< PREAMBLE CONTENT >>>>
@@ -2471,6 +2471,11 @@ cdef extern from 'cuda_runtime_api.h':
24712471
cdef enum:
24722472
CUDA_EGL_MAX_PLANES = 3
24732473

2474+
# Defined in the CUDA 12 headers only (removed in CUDA 13); declared as integers for ABI compat
2475+
cdef enum:
2476+
cudaCooperativeLaunchMultiDeviceNoPreSync = 1
2477+
cudaCooperativeLaunchMultiDeviceNoPostSync = 2
2478+
24742479
# libraryPropertyType_t (starts lowercase, outside type pattern)
24752480
cdef extern from 'library_types.h':
24762481
ctypedef enum libraryPropertyType_t 'libraryPropertyType_t':

‎cuda_bindings_12/cuda/bindings/runtime.pyx‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# This code was automatically generated with version 12.9.0. Do not modify it directly.
5-
# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=43dd07707817f1747c7d5de898f7c687bbea9d20f1c69bd419389a80a432049c
5+
# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=756f2405020fb6cc7847ccf6966b5246e1b1d6a247d0e34a64428f069dc3f603
66
from typing import Any, Optional
77
import cython
88
import ctypes
@@ -216,6 +216,18 @@ cudaInvalidDeviceId = cyruntime.cudaInvalidDeviceId
216216
#: call
217217
cudaInitDeviceFlagsAreValid = cyruntime.cudaInitDeviceFlagsAreValid
218218

219+
#: If set, each kernel launched as part of
220+
#: :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` only waits for prior
221+
#: work in the stream corresponding to that GPU to complete before the
222+
#: kernel begins execution.
223+
cudaCooperativeLaunchMultiDeviceNoPreSync = cyruntime.cudaCooperativeLaunchMultiDeviceNoPreSync
224+
225+
#: If set, any subsequent work pushed in a stream that participated in a
226+
#: call to :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` will only
227+
#: wait for the kernel launched on the GPU corresponding to that stream to
228+
#: complete before it begins execution.
229+
cudaCooperativeLaunchMultiDeviceNoPostSync = cyruntime.cudaCooperativeLaunchMultiDeviceNoPostSync
230+
219231
#: Indicates that the layered sparse CUDA array or CUDA mipmapped array has
220232
#: a single mip tail region for all layers
221233
cudaArraySparsePropertiesSingleMipTail = cyruntime.cudaArraySparsePropertiesSingleMipTail

‎cuda_bindings_12/docs/source/module/runtime.rst‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
.. This code was automatically generated with version 12.9.0. Do not modify it directly.
55
6-
.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=41d5b07cce4842964a93699efa6460343c599539c8afc5a0036e020945bc96a4
6+
.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9471dcb7815306c7978746e132235eac637aad52a8d9aca8ee6c1f492a866769
77
-------
88
runtime
99
-------
@@ -4860,6 +4860,14 @@ Data types used by CUDA Runtime
48604860

48614861
Tell the CUDA runtime that DeviceFlags is being set in cudaInitDevice call
48624862

4863+
.. autoattribute:: cuda.bindings.runtime.cudaCooperativeLaunchMultiDeviceNoPreSync
4864+
4865+
If set, each kernel launched as part of :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` only waits for prior work in the stream corresponding to that GPU to complete before the kernel begins execution.
4866+
4867+
.. autoattribute:: cuda.bindings.runtime.cudaCooperativeLaunchMultiDeviceNoPostSync
4868+
4869+
If set, any subsequent work pushed in a stream that participated in a call to :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` will only wait for the kernel launched on the GPU corresponding to that stream to complete before it begins execution.
4870+
48634871
.. autoattribute:: cuda.bindings.runtime.cudaArraySparsePropertiesSingleMipTail
48644872

48654873
Indicates that the layered sparse CUDA array or CUDA mipmapped array has a single mip tail region for all layers

‎cuda_bindings_12/tests/test_build_hooks.py‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,9 @@ def test_the_build_checks_the_header_before_it_touches_the_tree(self, tmp_path,
316316
monkeypatch.setattr(build_hooks, "_get_cuda_paths", lambda: [cuda_path])
317317

318318
def not_reached(*args):
319-
raise AssertionError("the header check must run before parsing or generating source files")
319+
raise AssertionError("the header check must run before touching the source tree")
320320

321-
monkeypatch.setattr(build_hooks, "_parse_headers", not_reached)
322-
monkeypatch.setattr(build_hooks, "_generate_output", not_reached)
321+
monkeypatch.setattr(build_hooks, "_rename_architecture_specific_files", not_reached)
323322
with pytest.raises(RuntimeError, match="source tree needs CUDA .* headers"):
324323
build_hooks._build_cuda_bindings()
325324

@@ -332,13 +331,16 @@ def test_split_toolkit_checks_first_available_cuda_header(self, tmp_path, monkey
332331
cuda_path = _write_cuda_h(header_root, build_hooks._generated_cuda_version())
333332
monkeypatch.setattr(build_hooks, "_get_cuda_paths", lambda: [str(library_root), cuda_path])
334333

335-
def stop_before_parsing(_required_headers, include_paths):
336-
assert include_paths == [str(library_root / "include"), str(header_root / "include")]
337-
raise RuntimeError("matching header accepted before parsing")
334+
checked_roots = []
338335

339-
monkeypatch.setattr(build_hooks, "_fetch_header_paths", stop_before_parsing)
340-
with pytest.raises(RuntimeError, match="matching header accepted before parsing"):
336+
def record_and_stop(cuda_path):
337+
checked_roots.append(cuda_path)
338+
raise RuntimeError("matching header accepted")
339+
340+
monkeypatch.setattr(build_hooks, "_check_cuda_headers", record_and_stop)
341+
with pytest.raises(RuntimeError, match="matching header accepted"):
341342
build_hooks._build_cuda_bindings()
343+
assert checked_roots == [cuda_path]
342344

343345
@pytest.mark.agent_authored(model="gpt-6")
344346
def test_split_toolkit_rejects_mismatched_header_before_later_matching_header(self, tmp_path, monkeypatch):
@@ -353,6 +355,6 @@ def test_split_toolkit_rejects_mismatched_header_before_later_matching_header(se
353355
def not_reached(*args):
354356
raise AssertionError("must reject the first header in compiler search order")
355357

356-
monkeypatch.setattr(build_hooks, "_fetch_header_paths", not_reached)
358+
monkeypatch.setattr(build_hooks, "_rename_architecture_specific_files", not_reached)
357359
with pytest.raises(RuntimeError, match="source tree needs CUDA .* headers"):
358360
build_hooks._build_cuda_bindings()

0 commit comments

Comments
 (0)