1919 assert_managed_holds ,
2020)
2121
22- from cuda .core import Device , Host , LegacyPinnedMemoryResource
22+ from cuda .core import Host , LegacyPinnedMemoryResource
2323from cuda .core ._memory ._copy_enums import _attr_run_starts
24- from cuda .core ._memory ._copy_ops import (
25- _batch_entry_point_in_use as cu_memcpy_batch_available ,
26- )
2724from cuda .core ._memory ._copy_ops import (
2825 _normalize_copy_options ,
2926)
@@ -110,7 +107,7 @@ class TestCopyBatchOptions:
110107 (MemcpySrcAccessOrder .ANY , 33 ),
111108 ],
112109 )
113- def test_src_access_order (self , requires_copy_options , h2d_bufs , copy_stream , order , marker ):
110+ def test_src_access_order (self , h2d_bufs , copy_stream , order , marker ):
114111 srcs , dsts = h2d_bufs
115112 for i , src in enumerate (srcs ):
116113 set_buffer (src , i + marker )
@@ -122,7 +119,7 @@ def test_src_access_order(self, requires_copy_options, h2d_bufs, copy_stream, or
122119 assert compare_buffer_to_constant (dst , i + marker )
123120
124121 @pytest .mark .agent_authored (model = "Claude Opus 5" )
125- def test_per_copy_options (self , requires_copy_options , h2d_bufs , copy_stream ):
122+ def test_per_copy_options (self , h2d_bufs , copy_stream ):
126123 srcs , dsts = h2d_bufs
127124 for i , src in enumerate (srcs ):
128125 set_buffer (src , i + 40 )
@@ -142,7 +139,7 @@ def test_per_copy_options(self, requires_copy_options, h2d_bufs, copy_stream):
142139 assert compare_buffer_to_constant (dst , i + 40 )
143140
144141 @pytest .mark .agent_authored (model = "Claude Opus 5" )
145- def test_location_hints_do_not_corrupt_copy (self , requires_copy_options , copy_batch_device , copy_stream ):
142+ def test_location_hints_do_not_corrupt_copy (self , copy_batch_device , copy_stream ):
146143 """Device and host hints are accepted and leave the bytes intact.
147144
148145 Hints only steer how the driver stages a transfer, so no data
@@ -176,13 +173,8 @@ def test_location_hints_do_not_corrupt_copy(self, requires_copy_options, copy_ba
176173 mr .close ()
177174
178175 @pytest .mark .agent_authored (model = "Claude Sonnet 4.6" )
179- def test_host_numa_location_hint (self , requires_copy_options , copy_batch_device , copy_stream ):
180- """A NUMA-specific host hint is accepted and does not corrupt the copy.
181-
182- ``requires_copy_options`` already implies CUDA 13, where
183- ``Host(numa_id=...)`` is representable; the CUDA 12 rejection is
184- covered by ``_coerce_location``'s own tests.
185- """
176+ def test_host_numa_location_hint (self , copy_batch_device , copy_stream ):
177+ """A NUMA-specific host hint is accepted and does not corrupt the copy."""
186178 dev = copy_batch_device
187179 numa_id = dev .properties .host_numa_id
188180 if numa_id < 0 :
@@ -204,7 +196,7 @@ def test_host_numa_location_hint(self, requires_copy_options, copy_batch_device,
204196 mr .close ()
205197
206198 @pytest .mark .agent_authored (model = "Claude Sonnet 4.6" )
207- def test_host_numa_current_location_hint (self , requires_copy_options , copy_batch_device , copy_stream ):
199+ def test_host_numa_current_location_hint (self , copy_batch_device , copy_stream ):
208200 """Host.numa_current() as a location hint is accepted and does not corrupt the copy."""
209201 dev = copy_batch_device
210202 if dev .properties .host_numa_id < 0 :
@@ -226,7 +218,7 @@ def test_host_numa_current_location_hint(self, requires_copy_options, copy_batch
226218 mr .close ()
227219
228220 @pytest .mark .agent_authored (model = "Claude Opus 5" )
229- def test_overlap_mode_copies_correctly (self , requires_copy_options , h2d_bufs , copy_stream ):
221+ def test_overlap_mode_copies_correctly (self , h2d_bufs , copy_stream ):
230222 """The overlap hint is advisory and must not change the bytes copied."""
231223 srcs , dsts = h2d_bufs
232224 for i , src in enumerate (srcs ):
@@ -357,40 +349,3 @@ def test_rejects_bad_options_element(self, h2d_bufs, copy_stream):
357349
358350 with pytest .raises (TypeError , match = "each options element must be CopyOptions" ):
359351 copy_batch (copy_stream , srcs , dsts , options = bad )
360-
361-
362- class TestPerCopyFallback :
363- """Behaviour where ``cuMemcpyBatchAsync`` is unavailable.
364-
365- Reached whenever any of the three requirements for
366- ``cuMemcpyBatchAsync`` is unmet: ``cuda.core`` built against CUDA 13,
367- ``cuda.bindings`` 13.0+, and a driver reporting CUDA 13.0 or newer.
368- Skipped when the batched entry point is actually in use.
369- """
370-
371- @pytest .fixture (autouse = True )
372- def _skip_if_batched (self ):
373- if cu_memcpy_batch_available ():
374- pytest .skip ("cuMemcpyBatchAsync is in use; fallback path not exercised" )
375-
376- @pytest .mark .agent_authored (model = "Claude Opus 5" )
377- def test_default_options_still_copy (self , init_cuda ):
378- device = Device ()
379- device .set_current ()
380- stream = device .create_stream ()
381- pinned_mr = LegacyPinnedMemoryResource ()
382- srcs = [pinned_mr .allocate (COPY_BATCH_SIZE ) for _ in range (3 )]
383- dsts = [device .memory_resource .allocate (COPY_BATCH_SIZE , stream = stream ) for _ in srcs ]
384- for i , src in enumerate (srcs ):
385- set_buffer (src , i + 5 )
386-
387- copy_batch (stream , srcs , dsts )
388- stream .sync ()
389-
390- for i , dst in enumerate (dsts ):
391- assert compare_buffer_to_constant (dst , i + 5 )
392-
393- for buf in srcs + dsts :
394- buf .close (stream )
395- stream .sync ()
396- stream .close ()
0 commit comments