diff --git a/Eigen/src/Core/arch/CUDA/Complex.h b/Eigen/src/Core/arch/CUDA/Complex.h index aa511a4b2..f133b2db9 100644 --- a/Eigen/src/Core/arch/CUDA/Complex.h +++ b/Eigen/src/Core/arch/CUDA/Complex.h @@ -25,6 +25,8 @@ namespace internal { // building for CUDA to avoid non-constexpr methods. template struct scalar_sum_op> { + typedef typename std::complex result_type; + EIGEN_EMPTY_STRUCT_CTOR(scalar_sum_op) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const std::complex operator() (const std::complex& a, const std::complex& b) const { return std::complex(numext::real(a) + numext::real(b), @@ -33,6 +35,8 @@ template struct scalar_sum_op> { }; template struct scalar_difference_op> { + typedef typename std::complex result_type; + EIGEN_EMPTY_STRUCT_CTOR(scalar_difference_op) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const std::complex operator() (const std::complex& a, const std::complex& b) const { return std::complex(numext::real(a) - numext::real(b), @@ -44,6 +48,8 @@ template struct scalar_product_op, std::complex> enum { Vectorizable = packet_traits>::HasMul }; + typedef typename std::complex result_type; + EIGEN_EMPTY_STRUCT_CTOR(scalar_product_op) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const std::complex operator() (const std::complex& a, const std::complex& b) const { const T a_real = numext::real(a); @@ -59,6 +65,8 @@ template struct scalar_quotient_op, std::complex> enum { Vectorizable = packet_traits>::HasDiv }; + typedef typename std::complex result_type; + EIGEN_EMPTY_STRUCT_CTOR(scalar_quotient_op) EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const std::complex operator() (const std::complex& a, const std::complex& b) const { const T a_real = numext::real(a);