AlenkaF commented on code in PR #41889:
URL: https://github.com/apache/arrow/pull/41889#discussion_r1636718079


##########
python/pyarrow/tests/test_cuda.py:
##########
@@ -313,7 +313,8 @@ def test_CudaBuffer(size):
         assert cbuf[s].to_pybytes() == arr[s].tobytes()
 
     sbuf = cbuf.slice(size//4, size//2)
-    assert sbuf.parent == cbuf
+    cbuf_parent = cuda.CudaBuffer.from_buffer(sbuf.parent)
+    assert cbuf_parent.to_pybytes() == cbuf.to_pybytes()

Review Comment:
   Looking at `Buffer::Equals`, as you suggested, I understand the behaviour I 
described in the last comment of this thread. If the addresses of both buffers 
are equal then `Equals` is true even if they live on GPU. But if the address is 
different the method uses `memcmp` which will fail for data that is not on CPU.
   
   I added a different check for equals method that checks addresses of buffers 
that do not live on cpu and raises an error only if they are not the same: 
https://github.com/apache/arrow/pull/41889/commits/1268c1be2bb863ff300e70e5fbd73047e4e9da5c.



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