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