10 #ifndef EIGEN_COMPLEX_CUDA_H 11 #define EIGEN_COMPLEX_CUDA_H 19 #if defined(__CUDACC__) && defined(EIGEN_USE_GPU) 28 template<
typename T>
struct scalar_sum_op<const
std::complex<T>, const std::complex<T> > : binary_op_base<const std::complex<T>, const std::complex<T> > {
38 template<
typename T>
struct scalar_sum_op<
std::complex<T>, std::complex<T> > : scalar_sum_op<const std::complex<T>, const std::complex<T> > {};
42 template<
typename T>
struct scalar_difference_op<const std::complex<T>, const std::complex<T> > : binary_op_base<const std::complex<T>, const std::complex<T> > {
46 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE std::complex<T> operator() (const std::complex<T>& a, const std::complex<T>&
b)
const {
52 template<
typename T>
struct scalar_difference_op<std::complex<T>, std::complex<T> > : scalar_difference_op<const std::complex<T>, const std::complex<T> > {};
56 template<
typename T>
struct scalar_product_op<const std::complex<T>, const std::complex<T> > : binary_op_base<const std::complex<T>, const std::complex<T> > {
58 Vectorizable = packet_traits<std::complex<T>>::HasMul
63 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE std::complex<T> operator() (const std::complex<T>& a, const std::complex<T>&
b)
const {
68 return std::complex<T>(a_real * b_real - a_imag * b_imag,
69 a_real * b_imag + a_imag * b_real);
73 template<
typename T>
struct scalar_product_op<std::complex<T>, std::complex<T> > : scalar_product_op<const std::complex<T>, const std::complex<T> > {};
77 template<
typename T>
struct scalar_quotient_op<const std::complex<T>, const std::complex<T> > : binary_op_base<const std::complex<T>, const std::complex<T> > {
79 Vectorizable = packet_traits<std::complex<T>>::HasDiv
84 EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE std::complex<T> operator() (const std::complex<T>& a, const std::complex<T>&
b)
const {
89 const T norm = T(1) / (b_real * b_real + b_imag * b_imag);
90 return std::complex<T>((a_real * b_real + a_imag * b_imag) * norm,
91 (a_imag * b_real - a_real * b_imag) * norm);
95 template<
typename T>
struct scalar_quotient_op<std::complex<T>, std::complex<T> > : scalar_quotient_op<const std::complex<T>, const std::complex<T> > {};
103 #endif // EIGEN_COMPLEX_CUDA_H ScalarBinaryOpTraits< LhsScalar, RhsScalar, scalar_sum_op >::ReturnType result_type
#define EIGEN_STRONG_INLINE
#define EIGEN_EMPTY_STRUCT_CTOR(X)
EIGEN_DEVICE_FUNC RealReturnType real() const
EIGEN_DEVICE_FUNC const ImagReturnType imag() const
EIGEN_DEVICE_FUNC const Scalar & b