16 #if EIGEN_GNUC_AT_LEAST(6,0)
17 #pragma GCC diagnostic ignored "-Wignored-attributes"
20 #define GET(i,j) (StorageOrder == RowMajor ? (i)*stride + (j) : (i) + (j)*stride)
21 #define SCATTER(i,j,k) (StorageOrder == RowMajor ? ((i)+(k))*stride + (j) : (i) + ((j)+(k))*stride)
23 template<
typename Scalar,
typename Packet>
30 internal::pstoreu<Scalar, Packet>(buffA,
a);
31 internal::pstoreu<Scalar, Packet>(buffB,
b);
33 for(
int i = 0;
i < pktsz;
i++)
42 template<
typename Scalar,
int StorageOrder,
int n>
49 for(
int idx = 0; idx <
n; idx++)
51 block.packet[idx] = internal::pset1<Packet>(
value);
57 for(
int idx = 0; idx <
n; idx++)
60 compare<Scalar, Packet>(
block.packet[idx], line);
65 template<
typename Scalar,
int StorageOrder,
int BlockSize>
68 typedef internal::blas_data_mapper<Scalar, int, StorageOrder> BlasDataMapper;
70 int minSize = std::max<int>(packetSize, BlockSize);
73 int szm = internal::random<int>(minSize,500), szn = internal::random<int>(minSize,500);
74 int stride = StorageOrder ==
RowMajor ? szn : szm;
78 for(
int i = 0;
i < szm*szn;
i++)
80 d[
i] = internal::random<Scalar>(
static_cast<Scalar>(3),
static_cast<Scalar>(10));
83 BlasDataMapper bdm(
d, stride);
86 for(
int i = 0;
i < szm;
i++)
88 for(
int j = 0;
j < szn;
j++)
95 int i0 = internal::random<int>(0,szm-2);
96 int j0 = internal::random<int>(0,szn-2);
97 for(
int i =
i0;
i < szm;
i++)
99 for(
int j =
j0;
j < szn;
j++)
101 const BlasDataMapper& bdmSM = bdm.getSubMapper(
i0,
j0);
102 const internal::BlasLinearMapper<Scalar, int, 0>& bdmLM = bdm.getLinearMapper(
i0,
j0);
112 for(
int i = 0;
i < szm - minSize;
i++)
114 for(
int j = 0;
j < szn - minSize;
j++)
116 Packet pktBDM = bdm.template loadPacket<Packet>(
i,
j);
119 compare<Scalar, Packet>(pktBDM, pktD);
125 for(
int i = 0;
i < szm - minSize;
i++)
127 for(
int j = 0;
j < szn - minSize;
j++)
129 Packet p = bdm.template gatherPacket<Packet>(
i,
j);
130 internal::pstoreu<Scalar, Packet>(buff,
p);
132 for(
int k = 0; k < packetSize; k++)
142 for(
int i = 0;
i < szm - minSize;
i++)
144 for(
int j = 0;
j < szn - minSize;
j++)
147 bdm.template scatterPacket<Packet>(
i,
j,
p);
148 for(
int k = 0; k < packetSize; k++)
156 internal::PacketBlock<Packet, BlockSize>
block;
161 for(
int i = 0;
i < szm - minSize;
i++)
163 for(
int j = 0;
j < szn - minSize;
j++)
165 bdm.template storePacketBlock<Packet, BlockSize>(
i,
j,
block);
174 template<
typename Scalar>
177 run_bdmp_spec_1<Scalar, RowMajor, 1>();
178 run_bdmp_spec_1<Scalar, ColMajor, 1>();
179 run_bdmp_spec_1<Scalar, RowMajor, 2>();
180 run_bdmp_spec_1<Scalar, ColMajor, 2>();
181 run_bdmp_spec_1<Scalar, RowMajor, 4>();
182 run_bdmp_spec_1<Scalar, ColMajor, 4>();
183 run_bdmp_spec_1<Scalar, RowMajor, 8>();
184 run_bdmp_spec_1<Scalar, ColMajor, 8>();
185 run_bdmp_spec_1<Scalar, RowMajor, 16>();
186 run_bdmp_spec_1<Scalar, ColMajor, 16>();