文件 | |
文件 | copying.hpp |
用于收集、分散、分割、切片等的列API。 | |
函数 | |
std::unique_ptr< table > | cudf::gather (table_view const &source_table, column_view const &gather_map, out_of_bounds_policy bounds_policy=out_of_bounds_policy::DONT_CHECK, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) |
收集指定行的列(包括空值)。 更多... | |
std::unique_ptr<table> cudf::gather | ( | table_view const & | source_table, |
column_view const & | gather_map, | ||
out_of_bounds_policy | bounds_policy = out_of_bounds_policy::DONT_CHECK , |
||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
收集指定行的列(包括空值)。
根据 gather_map
收集源列中的行,使得结果表中列的第“i”行包含源列中的第“gather_map[i]”行。结果表中的行数将等于 gather_map
中的元素数量。
gather_map
中的负值 i
被解释为 i+n
,其中 n
是 source_table
中的行数。
对于字典列,如果收集操作导致废弃的键元素,则复制键列组件而不进行修剪。
std::invalid_argument | 如果 gather_map 包含空值。 |
source_table | 将被收集行的输入列 |
gather_map | 指向一个非空整数索引列的视图,该列将源列中的行映射到目标列中的行。 |
bounds_policy | 用于处理可能的越界索引的策略。DONT_CHECK 跳过对 gather map 值的所有边界检查。NULLIFY 将 gather map 中对应于越界索引的行强制转换为 null 元素。当调用者确定 gather_map 只包含有效索引时,应使用 DONT_CHECK 以获得更好的性能。如果策略设置为 DONT_CHECK 并且 gather map 中存在越界索引,则行为是未定义的。默认为 DONT_CHECK 。 |
stream | 用于设备内存操作和内核启动的 CUDA 流 |
mr | 用于分配返回表的设备内存的设备内存资源 |