-
Notifications
You must be signed in to change notification settings - Fork 445
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
SIMD: convert binary operators to hidden friends #6320
SIMD: convert binary operators to hidden friends #6320
Conversation
Looks good so far... |
e371fee
to
4f907cc
Compare
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.
Why do we only have constexpr specifier with the scalar implementation?
simd/src/Kokkos_SIMD_Scalar.hpp
Outdated
simd const& lhs, simd const& rhs) noexcept { | ||
return simd(lhs.m_value >> static_cast<int>(rhs[0])); | ||
return simd(lhs.m_value >> static_cast<value_type>(rhs)); |
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.
Why are we casting to value_type
rather than using rhs.value
directly?
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.
Replaced to use rhs.m_value
instead. 787c301
KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION mask_type | ||
operator<(simd const& other) const { | ||
return mask_type(_mm256_cmp_pd(m_value, other.m_value, _CMP_LT_OS)); | ||
[[nodiscard]] KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd operator-() const |
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.
What about constexpr
?
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.
It's because these intrinsic functions are not constexpr
.
Placing constexpr
specifier will produce errors: call to non-'constexpr' function '__m256d _mm256_sub_pd
.
ccff122
to
bce57b1
Compare
bce57b1
to
787c301
Compare
Retest this please. |
Follow up from #6109 (comment).
Converted binary operators to hidden friends and modified operator signatures to stay consistent with class overview provided in P1928R6.