jorisvandenbossche commented on code in PR #42221:
URL: https://github.com/apache/arrow/pull/42221#discussion_r1701477289
##########
python/pyarrow/tests/test_cuda.py:
##########
@@ -534,6 +534,25 @@ def put(*args, **kwargs):
put(position=position, nbytes=nbytes)
+def test_buffer_device():
+ buf = cuda.new_host_buffer(10)
+ assert buf.device_type == pa.DeviceAllocationType.CUDA_HOST
+ assert isinstance(buf.device, pa.Device)
+ assert isinstance(buf.memory_manager, pa.MemoryManager)
+ assert buf.is_cpu
+ assert buf.device.is_cpu
+ assert buf.device == pa.default_cpu_memory_manager().device
Review Comment:
Isn't that then a problem/risk in general in the Arrow C++ library design?
The `CudaHostBuffer` is a shallow subclass of the main `Buffer` (actually
`MutableBuffer`) with `is_cpu_` set to True (and essentially only overrides the
destructor to call `cuMemFreeHost`).
So when such a CudaHostBuffer object is used with the rest of the Arrow C++
library, it will just be seen as a plain CPU Buffer AFAIU, without any special
precaution.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]