99New features
1010------------
1111
12- - Added :func: `utils.copy_batch `, which submits many buffer-to-buffer copies
13- in a single ``cuMemcpyBatchAsync `` call. Per-copy behavior is controlled
14- by the new :class: `utils.CopyOptions ` dataclass. Requires ``cuda.core ``
15- built against CUDA 13, ``cuda.bindings `` 13.0+, and a driver reporting
16- CUDA 13.0 or newer; otherwise falls back to a per-copy ``cuMemcpyAsync ``
17- loop. On that fallback, ``src_access_order `` values of ``STREAM `` and
18- ``ANY `` are silently ignored (stream-ordered access already satisfies
19- both), while ``DURING_API_CALL `` raises ``RuntimeError `` instead of
20- silently downgrading its stronger guarantee. Graph capture and
21- ``LEGACY_DEFAULT_STREAM `` are rejected (``PER_THREAD_DEFAULT_STREAM `` is
22- accepted). Copies within a batch must not alias.
23- (`#1333 <https://github.com/NVIDIA/cuda-python/issues/1333 >`__)
12+ - Added :class: `utils.CopyOptions ` (source access order, location hints,
13+ overlap mode) for buffer-to-buffer copies. The new
14+ :func: `utils.copy_batch ` accepts it and submits many copies in a single
15+ ``cuMemcpyBatchAsync `` call, requiring ``cuda.core `` built against CUDA 13
16+ plus ``cuda.bindings ``/driver 13.0 or newer. :meth: `Buffer.copy_to ` and
17+ :meth: `Buffer.copy_from ` also accept it now, as a new ``options `` keyword,
18+ submitting a single copy via ``cuMemcpyWithAttributesAsync `` and requiring
19+ ``cuda.bindings ``/driver 13.2 or newer. Both reject
20+ ``LEGACY_DEFAULT_STREAM `` with ``TypeError `` (``PER_THREAD_DEFAULT_STREAM ``
21+ is accepted); ``copy_batch `` always rejects graph capture, while
22+ ``Buffer.copy_to ``/``copy_from `` reject it only when ``options `` is given.
23+ On an older ``cuda.bindings ``/driver install, ``src_access_order `` values
24+ of ``STREAM `` and ``ANY `` silently fall back to plain ``cuMemcpyAsync ``;
25+ ``DURING_API_CALL `` raises ``RuntimeError `` instead, since that fallback
26+ cannot honor its guarantee that all source reads complete before the call
27+ returns. Copies within a ``copy_batch `` call must not alias.
28+ (`#1333 <https://github.com/NVIDIA/cuda-python/issues/1333 >`__,
29+ `#2365 <https://github.com/NVIDIA/cuda-python/issues/2365 >`__)
30+
2431- Added the ``programmatic_stream_serialization `` option to
2532 :class: `LaunchConfig `, which sets
2633 ``cudaLaunchAttributeProgrammaticStreamSerialization `` so a kernel can
@@ -30,17 +37,6 @@ New features
3037 (`#2456 <https://github.com/NVIDIA/cuda-python/pull/2456 >`__,
3138 `#1334 <https://github.com/NVIDIA/cuda-python/issues/1334 >`__)
3239
33- - :meth: `Buffer.copy_to ` and :meth: `Buffer.copy_from ` now accept an optional
34- ``options `` keyword argument (:class: `~utils.CopyOptions `), submitted via
35- ``cuMemcpyWithAttributesAsync ``. Matching :func: `utils.copy_batch `, passing
36- ``options `` together with ``LEGACY_DEFAULT_STREAM `` or a capturing stream
37- raises ``TypeError `` (``PER_THREAD_DEFAULT_STREAM `` is accepted). On
38- ``cuda.bindings ``/driver older than CUDA 13.2, ``src_access_order `` values
39- of ``STREAM `` and ``ANY `` fall back to ``cuMemcpyAsync `` silently, while
40- ``DURING_API_CALL `` raises ``RuntimeError `` instead of silently
41- downgrading its stronger guarantee.
42- (`#2365 <https://github.com/NVIDIA/cuda-python/issues/2365 >`__)
43-
4440Fixes and enhancements
4541----------------------
4642
0 commit comments