Skip to content

Commit

Permalink
Antoine review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anjakefala committed Sep 19, 2024
1 parent f7ff682 commit 9319543
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion python/pyarrow/io.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,8 @@ cdef class Buffer(_Weakrefable):
f"pyarrow.MemoryManager, got {type(destination)})"
)

c_buffer = GetResultValue(CBuffer.Copy(self.buffer, c_memory_manager))
with nogil:
c_buffer = GetResultValue(CBuffer.Copy(self.buffer, c_memory_manager))
return pyarrow_wrap_buffer(c_buffer)

@property
Expand Down
1 change: 1 addition & 0 deletions python/pyarrow/tests/test_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def test_copy_from_buffer():
for dest in [mm2, mm2.device]:
buf2 = cudabuf.copy(dest)
assert buf2.device_type == pa.DeviceAllocationType.CUDA
assert buf2.copy(pa.default_cpu_memory_manager()).equals(buf)
cudabuf2 = cuda.CudaBuffer.from_buffer(buf2)
assert cudabuf2.size == cudabuf.size
assert not cudabuf2.is_cpu
Expand Down
4 changes: 2 additions & 2 deletions python/pyarrow/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,8 @@ def test_non_cpu_buffer(pickle_module):
for dest in [mm, mm.device]:
buf2 = cuda_buf.copy(dest)
cuda_buf2 = cuda.CudaBuffer.from_buffer(buf2)
cuda_buf2.size == cuda_buf.size
cuda_buf2.copy_to_host()[:] == b'testing'
assert cuda_buf2.size == cuda_buf.size
assert cuda_buf2.copy_to_host()[:] == b'testing'
assert cuda_buf2.device == mm.device

# Buffers on different devices
Expand Down

0 comments on commit 9319543

Please sign in to comment.