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++)
59 Packet line = internal::ploadu<Packet>(data +
SCATTER(i,j,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);
117 Packet pktD = internal::ploadu<Packet>(d +
GET(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++)
146 Packet
p = internal::pset1<Packet>(
static_cast<Scalar>(1));
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>();
void comparePacketBlock(Scalar *data, int i, int j, int stride, internal::PacketBlock< Packet, n > &block)
#define CALL_SUBTEST_6(FUNC)
#define CALL_SUBTEST_4(FUNC)
m m block(1, 0, 2, 2)<< 4
#define CALL_SUBTEST_3(FUNC)
#define CALL_SUBTEST_7(FUNC)
EIGEN_DECLARE_TEST(blasutil)
#define VERIFY_IS_EQUAL(a, b)
#define CALL_SUBTEST_1(FUNC)
Array< int, Dynamic, 1 > v
internal::packet_traits< Scalar >::type Packet
#define CALL_SUBTEST_8(FUNC)
void setPacketBlock(internal::PacketBlock< Packet, n > &block, Scalar value)
#define CALL_SUBTEST_5(FUNC)
#define CALL_SUBTEST_2(FUNC)
void compare(const Packet &a, const Packet &b)