kkraus14 commented on code in PR #42221:
URL: https://github.com/apache/arrow/pull/42221#discussion_r1700497643


##########
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:
   I'm not sure on the answer to what the device should be, but one thing I 
would point out is that CUDA pinned host memory (what `CUDA_HOST` buffer is), 
follows CUDA stream ordering semantics, so you'll run the risk of running into 
situations where if you just try to access it as normal CPU memory that you get 
a race condition.



-- 
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]

Reply via email to