From e944f558ea7e32e01617bd14b8cdc3f6216acf64 Mon Sep 17 00:00:00 2001 From: Muhammad Haseeb <14217455+mhaseeb123@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:47:16 -0800 Subject: [PATCH] Fix a minor potential i32 overflow in `thrust::transform_exclusive_scan` in PQ reader preprocessing (#17617) This PR fixes a minor potential `int32` overflow in `thrust::transform_exclusive_scan` by setting the `init` parameter to the correct desired output type (`size_t{0}`). The counting iterator is also updated `size_t` type to match `pass.chunks.size()`'s type, though it's unlikely we will have >2B chunks per pass. Authors: - Muhammad Haseeb (https://github.com/mhaseeb123) Approvers: - Vukasin Milovanovic (https://github.com/vuule) - David Wendt (https://github.com/davidwendt) URL: https://github.com/rapidsai/cudf/pull/17617 --- cpp/src/io/parquet/reader_impl_preprocess.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/src/io/parquet/reader_impl_preprocess.cu b/cpp/src/io/parquet/reader_impl_preprocess.cu index bcdae4cbd3b..d9ea10a695e 100644 --- a/cpp/src/io/parquet/reader_impl_preprocess.cu +++ b/cpp/src/io/parquet/reader_impl_preprocess.cu @@ -550,7 +550,7 @@ void decode_page_headers(pass_intermediate_data& pass, { CUDF_FUNC_RANGE(); - auto iter = thrust::make_counting_iterator(0); + auto iter = thrust::counting_iterator(0); rmm::device_uvector chunk_page_counts(pass.chunks.size() + 1, stream); thrust::transform_exclusive_scan( rmm::exec_policy_nosync(stream), @@ -562,7 +562,7 @@ void decode_page_headers(pass_intermediate_data& pass, return static_cast( i >= num_chunks ? 0 : chunks[i].num_data_pages + chunks[i].num_dict_pages); }), - 0, + size_t{0}, thrust::plus{}); rmm::device_uvector d_chunk_page_info(pass.chunks.size(), stream); thrust::for_each(rmm::exec_policy_nosync(stream),