Skip to content

Commit

Permalink
Fix memset error in nvtext::edit_distance_matrix (#14283)
Browse files Browse the repository at this point in the history
Fixes a bug in `nvtext::edit_distance_matrix` where the internal offsets vector is initialized to 0. 
This error was introduced in #13912 
The bug was found while working on a different PR which re-ordered the nvtext gtests execution causing device memory to be reused from the rmm pool in a different way.

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

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

URL: #14283
  • Loading branch information
davidwendt authored Oct 16, 2023
1 parent 655f3a4 commit ef92310
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/text/edit_distance.cu
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ std::unique_ptr<cudf::column> edit_distance_matrix(cudf::strings_column_view con
cudf::size_type n_upper = (strings_count * (strings_count - 1)) / 2;
rmm::device_uvector<std::ptrdiff_t> offsets(n_upper, stream);
auto d_offsets = offsets.data();
CUDF_CUDA_TRY(cudaMemsetAsync(d_offsets, 0, n_upper * sizeof(cudf::size_type), stream.value()));
CUDF_CUDA_TRY(cudaMemsetAsync(d_offsets, 0, n_upper * sizeof(std::ptrdiff_t), stream.value()));
thrust::for_each_n(
rmm::exec_policy(stream),
thrust::make_counting_iterator<cudf::size_type>(0),
Expand Down

0 comments on commit ef92310

Please sign in to comment.