From ef92310155eb663859a47b73b6e8fc119d0bebc6 Mon Sep 17 00:00:00 2001 From: David Wendt <45795991+davidwendt@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:04:06 -0400 Subject: [PATCH] Fix memset error in nvtext::edit_distance_matrix (#14283) 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: https://github.com/rapidsai/cudf/pull/14283 --- cpp/src/text/edit_distance.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/text/edit_distance.cu b/cpp/src/text/edit_distance.cu index 1460be4fcf5..3d5f2d72e6f 100644 --- a/cpp/src/text/edit_distance.cu +++ b/cpp/src/text/edit_distance.cu @@ -224,7 +224,7 @@ std::unique_ptr edit_distance_matrix(cudf::strings_column_view con cudf::size_type n_upper = (strings_count * (strings_count - 1)) / 2; rmm::device_uvector 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(0),