From 3c2107aca32011966e31fa7c98dac2d8fbe40fc6 Mon Sep 17 00:00:00 2001 From: davidwendt Date: Mon, 9 Aug 2021 11:33:41 -0400 Subject: [PATCH] Fix memory read error in get_dremel_data in page_enc.cu --- cpp/src/io/parquet/page_enc.cu | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/src/io/parquet/page_enc.cu b/cpp/src/io/parquet/page_enc.cu index 3c62dcf7eea..20a7ab7ca6d 100644 --- a/cpp/src/io/parquet/page_enc.cu +++ b/cpp/src/io/parquet/page_enc.cu @@ -1966,9 +1966,9 @@ dremel_data get_dremel_data(column_view h_col, // Scan to get distance by which each offset value is shifted due to the insertion of empties auto scan_it = cudf::detail::make_counting_transform_iterator( - column_offsets[level], [off = lcv.offsets().data()] __device__(auto i) -> int { - return off[i] == off[i + 1]; - }); + column_offsets[level], + [off = lcv.offsets().data(), size = lcv.offsets().size()] __device__( + auto i) -> int { return (i + 1 < size) && (off[i] == off[i + 1]); }); rmm::device_uvector scan_out(offset_size_at_level, stream); thrust::exclusive_scan( rmm::exec_policy(stream), scan_it, scan_it + offset_size_at_level, scan_out.begin()); @@ -2053,9 +2053,9 @@ dremel_data get_dremel_data(column_view h_col, // Scan to get distance by which each offset value is shifted due to the insertion of dremel // level value fof an empty list auto scan_it = cudf::detail::make_counting_transform_iterator( - column_offsets[level], [off = lcv.offsets().data()] __device__(auto i) -> int { - return off[i] == off[i + 1]; - }); + column_offsets[level], + [off = lcv.offsets().data(), size = lcv.offsets().size()] __device__( + auto i) -> int { return (i + 1 < size) && (off[i] == off[i + 1]); }); rmm::device_uvector scan_out(offset_size_at_level, stream); thrust::exclusive_scan( rmm::exec_policy(stream), scan_it, scan_it + offset_size_at_level, scan_out.begin());