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

Fix for some compiler warnings in parquet/page_decode.cuh #15518

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Changes from all 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
6 changes: 3 additions & 3 deletions cpp/src/io/parquet/page_decode.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ inline __device__ uint32_t InitLevelSection(page_state_s* s,

auto start = cur;

auto init_rle = [s, lvl, end, level_bits](uint8_t const* cur, uint8_t const* end) {
auto init_rle = [s, lvl, level_bits](uint8_t const* cur, uint8_t const* end) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior when a captured variable and a parameter have the same name is interesting. Thanks to godbolt, I found that all options are possible, with different compilers - captured variable value is used, or parameter value is used, or compilation fails. Fun!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow that's interesting. We were in the same situation before, and the code runs differently on different architectures (due to compiled into different archs?).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you clangd! 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think nvcc stayed consistent in prioritizing the parameter over the capture. But I found online that other compilers disagree.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We found that the capture overshadows the previous variable on H100+V100 while on other GPUs it doesn't.

uint32_t const run = get_vlq32(cur, end);
s->initial_rle_run[lvl] = run;
if (!(run & 1)) {
Expand Down Expand Up @@ -1160,7 +1160,7 @@ inline __device__ bool setupLocalPageInfo(page_state_s* const s,
int32_t units = 0;
// Duration types are not included because no scaling is done when reading
if (s->col.logical_type.has_value()) {
auto const& lt = s->col.logical_type.value();
auto const& lt = *s->col.logical_type;
if (lt.is_timestamp_millis()) {
units = cudf::timestamp_ms::period::den;
} else if (lt.is_timestamp_micros()) {
Expand Down Expand Up @@ -1217,7 +1217,7 @@ inline __device__ bool setupLocalPageInfo(page_state_s* const s,
} else if (data_type == INT32) {
// check for smaller bitwidths
if (s->col.logical_type.has_value()) {
auto const& lt = s->col.logical_type.value();
auto const& lt = *s->col.logical_type;
if (lt.type == LogicalType::INTEGER) {
s->dtype_len = lt.bit_width() / 8;
} else if (lt.is_time_millis()) {
Expand Down
Loading