From c65c2b31d49adea63d31e3ea8f5685a47018e682 Mon Sep 17 00:00:00 2001 From: Antonio Sanchez Date: Fri, 26 Feb 2021 15:25:00 -0800 Subject: Make half/bfloat16 constructor take inputs by value, fix powerpc test. Since `numeric_limits::max_exponent` is a static inline constant, it cannot be directly passed by reference. This triggers a linker error in recent versions of `g++-powerpc64le`. Changing `half` to take inputs by value fixes this. Wrapping `max_exponent` with `int(...)` to make an addressable integer also fixes this and may help with other custom `Scalar` types down-the-road. Also eliminated some compile warnings for powerpc. --- test/array_cwise.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/array_cwise.cpp b/test/array_cwise.cpp index 92abf6968..6a88e0e27 100644 --- a/test/array_cwise.cpp +++ b/test/array_cwise.cpp @@ -25,7 +25,7 @@ void pow_test() { const Scalar denorm_min = std::numeric_limits::denorm_min(); const Scalar min = (std::numeric_limits::min)(); const Scalar max = (std::numeric_limits::max)(); - const Scalar max_exp = (static_cast(std::numeric_limits::max_exponent) * Scalar(EIGEN_LN2)) / eps; + const Scalar max_exp = (static_cast(int(std::numeric_limits::max_exponent)) * Scalar(EIGEN_LN2)) / eps; const static Scalar abs_vals[] = {zero, denorm_min, -- cgit v1.2.3