Skip to content

Commit

Permalink
add test for copy buffer in test_io.py
Browse files Browse the repository at this point in the history
  • Loading branch information
anjakefala committed Aug 7, 2024
1 parent 3927fe7 commit 76c53ca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/pyarrow/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,13 @@ def test_non_cpu_buffer(pickle_module):
# Sliced buffers with same address
assert buf_on_gpu_sliced.equals(cuda_buf[2:4])

# Testing copying buffer
mm = ctx.memory_manager
buf2 = cuda_buf.copy(mm)
cuda_buf2 = cuda.CudaBuffer.from_buffer(buf2)
cuda_buf2.size == cuda_buf.size
cuda_buf2.copy_to_host()[:] == b'testing'

# Buffers on different devices
msg_device = "Device on which the data resides differs between buffers"
with pytest.raises(ValueError, match=msg_device):
Expand Down

0 comments on commit 76c53ca

Please sign in to comment.