Created the ptranspose packet primitive that can transpose an array of N packets, where N is the number of words in each packet. This primitive will be used to complete the vectorization of the gemm_pack_lhs and gemm_pack_rhs functions.

Implemented the primitive using SSE instructions.
This commit is contained in:
Benoit Steiner
2014-03-26 19:03:07 -07:00
parent 14bc4b9704
commit a419cea4a0
4 changed files with 61 additions and 1 deletions

View File

@@ -208,6 +208,18 @@ template<typename Scalar> void packetmath()
ref[i] = data1[PacketSize-i-1];
internal::pstore(data2, internal::preverse(internal::pload<Packet>(data1)));
VERIFY(areApprox(ref, data2, PacketSize) && "internal::preverse");
internal::Kernel<Packet> kernel;
for (int i=0; i<PacketSize; ++i) {
kernel.packet[i] = internal::pload<Packet>(data1+i*PacketSize);
}
ptranspose(kernel);
for (int i=0; i<PacketSize; ++i) {
internal::pstore(data2, kernel.packet[i]);
for (int j = 0; j < PacketSize; ++j) {
VERIFY(isApproxAbs(data2[j], data1[i+j*PacketSize], refvalue));
}
}
}
template<typename Scalar> void packetmath_real()