diff options
author | David Tellenbach <david.tellenbach@me.com> | 2020-07-22 17:56:15 +0200 |
---|---|---|
committer | David Tellenbach <david.tellenbach@me.com> | 2020-07-22 19:00:17 +0000 |
commit | 38b91f256be8bf498f0ba9e8dc4fa0abdd7abe70 (patch) | |
tree | b4fcba93901f202dc8f778f40ebffa9f40af230c /Eigen/src/Core/arch/Default/BFloat16.h | |
parent | bed7fbe8548d45eeb0c10dfaa712132540cf1cc6 (diff) |
Fix cast of blfoat16 to std::complex<T>
Diffstat (limited to 'Eigen/src/Core/arch/Default/BFloat16.h')
-rw-r--r-- | Eigen/src/Core/arch/Default/BFloat16.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Eigen/src/Core/arch/Default/BFloat16.h b/Eigen/src/Core/arch/Default/BFloat16.h index 3ea725d9b..f9c6e76a9 100644 --- a/Eigen/src/Core/arch/Default/BFloat16.h +++ b/Eigen/src/Core/arch/Default/BFloat16.h @@ -34,9 +34,8 @@ namespace Eigen { struct bfloat16; -// explicit conversion operators are no available before C++11 so we first cast -// bfloat16 to RealScalar rather than to std::complex<RealScalar> directly -#if !EIGEN_HAS_CXX11 +// Since we allow implicit conversion of bfloat16 to float and double, we +// need to make the cast to complex a bit more explicit namespace internal { template <typename RealScalar> struct cast_impl<bfloat16, std::complex<RealScalar> > { @@ -46,7 +45,6 @@ struct cast_impl<bfloat16, std::complex<RealScalar> > { } }; } // namespace internal -#endif // EIGEN_HAS_CXX11 namespace bfloat16_impl { |