-
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
Avoid instantiating default constructor of value type when WithoutInitializing is given #5307
Avoid instantiating default constructor of value type when WithoutInitializing is given #5307
Conversation
5700bca
to
37af24c
Compare
e79d08c
to
f44063b
Compare
a48dcc8
to
7515804
Compare
if (false) { | ||
// Make sure the destroy functor gets instantiated. | ||
// This avoids "cudaErrorInvalidDeviceFunction"-type errors. | ||
functor.destroy_shared_allocation(); | ||
} |
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 is the critical change that we missed in the previous attempts.
if (false) { | ||
// Make sure the destroy functor gets instantiated. | ||
// This avoids "cudaErrorInvalidDeviceFunction"-type errors. | ||
functor.destroy_shared_allocation(); |
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.
Is this not going to generate warnings about unreachable code from one compiler or another? How about (void)&functor_type::destroy_shared_allocation
?
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 would try to deal with it when we run into problems. At least our CI seems to be fine with it.
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 am glad you figured that one out
Co-authored-by: Damien L-G <dalg24+github@gmail.com>
5c2cf3f
to
2a9ef31
Compare
Retest this please. |
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.
Just guard that thing in the ViewArray version too then I approve. The clang stuff we should look at independently.
core/src/impl/Kokkos_ViewMapping.hpp
Outdated
|
||
KOKKOS_INLINE_FUNCTION void operator()(DestroyTag const&, | ||
const size_t i) const { | ||
// KOKKOS_IMPL_CUDA_CLANG_WORKAROUND this line causes ptax error |
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.
does this comment still has any meaning? Not holding this up because of it but would be good to figure out. I also see that one of hte tests is commented out for HIP too ?
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.
As far as I can see, the test is also enabled for Cuda+Clang so I removed the comment.
See 3f3bbc2. |
b6da0a9
to
8268c40
Compare
Retest this please. |
Only |
Trying #2024 on top of #5277. Fixes #1873.