Files | Functions
Concatenating

Files

file  concatenate.hpp
 Concatenate columns APIs.
 

Functions

rmm::device_buffer cudf::concatenate_masks (host_span< column_view const > views, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Concatenates views[i]'s bitmask from the bits [views[i].offset(), views[i].offset() + views[i].size()) for all elements views[i] in views into a device_buffer More...
 
std::unique_ptr< columncudf::concatenate (host_span< column_view const > columns_to_concat, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Concatenates multiple columns into a single column. More...
 
std::unique_ptr< tablecudf::concatenate (host_span< table_view const > tables_to_concat, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Columns of tables_to_concat are concatenated vertically to return a single table_view. More...
 

Detailed Description

Function Documentation

◆ concatenate() [1/2]

std::unique_ptr<column> cudf::concatenate ( host_span< column_view const >  columns_to_concat,
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Concatenates multiple columns into a single column.

Exceptions
cudf::logic_errorIf types of the input columns mismatch
Parameters
columns_to_concathost_span of column views to be concatenated into a single column
mrDevice memory resource used to allocate the returned column's device memory.
Returns
Unique pointer to a single table having all the rows from the elements of columns_to_concat respectively in the same order.

◆ concatenate() [2/2]

std::unique_ptr<table> cudf::concatenate ( host_span< table_view const >  tables_to_concat,
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Columns of tables_to_concat are concatenated vertically to return a single table_view.

example:

column_view c0; //Contains {0,1,2,3}
column_view c1; //Contains {4,5,6,7}
table_view t0{{c0, c0}};
table_view t1{{c1, c1}};
...
auto t = concatenate({t0.view(), t1.view()});
column_view tc0 = (t->view()).column(0); //Contains {0,1,2,3,4,5,6,7}
column_view tc1 = (t->view()).column(1); //Contains {0,1,2,3,4,5,6,7}
Exceptions
cudf::logic_errorIf number of columns mismatch
Parameters
tables_to_concathost_span of table views to be concatenated into a single table
mrDevice memory resource used to allocate the returned table's device memory.
Returns
Unique pointer to a single table having all the rows from the elements of tables_to_concat respectively in the same order.

◆ concatenate_masks()

Concatenates views[i]'s bitmask from the bits [views[i].offset(), views[i].offset() + views[i].size()) for all elements views[i] in views into a device_buffer

Returns empty device_buffer if the column is not nullable

Parameters
viewshost_span of column views whose bitmask will to be concatenated
mrDevice memory resource used for allocating the new device_buffer
Returns
rmm::device_buffer A device_buffer containing the bitmasks of all the column views in the views vector
cudf::concatenate
std::unique_ptr< column > concatenate(host_span< column_view const > columns_to_concat, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Concatenates multiple columns into a single column.