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

Function make_table_cuda

python/pyarrow/tests/test_cuda.py:759–772  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

757
758
759def 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
775def test_table_deserialize():

Callers 3

test_table_deserializeFunction · 0.85
test_print_tableFunction · 0.85

Calls 5

make_tableFunction · 0.85
lenFunction · 0.85
BufferOutputStreamMethod · 0.80
BufferReaderMethod · 0.80
write_tableMethod · 0.45

Tested by

no test coverage detected