Skip to content

Commit cf57d57

Browse files
committed
Test owner and mr cannot be specified together
Signed-off-by: Kamil Tokarski <[email protected]>
1 parent af2d901 commit cf57d57

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cuda_core/tests/test_memory.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,13 @@ def test_buffer_external_managed(change_device):
353353
handle_return(driver.cuMemFree(ptr))
354354

355355

356+
def test_memory_resource_and_owner_disallowed():
357+
with pytest.raises(ValueError, match="cannot be both specified together"):
358+
a = (ctypes.c_byte * 20)()
359+
ptr = ctypes.addressof(a)
360+
Buffer.from_handle(ptr, 20, mr=DummyDeviceMemoryResource(Device()), owner=a)
361+
362+
356363
def test_buffer_dunder_dlpack():
357364
device = Device()
358365
device.set_current()

0 commit comments

Comments
 (0)