Public Member Functions | List of all members
cudf::interop::arrow_table Class Reference

A standard interchange medium for ArrowDeviceArray data in cudf. More...

#include <interop.hpp>

Public Member Functions

 arrow_table (cudf::table &&input, cudf::host_span< column_metadata const > metadata, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
 Construct a new arrow table object. More...
 
 arrow_table (ArrowSchema &&schema, ArrowDeviceArray &&input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
 Construct a new arrow table object. More...
 
 arrow_table (ArrowSchema &&schema, ArrowArray &&input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
 Construct a new arrow table object. More...
 
 arrow_table (ArrowArrayStream &&input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
 Construct a new arrow table object. More...
 
void to_arrow_schema (ArrowSchema *output, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) const
 Convert the table to an ArrowSchema. More...
 
void to_arrow (ArrowDeviceArray *output, ArrowDeviceType device_type=ARROW_DEVICE_CUDA, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) const
 Convert the table to an ArrowDeviceArray. More...
 
table_view view () const
 Get a view of the table data. More...
 

Detailed Description

A standard interchange medium for ArrowDeviceArray data in cudf.

This class provides a way to work with ArrowDeviceArray data in cudf without sacrificing the APIs expected of a cudf table. On the other end, it provides the shared lifetime management expected by arrow consumers rather than the single-owner mechanism of cudf::table.

Definition at line 337 of file interop.hpp.

Constructor & Destructor Documentation

◆ arrow_table() [1/4]

cudf::interop::arrow_table::arrow_table ( cudf::table &&  input,
cudf::host_span< column_metadata const >  metadata,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = cudf::get_current_device_resource_ref() 
)

Construct a new arrow table object.

The input table will be moved into the arrow_table, so it is no longer suitable for use afterwards.

Parameters
inputcudf table to convert to arrow
metadataThe hierarchy of names of columns and children
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource used for any allocations during conversion

◆ arrow_table() [2/4]

cudf::interop::arrow_table::arrow_table ( ArrowSchema &&  schema,
ArrowDeviceArray &&  input,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = cudf::get_current_device_resource_ref() 
)

Construct a new arrow table object.

The input array will be moved into the arrow_table, so it is no longer suitable for use afterwards. For consistency, this is done even if the source array points to host data.

Parameters
schemaArrow schema for the table
inputArrowDeviceArray data for the table
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource used for any allocations during conversion

◆ arrow_table() [3/4]

cudf::interop::arrow_table::arrow_table ( ArrowSchema &&  schema,
ArrowArray &&  input,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = cudf::get_current_device_resource_ref() 
)

Construct a new arrow table object.

The input array will be released, so it is no longer suitable for use afterwards. This is done for consistency with other constructors of arrow_table even though the source data is always host data.

Parameters
schemaArrow schema for the table
inputArrowArray data for the table
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource used for any allocations during conversion

◆ arrow_table() [4/4]

cudf::interop::arrow_table::arrow_table ( ArrowArrayStream &&  input,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = cudf::get_current_device_resource_ref() 
)

Construct a new arrow table object.

The stream will be released after the table is created, so it is no longer suitable for use afterwards. This is done for consistency with other constructors of arrow_table even though the source data is always host data.

Parameters
inputArrowArrayStream data for the table
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource used for any allocations during conversion

Member Function Documentation

◆ to_arrow()

void cudf::interop::arrow_table::to_arrow ( ArrowDeviceArray *  output,
ArrowDeviceType  device_type = ARROW_DEVICE_CUDA,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = cudf::get_current_device_resource_ref() 
) const

Convert the table to an ArrowDeviceArray.

Parameters
outputArrowDeviceArray to populate with the table's data
device_typeArrowDeviceType to set on the output
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource used for any allocations during conversion

◆ to_arrow_schema()

void cudf::interop::arrow_table::to_arrow_schema ( ArrowSchema *  output,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = cudf::get_current_device_resource_ref() 
) const

Convert the table to an ArrowSchema.

The resulting schema is a deep copy of the arrow_column's schema and is not tied to its lifetime.

Parameters
outputArrowSchema to populate with the table's schema
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource used for any allocations during conversion

◆ view()

table_view cudf::interop::arrow_table::view ( ) const

Get a view of the table data.

Parameters
streamCUDA stream used for device memory operations and kernel launches
mrDevice memory resource used for any allocations during conversion
Returns
unique_table_view_t containing a view of the table data

The documentation for this class was generated from the following file: