From 312c8e77ff653d718cf4b318c9633d4b45bb725f Mon Sep 17 00:00:00 2001 From: Deven Desai Date: Mon, 2 Dec 2019 17:41:32 +0000 Subject: 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. --- Eigen/src/Core/GenericPacketMath.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Eigen/src/Core/GenericPacketMath.h') 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 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(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 EIGEN_DEVICE_FUNC inline Packet -pldexp(const Packet &a, const Packet &exponent) { return std::ldexp(a, static_cast(exponent)); } +pldexp(const Packet &a, const Packet &exponent) { + EIGEN_USING_STD_MATH(ldexp); + return ldexp(a, static_cast(exponent)); +} /** \internal \returns zeros */ template EIGEN_DEVICE_FUNC inline Packet -- cgit v1.2.3