Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize ORC reader performance for list data #13708

Merged
merged 6 commits into from
Jul 25, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions cpp/src/io/orc/reader_impl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -725,12 +725,16 @@ struct list_buffer_data {
void generate_offsets_for_list(device_span<list_buffer_data const> buff_data,
vyasr marked this conversation as resolved.
Show resolved Hide resolved
rmm::cuda_stream_view stream)
{
auto const transformer = [] __device__(list_buffer_data const list_data) {
std::vector<list_buffer_data> buff_data_vec(buff_data.size());
CUDF_CUDA_TRY(cudaMemcpyAsync(buff_data_vec.data(),
buff_data.data(),
sizeof(list_buffer_data) * buff_data.size(),
cudaMemcpyDeviceToHost,
vyasr marked this conversation as resolved.
Show resolved Hide resolved
stream.value()));
for (auto list_data : buff_data_vec) {
thrust::exclusive_scan(
thrust::seq, list_data.data, list_data.data + list_data.size, list_data.data);
};
thrust::for_each(rmm::exec_policy(stream), buff_data.begin(), buff_data.end(), transformer);
stream.synchronize();
rmm::exec_policy(stream), list_data.data, list_data.data + list_data.size, list_data.data);
vyasr marked this conversation as resolved.
Show resolved Hide resolved
}
}

/**
Expand Down