NVIDIA / NVIDIA/cudf

[FEA] Add overload of cudf::slice that accepts host_span<pair<size_type, size_type>>

Open
#11,223 3 comments 0 reactions 0 assignees View on GitHub
0 - Backlog feature request libcudf
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
Currently building up a list of selected indices for a slice requires doing something like:
```
std::vector selected_ranges;
....
selected_ranges.push_back(slice_start);
selected_ranges.push_back(cur_row);
...
auto slices = cudf::slice(table_v, selected_ranges);
```

The problem is I need to use the selected ranges for other purposes.
Specifically I have several related tensors that I want to slice the same rows from,
which requires me to do something like:
```
// todo assert ranges.size() is even
for (std::size_t i=0; i < ranges.size()-1; i += 2)
{
start = ranges[i];
end = ranges[i+1];
}
```

**Describe the solution you'd like**
It would be nice to instead be able to do something like:
```
std::vector> selected_ranges;
selected_ranges.push_back(std::make_pair(slice_start, cur_row));
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.