Skip to content

Commit

Permalink
simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
vuule authored and bdice committed Feb 6, 2024
1 parent 4373413 commit 6189c79
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cpp/src/io/orc/writer_impl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2389,19 +2389,19 @@ auto convert_table_to_orc_data(table_view const& input,
strm_descs.device_to_host_async(stream);
comp_results.device_to_host_sync(stream);
}
auto bounce_buffer = [&]() {
size_t max_stream_size = 0;
bool all_device_write = true;

for (auto& ss : strm_descs.host_view().flat_view()) {
if (!out_sink.is_device_write_preferred(ss.stream_size)) { all_device_write = false; }
size_t stream_size = ss.stream_size;
max_stream_size = std::max(max_stream_size, stream_size);
}

return cudf::detail::pinned_host_vector<uint8_t>(all_device_write ? 0 : max_stream_size);
auto const max_out_stream_size = [&]() {
uint32_t max_stream_size = 0;
for (auto const& ss : strm_descs.host_view().flat_view()) {
if (!out_sink.is_device_write_preferred(ss.stream_size)) {
max_stream_size = std::max(max_stream_size, ss.stream_size);
}
}
return max_stream_size;
}();

cudf::detail::pinned_host_vector<uint8_t> bounce_buffer(max_out_stream_size);

auto intermediate_stats = gather_statistic_blobs(stats_freq, orc_table, segmentation, stream);

return std::tuple{std::move(enc_data),
Expand Down

0 comments on commit 6189c79

Please sign in to comment.