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:791–806  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

789
790
791def test_create_table_with_device_buffers():
792 # ARROW-11872: make sure that we can create an Arrow Table from
793 # GPU-located Arrays without crashing.
794 hbuf, htable, dbuf, dtable = make_table_cuda()
795 # Construct a new Table from the device Table
796 dtable2 = pa.Table.from_arrays(dtable.columns, dtable.column_names)
797 # Assert basic fields the same between host and device tables
798 assert htable.schema == dtable2.schema
799 assert htable.num_rows == dtable2.num_rows
800 assert htable.num_columns == dtable2.num_columns
801 # Assert byte-level equality
802 assert hbuf.equals(dbuf.copy_to_host())
803 # Copy DtoH and assert the tables are still equivalent
804 assert htable.equals(pa.ipc.open_stream(
805 dbuf.copy_to_host()
806 ).read_all())
807
808
809def 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