mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-15 13:15:57 +08:00
backporting warning fixes in cache friendly product
This commit is contained in:
parent
57934b9c30
commit
1c4b4e136b
@ -361,13 +361,14 @@ static EIGEN_DONT_INLINE void ei_cache_friendly_product_colmajor_times_vector(
|
|||||||
#ifdef _EIGEN_ACCUMULATE_PACKETS
|
#ifdef _EIGEN_ACCUMULATE_PACKETS
|
||||||
#error _EIGEN_ACCUMULATE_PACKETS has already been defined
|
#error _EIGEN_ACCUMULATE_PACKETS has already been defined
|
||||||
#endif
|
#endif
|
||||||
|
#define _EIGEN_ACCUMULATE_PACKETS(A0,A13,A2) \
|
||||||
#define _EIGEN_ACCUMULATE_PACKETS(A0,A13,A2,OFFSET) \
|
ei_pstore(&res[j], \
|
||||||
ei_pstore(&res[j OFFSET], \
|
ei_padd(ei_pload(&res[j]), \
|
||||||
ei_padd(ei_pload(&res[j OFFSET]), \
|
|
||||||
ei_padd( \
|
ei_padd( \
|
||||||
ei_padd(ei_pmul(ptmp0,ei_pload ## A0(&lhs0[j OFFSET])),ei_pmul(ptmp1,ei_pload ## A13(&lhs1[j OFFSET]))), \
|
ei_padd(ei_pmul(ptmp0,EIGEN_CAT(ei_ploa , A0)(&lhs0[j])), \
|
||||||
ei_padd(ei_pmul(ptmp2,ei_pload ## A2(&lhs2[j OFFSET])),ei_pmul(ptmp3,ei_pload ## A13(&lhs3[j OFFSET]))) )))
|
ei_pmul(ptmp1,EIGEN_CAT(ei_ploa , A13)(&lhs1[j]))), \
|
||||||
|
ei_padd(ei_pmul(ptmp2,EIGEN_CAT(ei_ploa , A2)(&lhs2[j])), \
|
||||||
|
ei_pmul(ptmp3,EIGEN_CAT(ei_ploa , A13)(&lhs3[j]))) )))
|
||||||
|
|
||||||
typedef typename ei_packet_traits<Scalar>::type Packet;
|
typedef typename ei_packet_traits<Scalar>::type Packet;
|
||||||
const int PacketSize = sizeof(Packet)/sizeof(Scalar);
|
const int PacketSize = sizeof(Packet)/sizeof(Scalar);
|
||||||
@ -433,13 +434,8 @@ static EIGEN_DONT_INLINE void ei_cache_friendly_product_colmajor_times_vector(
|
|||||||
{
|
{
|
||||||
/* explicit vectorization */
|
/* explicit vectorization */
|
||||||
// process initial unaligned coeffs
|
// process initial unaligned coeffs
|
||||||
for (int j=0; j<alignedStart; ++j) {
|
for (int j=0; j<alignedStart; ++j)
|
||||||
Scalar s = ei_pfirst(ptmp0)*lhs0[j];
|
res[j] += ei_pfirst(ptmp0)*lhs0[j] + ei_pfirst(ptmp1)*lhs1[j] + ei_pfirst(ptmp2)*lhs2[j] + ei_pfirst(ptmp3)*lhs3[j];
|
||||||
s += ei_pfirst(ptmp1)*lhs1[j];
|
|
||||||
s += ei_pfirst(ptmp2)*lhs2[j];
|
|
||||||
s += ei_pfirst(ptmp3)*lhs3[j];
|
|
||||||
res[j] += s;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (alignedSize>alignedStart)
|
if (alignedSize>alignedStart)
|
||||||
{
|
{
|
||||||
@ -447,11 +443,11 @@ static EIGEN_DONT_INLINE void ei_cache_friendly_product_colmajor_times_vector(
|
|||||||
{
|
{
|
||||||
case AllAligned:
|
case AllAligned:
|
||||||
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
||||||
_EIGEN_ACCUMULATE_PACKETS(,,,);
|
_EIGEN_ACCUMULATE_PACKETS(d,d,d);
|
||||||
break;
|
break;
|
||||||
case EvenAligned:
|
case EvenAligned:
|
||||||
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
||||||
_EIGEN_ACCUMULATE_PACKETS(,u,,);
|
_EIGEN_ACCUMULATE_PACKETS(d,du,d);
|
||||||
break;
|
break;
|
||||||
case FirstAligned:
|
case FirstAligned:
|
||||||
if(peels>1)
|
if(peels>1)
|
||||||
@ -487,11 +483,11 @@ static EIGEN_DONT_INLINE void ei_cache_friendly_product_colmajor_times_vector(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int j = peeledSize; j<alignedSize; j+=PacketSize)
|
for (int j = peeledSize; j<alignedSize; j+=PacketSize)
|
||||||
_EIGEN_ACCUMULATE_PACKETS(,u,u,);
|
_EIGEN_ACCUMULATE_PACKETS(d,du,du);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
||||||
_EIGEN_ACCUMULATE_PACKETS(u,u,u,);
|
_EIGEN_ACCUMULATE_PACKETS(du,du,du);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -555,12 +551,12 @@ static EIGEN_DONT_INLINE void ei_cache_friendly_product_rowmajor_times_vector(
|
|||||||
#error _EIGEN_ACCUMULATE_PACKETS has already been defined
|
#error _EIGEN_ACCUMULATE_PACKETS has already been defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _EIGEN_ACCUMULATE_PACKETS(A0,A13,A2,OFFSET) {\
|
#define _EIGEN_ACCUMULATE_PACKETS(A0,A13,A2) {\
|
||||||
Packet b = ei_pload(&rhs[j]); \
|
Packet b = ei_pload(&rhs[j]); \
|
||||||
ptmp0 = ei_pmadd(b, ei_pload##A0 (&lhs0[j]), ptmp0); \
|
ptmp0 = ei_pmadd(b, EIGEN_CAT(ei_ploa,A0) (&lhs0[j]), ptmp0); \
|
||||||
ptmp1 = ei_pmadd(b, ei_pload##A13(&lhs1[j]), ptmp1); \
|
ptmp1 = ei_pmadd(b, EIGEN_CAT(ei_ploa,A13)(&lhs1[j]), ptmp1); \
|
||||||
ptmp2 = ei_pmadd(b, ei_pload##A2 (&lhs2[j]), ptmp2); \
|
ptmp2 = ei_pmadd(b, EIGEN_CAT(ei_ploa,A2) (&lhs2[j]), ptmp2); \
|
||||||
ptmp3 = ei_pmadd(b, ei_pload##A13(&lhs3[j]), ptmp3); }
|
ptmp3 = ei_pmadd(b, EIGEN_CAT(ei_ploa,A13)(&lhs3[j]), ptmp3); }
|
||||||
|
|
||||||
typedef typename ei_packet_traits<Scalar>::type Packet;
|
typedef typename ei_packet_traits<Scalar>::type Packet;
|
||||||
const int PacketSize = sizeof(Packet)/sizeof(Scalar);
|
const int PacketSize = sizeof(Packet)/sizeof(Scalar);
|
||||||
@ -641,11 +637,11 @@ static EIGEN_DONT_INLINE void ei_cache_friendly_product_rowmajor_times_vector(
|
|||||||
{
|
{
|
||||||
case AllAligned:
|
case AllAligned:
|
||||||
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
||||||
_EIGEN_ACCUMULATE_PACKETS(,,,);
|
_EIGEN_ACCUMULATE_PACKETS(d,d,d);
|
||||||
break;
|
break;
|
||||||
case EvenAligned:
|
case EvenAligned:
|
||||||
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
||||||
_EIGEN_ACCUMULATE_PACKETS(,u,,);
|
_EIGEN_ACCUMULATE_PACKETS(d,du,d);
|
||||||
break;
|
break;
|
||||||
case FirstAligned:
|
case FirstAligned:
|
||||||
if (peels>1)
|
if (peels>1)
|
||||||
@ -684,11 +680,11 @@ static EIGEN_DONT_INLINE void ei_cache_friendly_product_rowmajor_times_vector(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int j = peeledSize; j<alignedSize; j+=PacketSize)
|
for (int j = peeledSize; j<alignedSize; j+=PacketSize)
|
||||||
_EIGEN_ACCUMULATE_PACKETS(,u,u,);
|
_EIGEN_ACCUMULATE_PACKETS(d,du,du);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
for (int j = alignedStart; j<alignedSize; j+=PacketSize)
|
||||||
_EIGEN_ACCUMULATE_PACKETS(u,u,u,);
|
_EIGEN_ACCUMULATE_PACKETS(du,du,du);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tmp0 += ei_predux(ptmp0);
|
tmp0 += ei_predux(ptmp0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user