MCPcopy Create free account
hub / github.com/apache/arrow / other_process_for_test_IPC

Function other_process_for_test_IPC

python/pyarrow/tests/test_cuda.py:801–809  ·  view source on GitHub ↗
(handle_buffer, expected_arr)

Source from the content-addressed store, hash-verified

799
800
801def other_process_for_test_IPC(handle_buffer, expected_arr):
802 other_context = pa.cuda.Context(0)
803 ipc_handle = pa.cuda.IpcMemHandle.from_buffer(handle_buffer)
804 ipc_buf = other_context.open_ipc_buffer(ipc_handle)
805 ipc_buf.context.synchronize()
806 buf = ipc_buf.copy_to_host()
807 assert buf.size == expected_arr.size, repr((buf.size, expected_arr.size))
808 arr = np.frombuffer(buf, dtype=expected_arr.dtype)
809 np.testing.assert_equal(arr, expected_arr)
810
811
812@cuda_ipc

Callers

nothing calls this directly

Calls 1

from_bufferMethod · 0.45

Tested by

no test coverage detected