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

Function make_table_cuda

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

Source from the content-addressed store, hash-verified

749
750
751def 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
767def 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