rapidsai/cudf

[FEA] Add overload for `set_null_mask` that accept result of `make_null_mask` directly

Open

#13.154 geöffnet am 17. Apr. 2023

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (1 zugewiesene Person)C++ (735 Forks)batch import
0 - Backlogfeature requestgood first issuelibcudf

Repository-Metriken

Stars
 (6.000 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 17T 21h) (230 gemergte PRs in 30 T)

Beschreibung

Currently, we have the make_null_mask API returning both null mask and null count:

template <typename ValidityIterator>
std::pair<rmm::device_buffer, cudf::size_type> make_null_mask(ValidityIterator begin,
                                                              ValidityIterator end)

However, the set_null_mask function can't accept that result. As such, we have to pass the result of make_null_mask into set_null_mask by two steps:

auto [null_mask, null_count] =
    cudf::test::detail::make_null_mask(valid_iter, valid_iter + input.size());
  output.set_null_mask(std::move(null_mask), null_count);

This is a bit inconvenient. We can do that in just one step like this:

output.set_null_mask(cudf::test::detail::make_null_mask(valid_iter, valid_iter + input.size()));

In order to do that, we need to have a new overload of set_null_mask that accept the return type of make_null_mask such as:

void set_null_mask(std::pair<rmm::device_buffer, cudf::size_type>&&) { ... }

Contributor Guide