-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEA] Construct column_view
from rmm::device_uvector
and device_span
#9656
Comments
Tag @jrhemstad and @davidwendt as this idea is from you guys and it's great if you can work on it 😄 |
There's no need for a type dispatch here because you already know the type from the |
Make sure you really need this. If you doing this for calling cudf/cpp/include/cudf/detail/gather.hpp Lines 78 to 84 in ba2b51d
device_uvector to a device_span .
Example: Lines 162 to 175 in ba2b51d
|
I think there are plenty of other places where people are constructing a |
This issue has been labeled |
This PR adds an implicit conversion operator from `column_view` to `device_span<T const>`. The immediate purpose of this PR is to make it possible to use the API `segmented_reduce(column_view data, device_span<size_type> offsets, ...)` in PR #9621. This PR also resolves #9656 by adding a `column_view` constructor from `device_span<T const>`. More broadly, this PR should make it easier to refactor instances where `column.data()` is used with counting iterators to build transform iterators, or other patterns that require a length (e.g. vector factories to copy to host). Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Mark Harris (https://github.com/harrism) - Jake Hemstad (https://github.com/jrhemstad) - David Wendt (https://github.com/davidwendt) URL: #10302
Sometimes, we need to call some API that only accepts
column_view
input but we only have data stored inrmm::device_uvector
(which can implicitly casted intodevice_span
). As a result, we need to construct acolumn_view
fromrmm::device_uvector
manually like this, in many places:This is lengthy and error-prone.
A better solution is to add a utility API to do that automatically. Internally, that utility may call
type_dispatcher
to construct the outputcolumn_view
depending on the input type.The text was updated successfully, but these errors were encountered: