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:809–817  ·  view source on GitHub ↗
(handle_buffer, expected_arr)

Source from the content-addressed store, hash-verified

807
808
809def other_process_for_test_IPC(handle_buffer, expected_arr):
810 other_context = pa.cuda.Context(0)
811 ipc_handle = pa.cuda.IpcMemHandle.from_buffer(handle_buffer)
812 ipc_buf = other_context.open_ipc_buffer(ipc_handle)
813 ipc_buf.context.synchronize()
814 buf = ipc_buf.copy_to_host()
815 assert buf.size == expected_arr.size, repr((buf.size, expected_arr.size))
816 arr = np.frombuffer(buf, dtype=expected_arr.dtype)
817 np.testing.assert_equal(arr, expected_arr)
818
819
820@cuda_ipc

Callers

nothing calls this directly

Calls 1

from_bufferMethod · 0.45

Tested by

no test coverage detected