contiguous_split#
- class pylibcudf.contiguous_split.PackedColumns#
Column data in a serialized format.
Contains data from an array of columns in two contiguous buffers: one on host, which contains table metadata and one on device which contains the table data.
For details, see
cudf::packed_columns
.Methods
release
(self)Releases and returns the underlying serialized metadata and gpu data.
- release(self) tuple #
Releases and returns the underlying serialized metadata and gpu data.
The ownership of the memory are transferred to the returned buffers. After this call, self is empty.
- Returns:
- memoryview (of a HostBuffer)
The serialized metadata as contiguous host memory.
- gpumemoryview (of a rmm.DeviceBuffer)
The serialized gpu data as contiguous device memory.
- pylibcudf.contiguous_split.pack(Table input) PackedColumns #
Deep-copy a table into a serialized contiguous memory format.
Later use unpack or unpack_from_memoryviews to unpack the serialized data back into the table.
- Parameters:
- inputTable
Table to pack.
- Returns:
- PackedColumns
The packed columns.
Examples
>>> packed = pylibcudf.contiguous_split.pack(...) >>> # Either unpack the whole `PackedColumns` at once. >>> pylibcudf.contiguous_split.unpack(packed) >>> # Or unpack the two serialized buffers in `PackedColumns`. >>> metadata, gpu_data = packed.release() >>> pylibcudf.contiguous_split.unpack_from_memoryviews(metadata, gpu_data)
For details, see
cudf::pack()
.
- pylibcudf.contiguous_split.unpack(PackedColumns input) Table #
Deserialize the result of pack.
Copies the result of a serialized table into a table. Contrary to the libcudf C++ function, the returned table is a copy of the serialized data.
For details, see
cudf::unpack()
.- Parameters:
- inputPackedColumns
The packed columns to unpack.
- Returns:
- Table
Copy of the packed columns.
- pylibcudf.contiguous_split.unpack_from_memoryviews(memoryview metadata, gpumemoryview gpu_data) Table #
Deserialize the result of pack.
Copies the result of a serialized table into a table. Contrary to the libcudf C++ function, the returned table is a copy of the serialized data.
For details, see
cudf::unpack()
.- Parameters:
- metadatamemoryview
The packed metadata to unpack.
- gpu_datagpumemoryview
The packed gpu_data to unpack.
- Returns:
- Table
Copy of the packed columns.