-
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
Ensure that Kokkos::complex
only gets instantiated for cv-unqualified floating-point types
#6251
Ensure that Kokkos::complex
only gets instantiated for cv-unqualified floating-point types
#6251
Conversation
Do you guys want a comment about half/bhalf type support? |
@@ -44,6 +44,11 @@ class | |||
alignas(2 * sizeof(RealType)) | |||
#endif | |||
complex { | |||
static_assert(std::is_floating_point_v<RealType> && |
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.
Shall we merge this and then add a follow on PR with:
static_assert(std::is_floating_point_v<RealType> && | |
static_assert((std::is_floating_point_v<RealType> && | |
std::is_same_v<RealType, std::remove_cv_t<RealType>) || | |
kokkos_type_is_half<RealType>::value) |
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 do not see any usage of Kokkos::complex
with half_t
or bhalf_t
in Trilinos:
https://github.com/search?q=repo%3Atrilinos%2FTrilinos+Kokkos%3A%3Acomplex+half_t&type=code
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.
Except that
kokkos_type_is_half
is not yet a thing- that including
<Kokkos_Half.hpp>
is not acceptable
so we would have to explore some other mechanism to enable if we decide to add support.
Ignoring timeouts in OpenMPTarget build |
#6069 (comment) uncovered a bug where we accidentally instantiated
Kokkos::complex
for integral types.This PR is open as a base for discussion and proposes to static assert that
complex
is being instantiated for a cv-unqualified floating-point type. The current implementation would not allow for using half types.