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

Conversation

etseidl
Copy link
Contributor

@etseidl etseidl commented Apr 11, 2024

Description

Clangd generates several warnings/errors in cpp/src/io/parquet/page_decode.cuh. One is in regards to a lambda argument shadowing a captured value. The others involve the use of thrust::optional::value() in device code...unlike pretty much every other member function, value() lacks the __device__ decorator. This PR replaces two usages of value() with operator*() which does have the __device__ decorator.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@etseidl etseidl requested a review from a team as a code owner April 11, 2024 23:11
Copy link

copy-pr-bot bot commented Apr 11, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Apr 11, 2024
Copy link
Contributor

@davidwendt davidwendt left a comment

Choose a reason for hiding this comment

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

Actually, operator()* is preferred in device code since value() may throw an exception.

@davidwendt davidwendt added bug Something isn't working 3 - Ready for Review Ready for review by team non-breaking Non-breaking change labels Apr 11, 2024
@davidwendt
Copy link
Contributor

/ok to test

@davidwendt
Copy link
Contributor

/ok to test

@@ -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.

@davidwendt
Copy link
Contributor

/merge

@rapids-bot rapids-bot bot merged commit 690e558 into rapidsai:branch-24.06 Apr 16, 2024
69 checks passed
@etseidl etseidl deleted the rle_fix branch April 16, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants