()
| 749 | |
| 750 | |
| 751 | def make_table_cuda(): |
| 752 | htable = make_table() |
| 753 | # Serialize the host table to bytes |
| 754 | sink = pa.BufferOutputStream() |
| 755 | with pa.ipc.new_stream(sink, htable.schema) as out: |
| 756 | out.write_table(htable) |
| 757 | hbuf = pa.py_buffer(sink.getvalue().to_pybytes()) |
| 758 | |
| 759 | # Copy the host bytes to a device buffer |
| 760 | dbuf = global_context.new_buffer(len(hbuf)) |
| 761 | dbuf.copy_from_host(hbuf, nbytes=len(hbuf)) |
| 762 | # Deserialize the device buffer into a Table |
| 763 | dtable = pa.ipc.open_stream(cuda.BufferReader(dbuf)).read_all() |
| 764 | return hbuf, htable, dbuf, dtable |
| 765 | |
| 766 | |
| 767 | def test_table_deserialize(): |
no test coverage detected