-
Notifications
You must be signed in to change notification settings - Fork 407
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 compiler warnings when compiling with nvc++ #4198
Fix compiler warnings when compiling with nvc++ #4198
Conversation
@e10harvey Could you contribute a test for the (presumably) faulty |
@@ -795,7 +795,7 @@ TEST(TEST_CATEGORY, desired_occupancy_empty_base_optimization) { | |||
static_assert(sizeof(decltype(policy)) == 1, ""); | |||
static_assert_dummy_policy_must_be_size_one<sizeof(decltype(policy))> | |||
_assert1{}; | |||
(void)_assert1; // avoid unused variable warning | |||
(void)&_assert1; // avoid unused variable warning |
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.
??
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.
nvc++
still complained here using (void)
but this syntax seems to silence the warning (on all CI checks).
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.
Thanks, @masterleinad ! Which are the faulty half_t
operations?
All the places where I changed
for the non-CUDA case. |
Retest this please. |
Ok, this is done in #4101. |
Retest this please. |
1 similar comment
Retest this please. |
core/src/Cuda/Kokkos_Cuda_Half.hpp
Outdated
@@ -468,8 +468,8 @@ class half_t { | |||
// Use non-volatile val_ref to suppress: | |||
// "warning: implicit dereference will not access object of type ‘volatile | |||
// __half’ in statement" | |||
auto val_ref = const_cast<impl_type&>(val); | |||
val_ref = __float2half(__half2float(const_cast<impl_type&>(val)) / | |||
auto& val_ref = const_cast<impl_type&>(val); |
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.
This was definitely fixed in a better way in #4156
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.
Please merge or rebase this PR to incorporate the changes from #4156, which I think moot all changes in Kokkos_Cuda_Half.hpp
- the changes to it here are papering over incorrect code that the compiler legitimately warns about.
To be clear, I'm +1 on the rest of the changes here |
8e14fa5
to
6e28ef5
Compare
@PhilMiller I rebased. |
inline void modify_host() { | ||
if (impl_dualview_is_single_device::value) return; |
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.
Would you remind me what warnings we were getting?
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.
Something like
"/tmp/kokkos/containers/unit_tests/../src/Kokkos_DualView.hpp", line 818: warning: statement is unreachable
Split from #4196. In particular, the
half_t
operations must use references.