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

Function test_create_table_with_device_buffers

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

Source from the content-addressed store, hash-verified

781
782
783def test_create_table_with_device_buffers():
784 # ARROW-11872: make sure that we can create an Arrow Table from
785 # GPU-located Arrays without crashing.
786 hbuf, htable, dbuf, dtable = make_table_cuda()
787 # Construct a new Table from the device Table
788 dtable2 = pa.Table.from_arrays(dtable.columns, dtable.column_names)
789 # Assert basic fields the same between host and device tables
790 assert htable.schema == dtable2.schema
791 assert htable.num_rows == dtable2.num_rows
792 assert htable.num_columns == dtable2.num_columns
793 # Assert byte-level equality
794 assert hbuf.equals(dbuf.copy_to_host())
795 # Copy DtoH and assert the tables are still equivalent
796 assert htable.equals(pa.ipc.open_stream(
797 dbuf.copy_to_host()
798 ).read_all())
799
800
801def other_process_for_test_IPC(handle_buffer, expected_arr):

Callers

nothing calls this directly

Calls 2

make_table_cudaFunction · 0.85
equalsMethod · 0.80

Tested by

no test coverage detected