-
Notifications
You must be signed in to change notification settings - Fork 915
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
Conversation
There was a problem hiding this 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.
/ok to test |
/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) { |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you clangd! 😄
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
/merge |
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 ofvalue()
withoperator*()
which does have the__device__
decorator.Checklist