Copy Slice#
- group Slicing
Functions
-
std::vector<column_view> slice(column_view const &input, host_span<size_type const> indices, rmm::cuda_stream_view stream = cudf::get_default_stream())#
Slices a
column_viewinto a set ofcolumn_views according to a set of indices.The returned views of
inputare constructed from an even number indices where theith returnedcolumn_viewviews the elements ininputindicated by the range[indices[2*i], indices[(2*i)+1]).For all
iit is expectedindices[i] <= input.size()For alli%2==0, it is expected thatindices[i] <= indices[i+1]input: {10, 12, 14, 16, 18, 20, 22, 24, 26, 28} indices: {1, 3, 5, 9, 2, 4, 8, 8} output: {{12, 14}, {20, 22, 24, 26}, {14, 16}, {}}Note
It is the caller’s responsibility to ensure that the returned views do not outlive the viewed device memory.
- Throws:
std::invalid_argument – if
indicessize is not even.std::invalid_argument – When the values in the pair are strictly decreasing.
std::out_of_range – When any of the values in the pair don’t belong to the range [0, input.size()).
- Parameters:
input – View of column to slice
indices – Indices used to take slices of
inputstream – CUDA stream used for device memory operations and kernel launches
- Returns:
Vector of views of
inputindicated by the ranges inindices
-
std::vector<column_view> slice(column_view const &input, std::initializer_list<size_type> indices, rmm::cuda_stream_view stream = cudf::get_default_stream())#
Slices a
column_viewinto a set ofcolumn_views according to a set of indices.The returned views of
inputare constructed from an even number indices where theith returnedcolumn_viewviews the elements ininputindicated by the range[indices[2*i], indices[(2*i)+1]).For all
iit is expectedindices[i] <= input.size()For alli%2==0, it is expected thatindices[i] <= indices[i+1]input: {10, 12, 14, 16, 18, 20, 22, 24, 26, 28} indices: {1, 3, 5, 9, 2, 4, 8, 8} output: {{12, 14}, {20, 22, 24, 26}, {14, 16}, {}}Note
It is the caller’s responsibility to ensure that the returned views do not outlive the viewed device memory.
- Throws:
std::invalid_argument – if
indicessize is not even.std::invalid_argument – When the values in the pair are strictly decreasing.
std::out_of_range – When any of the values in the pair don’t belong to the range [0, input.size()).
- Parameters:
input – View of column to slice
indices – Indices used to take slices of
inputstream – CUDA stream used for device memory operations and kernel launches
- Returns:
Vector of views of
inputindicated by the ranges inindices
-
std::vector<table_view> slice(table_view const &input, host_span<size_type const> indices, rmm::cuda_stream_view stream = cudf::get_default_stream())#
Slices a
table_viewinto a set oftable_views according to a set of indices.The returned views of
inputare constructed from an even number indices where theith returnedtable_viewviews the elements ininputindicated by the range[indices[2*i], indices[(2*i)+1]).For all
iit is expectedindices[i] <= input.size()For alli%2==0, it is expected thatindices[i] <= indices[i+1]input: [{10, 12, 14, 16, 18, 20, 22, 24, 26, 28}, {50, 52, 54, 56, 58, 60, 62, 64, 66, 68}] indices: {1, 3, 5, 9, 2, 4, 8, 8} output: [{{12, 14}, {20, 22, 24, 26}, {14, 16}, {}}, {{52, 54}, {60, 22, 24, 26}, {14, 16}, {}}]Note
It is the caller’s responsibility to ensure that the returned views do not outlive the viewed device memory.
- Throws:
std::invalid_argument – if
indicessize is not even.std::invalid_argument – When the values in the pair are strictly decreasing.
std::out_of_range – When any of the values in the pair don’t belong to the range [0, input.size()).
- Parameters:
input – View of table to slice
indices – Indices used to take slices of
inputstream – CUDA stream used for device memory operations and kernel launches
- Returns:
Vector of views of
inputindicated by the ranges inindices
-
std::vector<table_view> slice(table_view const &input, std::initializer_list<size_type> indices, rmm::cuda_stream_view stream = cudf::get_default_stream())#
Slices a
table_viewinto a set oftable_views according to a set of indices.The returned views of
inputare constructed from an even number indices where theith returnedtable_viewviews the elements ininputindicated by the range[indices[2*i], indices[(2*i)+1]).For all
iit is expectedindices[i] <= input.size()For alli%2==0, it is expected thatindices[i] <= indices[i+1]input: [{10, 12, 14, 16, 18, 20, 22, 24, 26, 28}, {50, 52, 54, 56, 58, 60, 62, 64, 66, 68}] indices: {1, 3, 5, 9, 2, 4, 8, 8} output: [{{12, 14}, {20, 22, 24, 26}, {14, 16}, {}}, {{52, 54}, {60, 22, 24, 26}, {14, 16}, {}}]Note
It is the caller’s responsibility to ensure that the returned views do not outlive the viewed device memory.
- Throws:
std::invalid_argument – if
indicessize is not even.std::invalid_argument – When the values in the pair are strictly decreasing.
std::out_of_range – When any of the values in the pair don’t belong to the range [0, input.size()).
- Parameters:
input – View of table to slice
indices – Indices used to take slices of
inputstream – CUDA stream used for device memory operations and kernel launches
- Returns:
Vector of views of
inputindicated by the ranges inindices
-
std::vector<column_view> slice(column_view const &input, host_span<size_type const> indices, rmm::cuda_stream_view stream = cudf::get_default_stream())#