Skip to content

cudf::rank not passed enough parameters in list/struct rank benchmarks #16624

Closed
@harrism

Description

The rank lists and rank structs benchmarks do not pass the bool percentage parameter to cudf::rank. But they do pass a MR*, and since pointers can be implicitly converted to bool, the MR goes unused and percentage is taken as true.

cudf::rank(table->view().column(0),
method,
cudf::order::ASCENDING,
null_frequency ? cudf::null_policy::INCLUDE : cudf::null_policy::EXCLUDE,
cudf::null_order::AFTER,
rmm::mr::get_current_device_resource());

and

cudf::rank(table->view().column(0),
method,
cudf::order::ASCENDING,
nulls ? cudf::null_policy::INCLUDE : cudf::null_policy::EXCLUDE,
cudf::null_order::AFTER,
rmm::mr::get_current_device_resource());

The prototype for rank is:

std::unique_ptr<column> rank(
  column_view const& input,
  rank_method method,
  order column_order,
  null_policy null_handling,
  null_order null_precedence,
  bool percentage,
  rmm::cuda_stream_view stream      = cudf::get_default_stream(),
  rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());

Note that passing a MR without passing a stream should not compile, and if the parameter before stream were something that a pointer can't be converted to, it wouldn't.

This is another good reason to avoid bool parameters. :)

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglibcudfAffects libcudf (C++/CUDA) code.

    Type

    Projects

    • Status

      In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions