aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/GenericPacketMath.h
diff options
context:
space:
mode:
authorGravatar Deven Desai <deven.desai.amd@gmail.com>2019-12-02 17:41:32 +0000
committerGravatar Deven Desai <deven.desai.amd@gmail.com>2019-12-02 17:41:32 +0000
commit312c8e77ff653d718cf4b318c9633d4b45bb725f (patch)
tree14b3af28d5f147a6eb956d5217c6bde159f8eb10 /Eigen/src/Core/GenericPacketMath.h
parent956131d0e648b468a51ac6e481b31151b132468e (diff)
Fix for the HIP build+test errors.
Recent changes have introduced the following build error when compiling with HIPCC --------- unsupported/test/../../Eigen/src/Core/GenericPacketMath.h:254:58: error: 'ldexp': no overloaded function has restriction specifiers that are compatible with the ambient context 'pldexp' --------- The fix for the error is to pick the math function(s) from the global namespace (where they are declared as device functions in the HIP header files) when compiling with HIPCC.
Diffstat (limited to 'Eigen/src/Core/GenericPacketMath.h')
-rw-r--r--Eigen/src/Core/GenericPacketMath.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h
index 8ffc684f2..2e9fd4d7a 100644
--- a/Eigen/src/Core/GenericPacketMath.h
+++ b/Eigen/src/Core/GenericPacketMath.h
@@ -247,7 +247,8 @@ pshiftleft(const long int& a) { return a << N; }
template <typename Packet>
EIGEN_DEVICE_FUNC inline Packet pfrexp(const Packet& a, Packet& exponent) {
int exp;
- Packet result = std::frexp(a, &exp);
+ EIGEN_USING_STD_MATH(frexp);
+ Packet result = frexp(a, &exp);
exponent = static_cast<Packet>(exp);
return result;
}
@@ -256,7 +257,10 @@ EIGEN_DEVICE_FUNC inline Packet pfrexp(const Packet& a, Packet& exponent) {
* See https://en.cppreference.com/w/cpp/numeric/math/ldexp
*/
template<typename Packet> EIGEN_DEVICE_FUNC inline Packet
-pldexp(const Packet &a, const Packet &exponent) { return std::ldexp(a, static_cast<int>(exponent)); }
+pldexp(const Packet &a, const Packet &exponent) {
+ EIGEN_USING_STD_MATH(ldexp);
+ return ldexp(a, static_cast<int>(exponent));
+}
/** \internal \returns zeros */
template<typename Packet> EIGEN_DEVICE_FUNC inline Packet