(handle_buffer, expected_arr)
| 807 | |
| 808 | |
| 809 | def 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 |
nothing calls this directly
no test coverage detected