Skip to content

[FEA] Construct column_view from rmm::device_uvector and device_span #9656

Closed

Description

@ttnghia

Sometimes, we need to call some API that only accepts column_view input but we only have data stored in rmm::device_uvector (which can implicitly casted into device_span). As a result, we need to construct a column_view from rmm::device_uvector manually like this, in many places:

 auto gather_map = column_view(
      cudf::data_type{cudf::type_to_id<cudf::size_type>()}, output_size, indices.data());

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 output column_view depending on the input type.

Activity

  1. added
    feature request
    libcudf
    improvement
    non-breaking
    on Nov 10, 2021
  2. ttnghia commented on Nov 10, 2021

    @ttnghia
    ContributorAuthor

    Tag @jrhemstad and @davidwendt as this idea is from you guys and it's great if you can work on it 😄

  3. jrhemstad commented on Nov 10, 2021

    @jrhemstad
    Contributor

    A better solution is to add a utility API to do that automatically. Internally, that utility may call type_dispatcher to construct the output column_view depending on the input type.

    There's no need for a type dispatch here because you already know the type from the device_span.

  4. davidwendt commented on Nov 11, 2021

    @davidwendt
    Contributor
  5. jrhemstad commented on Nov 11, 2021

    @jrhemstad
    Contributor

    I think there are plenty of other places where people are constructing a column or column_view from a device_uvector that make this an important and useful thing.

  6. github-actions commented on Dec 11, 2021

    @github-actions

    This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

  7. added a commit that references this issue on Feb 17, 2022
    d48dd6f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestimprovementlibcudfnon-breaking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions