diff options
author | Jakub Lichman <jlichman@tachyum.com> | 2021-05-19 08:26:45 +0000 |
---|---|---|
committer | Jakub Lichman <jlichman@tachyum.com> | 2021-05-19 08:26:45 +0000 |
commit | 8877f8d9b2631301ba070d645cdc3fc9b9f764f5 (patch) | |
tree | d12cf35620fdca1fa4371d297a74979468fc36b0 | |
parent | 3e006bfd31e4389e8c5718c30409cddb65a73b04 (diff) |
ptranpose test for non-square kernels added
-rw-r--r-- | test/packetmath.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 0bb511d5a..18357df5e 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -548,6 +548,25 @@ void packetmath() { } } + const int m_size = PacketSize < 4 ? 1 : 4; + internal::PacketBlock<Packet, m_size> kernel2; + for (int i = 0; i < m_size; ++i) { + kernel2.packet[i] = internal::pload<Packet>(data1 + i * PacketSize); + } + ptranspose(kernel2); + int data_counter = 0; + for (int i = 0; i < PacketSize; ++i) { + for (int j = 0; j < m_size; ++j) { + data2[data_counter++] = data1[j*PacketSize + i]; + } + } + for (int i = 0; i < m_size; ++i) { + internal::pstore(data3, kernel2.packet[i]); + for (int j = 0; j < PacketSize; ++j) { + VERIFY(test::isApproxAbs(data3[j], data2[i*PacketSize + j], refvalue) && "ptranspose"); + } + } + if (PacketTraits::HasBlend) { Packet thenPacket = internal::pload<Packet>(data1); Packet elsePacket = internal::pload<Packet>(data2); |