Skip to content
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

Return count of set bits from inplace_bitmask_and. #9904

Merged
4 changes: 2 additions & 2 deletions cpp/include/cudf/detail/null_mask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ std::pair<rmm::device_buffer, size_type> bitmask_or(
* @param mask_size_bits The number of bits to be ANDed in each mask
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate the returned device_buffer
* @return rmm::device_buffer Output bitmask
* @return Count of set bits
*/
void inplace_bitmask_and(
cudf::size_type inplace_bitmask_and(
device_span<bitmask_type> dest_mask,
host_span<bitmask_type const*> masks,
host_span<size_type const> masks_begin_bits,
Expand Down
14 changes: 7 additions & 7 deletions cpp/src/bitmask/null_mask.cu
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,14 @@ std::vector<size_type> segmented_null_count(const bitmask_type* bitmask,
}

// Inplace Bitwise AND of the masks
void inplace_bitmask_and(device_span<bitmask_type> dest_mask,
host_span<bitmask_type const*> masks,
host_span<size_type const> begin_bits,
size_type mask_size,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr)
cudf::size_type inplace_bitmask_and(device_span<bitmask_type> dest_mask,
host_span<bitmask_type const*> masks,
host_span<size_type const> begin_bits,
size_type mask_size,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr)
{
inplace_bitmask_binop(
return inplace_bitmask_binop(
[] __device__(bitmask_type left, bitmask_type right) { return left & right; },
dest_mask,
masks,
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/structs/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,14 @@ void superimpose_parent_nulls(bitmask_type const* parent_null_mask,
reinterpret_cast<bitmask_type const*>(parent_null_mask),
reinterpret_cast<bitmask_type const*>(current_child_mask)};
std::vector<size_type> begin_bits{0, 0};
cudf::detail::inplace_bitmask_and(
auto const null_count = cudf::detail::inplace_bitmask_and(
device_span<bitmask_type>(current_child_mask, num_bitmask_words(child.size())),
masks,
begin_bits,
child.size(),
stream,
mr);
child.set_null_count(UNKNOWN_NULL_COUNT);
child.set_null_count(null_count);
}

// If the child is also a struct, repeat for all grandchildren.
Expand Down