10#ifndef EIGEN_GENERAL_MATRIX_VECTOR_H
11#define EIGEN_GENERAL_MATRIX_VECTOR_H
23template <
int N,
typename T1,
typename T2,
typename T3>
26template <
typename T1,
typename T2,
typename T3>
29template <
typename T1,
typename T2,
typename T3>
32template<
typename LhsScalar,
typename RhsScalar,
int _PacketSize=GEMVPacketFull>
37#define PACKET_DECL_COND_PREFIX(prefix, name, packet_size) \
38 typedef typename gemv_packet_cond<packet_size, \
39 typename packet_traits<name ## Scalar>::type, \
40 typename packet_traits<name ## Scalar>::half, \
41 typename unpacket_traits<typename packet_traits<name ## Scalar>::half>::half>::type \
42 prefix ## name ## Packet
47#undef PACKET_DECL_COND_PREFIX
78template<
typename Index,
typename LhsScalar,
typename LhsMapper,
bool ConjugateLhs,
typename RhsScalar,
typename RhsMapper,
bool ConjugateRhs,
int Version>
107template<
typename Index,
typename LhsScalar,
typename LhsMapper,
bool ConjugateLhs,
typename RhsScalar,
typename RhsMapper,
bool ConjugateRhs,
int Version>
130 ResPacketSize = Traits::ResPacketSize,
133 LhsPacketSize = Traits::LhsPacketSize,
156 for(;
i<
n8;
i+=ResPacketSize*8)
281 c0 += cj.pmul(lhs(
i,
j), rhs(
j,0));
297template<
typename Index,
typename LhsScalar,
typename LhsMapper,
bool ConjugateLhs,
typename RhsScalar,
typename RhsMapper,
bool ConjugateRhs,
int Version>
326template<
typename Index,
typename LhsScalar,
typename LhsMapper,
bool ConjugateLhs,
typename RhsScalar,
typename RhsMapper,
bool ConjugateRhs,
int Version>
346 const Index n8 = lhs.stride()*
sizeof(LhsScalar)>32000 ? 0 :
rows-7;
352 ResPacketSize = Traits::ResPacketSize,
355 LhsPacketSize = Traits::LhsPacketSize,
375 for(;
j+LhsPacketSize<=
cols;
j+=LhsPacketSize)
398 RhsScalar
b0 = rhs(
j,0);
400 cc0 += cj.pmul(lhs(
i+0,
j),
b0);
401 cc1 += cj.pmul(lhs(
i+1,
j),
b0);
402 cc2 += cj.pmul(lhs(
i+2,
j),
b0);
403 cc3 += cj.pmul(lhs(
i+3,
j),
b0);
404 cc4 += cj.pmul(lhs(
i+4,
j),
b0);
405 cc5 += cj.pmul(lhs(
i+5,
j),
b0);
406 cc6 += cj.pmul(lhs(
i+6,
j),
b0);
407 cc7 += cj.pmul(lhs(
i+7,
j),
b0);
426 for(;
j+LhsPacketSize<=
cols;
j+=LhsPacketSize)
441 RhsScalar
b0 = rhs(
j,0);
443 cc0 += cj.pmul(lhs(
i+0,
j),
b0);
444 cc1 += cj.pmul(lhs(
i+1,
j),
b0);
445 cc2 += cj.pmul(lhs(
i+2,
j),
b0);
446 cc3 += cj.pmul(lhs(
i+3,
j),
b0);
459 for(;
j+LhsPacketSize<=
cols;
j+=LhsPacketSize)
470 RhsScalar
b0 = rhs(
j,0);
472 cc0 += cj.pmul(lhs(
i+0,
j),
b0);
473 cc1 += cj.pmul(lhs(
i+1,
j),
b0);
484 for(;
j+LhsPacketSize<=
cols;
j+=LhsPacketSize)
508 cc0 += cj.pmul(lhs(
i,
j), rhs(
j,0));
int i
Definition BiCGSTAB_step_by_step.cpp:9
#define eigen_internal_assert(x)
Definition Macros.h:1043
#define EIGEN_UNUSED_VARIABLE(var)
Definition Macros.h:1076
#define EIGEN_DEVICE_FUNC
Definition Macros.h:976
#define EIGEN_DONT_INLINE
Definition Macros.h:940
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition PartialRedux_count.cpp:3
int rows
Definition Tutorial_commainit_02.cpp:1
int cols
Definition Tutorial_commainit_02.cpp:1
Definition TensorRef.h:81
Definition GeneralMatrixVector.h:34
conditional< Vectorizable, _LhsPacket, LhsScalar >::type LhsPacket
Definition GeneralMatrixVector.h:59
conditional< Vectorizable, _ResPacket, ResScalar >::type ResPacket
Definition GeneralMatrixVector.h:61
conditional< Vectorizable, _RhsPacket, RhsScalar >::type RhsPacket
Definition GeneralMatrixVector.h:60
@ Vectorizable
Definition GeneralMatrixVector.h:51
@ ResPacketSize
Definition GeneralMatrixVector.h:56
@ RhsPacketSize
Definition GeneralMatrixVector.h:55
@ LhsPacketSize
Definition GeneralMatrixVector.h:54
@ Unaligned
Definition Constants.h:233
@ ColMajor
Definition Constants.h:319
@ RowMajor
Definition Constants.h:321
int RealScalar * palpha
Definition level1_cplx_impl.h:142
RealScalar alpha
Definition level1_cplx_impl.h:147
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux(const Packet &a)
Definition GenericPacketMath.h:875
EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition PacketMath.h:827
GEMVPacketSizeType
Definition GeneralMatrixVector.h:17
@ GEMVPacketFull
Definition GeneralMatrixVector.h:18
@ GEMVPacketHalf
Definition GeneralMatrixVector.h:19
@ GEMVPacketQuarter
Definition GeneralMatrixVector.h:20
@ Lhs
Definition TensorContractionMapper.h:19
@ Rhs
Definition TensorContractionMapper.h:18
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
Definition GenericPacketMath.h:700
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition MathFunctions.h:1083
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Definition BandTriangularSolver.h:13
#define PACKET_DECL_COND_PREFIX(prefix, name, packet_size)
Definition GeneralBlockPanelKernel.h:379
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition XprHelper.h:806
T1 type
Definition GeneralMatrixVector.h:27
T2 type
Definition GeneralMatrixVector.h:30
Definition GeneralMatrixVector.h:24
T3 type
Definition GeneralMatrixVector.h:24
gemv_traits< LhsScalar, RhsScalar > Traits
Definition GeneralMatrixVector.h:81
Traits::LhsPacket LhsPacket
Definition GeneralMatrixVector.h:87
Traits::RhsPacket RhsPacket
Definition GeneralMatrixVector.h:88
QuarterTraits::LhsPacket LhsPacketQuarter
Definition GeneralMatrixVector.h:95
Traits::ResPacket ResPacket
Definition GeneralMatrixVector.h:89
HalfTraits::ResPacket ResPacketHalf
Definition GeneralMatrixVector.h:93
QuarterTraits::RhsPacket RhsPacketQuarter
Definition GeneralMatrixVector.h:96
QuarterTraits::ResPacket ResPacketQuarter
Definition GeneralMatrixVector.h:97
HalfTraits::LhsPacket LhsPacketHalf
Definition GeneralMatrixVector.h:91
gemv_traits< LhsScalar, RhsScalar, GEMVPacketHalf > HalfTraits
Definition GeneralMatrixVector.h:82
ScalarBinaryOpTraits< LhsScalar, RhsScalar >::ReturnType ResScalar
Definition GeneralMatrixVector.h:85
HalfTraits::RhsPacket RhsPacketHalf
Definition GeneralMatrixVector.h:92
gemv_traits< LhsScalar, RhsScalar, GEMVPacketQuarter > QuarterTraits
Definition GeneralMatrixVector.h:83
QuarterTraits::RhsPacket RhsPacketQuarter
Definition GeneralMatrixVector.h:315
gemv_traits< LhsScalar, RhsScalar > Traits
Definition GeneralMatrixVector.h:300
Traits::RhsPacket RhsPacket
Definition GeneralMatrixVector.h:307
HalfTraits::RhsPacket RhsPacketHalf
Definition GeneralMatrixVector.h:311
Traits::ResPacket ResPacket
Definition GeneralMatrixVector.h:308
gemv_traits< LhsScalar, RhsScalar, GEMVPacketHalf > HalfTraits
Definition GeneralMatrixVector.h:301
Traits::LhsPacket LhsPacket
Definition GeneralMatrixVector.h:306
HalfTraits::LhsPacket LhsPacketHalf
Definition GeneralMatrixVector.h:310
HalfTraits::ResPacket ResPacketHalf
Definition GeneralMatrixVector.h:312
gemv_traits< LhsScalar, RhsScalar, GEMVPacketQuarter > QuarterTraits
Definition GeneralMatrixVector.h:302
QuarterTraits::ResPacket ResPacketQuarter
Definition GeneralMatrixVector.h:316
ScalarBinaryOpTraits< LhsScalar, RhsScalar >::ReturnType ResScalar
Definition GeneralMatrixVector.h:304
QuarterTraits::LhsPacket LhsPacketQuarter
Definition GeneralMatrixVector.h:314
Definition ForwardDeclarations.h:17
Definition GenericPacketMath.h:133
@ vectorizable
Definition GenericPacketMath.h:140
std::ptrdiff_t j
Definition tut_arithmetic_redux_minmax.cpp:2