Skip to content

Commit

Permalink
Use make_device_uvector instead of cudaMemcpyAsync in inplace_bitmask…
Browse files Browse the repository at this point in the history
…_binop (#17181)

Changes  `cudf::detail::inplace_bitmask_binop()` to use `make_device_uvector()` instead of `cudaMemcpyAsync()`
Found while working on #17149

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Nghia Truong (https://github.com/ttnghia)

URL: #17181
  • Loading branch information
davidwendt authored Oct 28, 2024
1 parent 8bc9f19 commit 8c4d1f2
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions cpp/include/cudf/detail/null_mask.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,9 @@ size_type inplace_bitmask_binop(Binop op,

rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref();
cudf::detail::device_scalar<size_type> d_counter{0, stream, mr};
rmm::device_uvector<bitmask_type const*> d_masks(masks.size(), stream, mr);
rmm::device_uvector<size_type> d_begin_bits(masks_begin_bits.size(), stream, mr);

CUDF_CUDA_TRY(cudaMemcpyAsync(
d_masks.data(), masks.data(), masks.size_bytes(), cudaMemcpyDefault, stream.value()));
CUDF_CUDA_TRY(cudaMemcpyAsync(d_begin_bits.data(),
masks_begin_bits.data(),
masks_begin_bits.size_bytes(),
cudaMemcpyDefault,
stream.value()));

auto d_masks = cudf::detail::make_device_uvector_async(masks, stream, mr);
auto d_begin_bits = cudf::detail::make_device_uvector_async(masks_begin_bits, stream, mr);

auto constexpr block_size = 256;
cudf::detail::grid_1d config(dest_mask.size(), block_size);
Expand Down

0 comments on commit 8c4d1f2

Please sign in to comment.