@@ -55,6 +55,13 @@ class Vectorized<ComplexFlt> {
5555 _vec1 = vfloat32{val3.real (), val3.imag (), val4.real (), val4.imag ()};
5656 }
5757
58+ C10_ALWAYS_INLINE const vec_internal_type& vec0 () const {
59+ return _vec0;
60+ }
61+ C10_ALWAYS_INLINE const vec_internal_type& vec1 () const {
62+ return _vec1;
63+ }
64+
5865 template <uint64_t mask>
5966 static std::enable_if_t <blendChoiceComplex(mask) == 0 , Vectorized<ComplexFlt>>
6067 C10_ALWAYS_INLINE
@@ -623,6 +630,31 @@ Vectorized<ComplexFlt> inline minimum(
623630 // return _mm256_or_ps(min, isnan);
624631}
625632
633+ template <>
634+ Vectorized<ComplexFlt> C10_ALWAYS_INLINE operator +(const Vectorized<ComplexFlt>& a, const Vectorized<ComplexFlt>& b) {
635+ return Vectorized<ComplexFlt>{vec_add (a.vec0 (), b.vec0 ()), vec_add (a.vec1 (), b.vec1 ())};
636+ }
637+
638+ template <>
639+ Vectorized<ComplexFlt> C10_ALWAYS_INLINE operator -(const Vectorized<ComplexFlt>& a, const Vectorized<ComplexFlt>& b) {
640+ return Vectorized<ComplexFlt>{vec_sub (a.vec0 (), b.vec0 ()), vec_sub (a.vec1 (), b.vec1 ())};
641+ }
642+
643+ template <>
644+ Vectorized<ComplexFlt> C10_ALWAYS_INLINE operator &(const Vectorized<ComplexFlt>& a, const Vectorized<ComplexFlt>& b) {
645+ return Vectorized<ComplexFlt>{vec_and (a.vec0 (), b.vec0 ()), vec_and (a.vec1 (), b.vec1 ())};
646+ }
647+
648+ template <>
649+ Vectorized<ComplexFlt> C10_ALWAYS_INLINE operator |(const Vectorized<ComplexFlt>& a, const Vectorized<ComplexFlt>& b) {
650+ return Vectorized<ComplexFlt>{vec_or (a.vec0 (), b.vec0 ()), vec_or (a.vec1 (), b.vec1 ())};
651+ }
652+
653+ template <>
654+ Vectorized<ComplexFlt> C10_ALWAYS_INLINE operator ^(const Vectorized<ComplexFlt>& a, const Vectorized<ComplexFlt>& b) {
655+ return Vectorized<ComplexFlt>{vec_xor (a.vec0 (), b.vec0 ()), vec_xor (a.vec1 (), b.vec1 ())};
656+ }
657+
626658} // namespace
627659} // namespace vec
628660} // namespace at
0 commit comments