From ab773c7e914633ec4a3ee1f7cdea8b168d3bce1a Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Fri, 24 Apr 2020 17:29:25 -0700 Subject: Extend support for Packet16b: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add ptranspose<*,4> to support matmul and add unit test for Matrix * Matrix * work around a bug in slicing of Tensor. * Add tensor tests This speeds up matmul for boolean matrices by about 10x name old time/op new time/op delta BM_MatMul/8 267ns ± 0% 479ns ± 0% +79.25% (p=0.008 n=5+5) BM_MatMul/32 6.42µs ± 0% 0.87µs ± 0% -86.50% (p=0.008 n=5+5) BM_MatMul/64 43.3µs ± 0% 5.9µs ± 0% -86.42% (p=0.008 n=5+5) BM_MatMul/128 315µs ± 0% 44µs ± 0% -85.98% (p=0.008 n=5+5) BM_MatMul/256 2.41ms ± 0% 0.34ms ± 0% -85.68% (p=0.008 n=5+5) BM_MatMul/512 18.8ms ± 0% 2.7ms ± 0% -85.53% (p=0.008 n=5+5) BM_MatMul/1k 149ms ± 0% 22ms ± 0% -85.40% (p=0.008 n=5+5) --- test/product_small.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'test/product_small.cpp') diff --git a/test/product_small.cpp b/test/product_small.cpp index b8ce37d90..93876dba4 100644 --- a/test/product_small.cpp +++ b/test/product_small.cpp @@ -56,6 +56,31 @@ test_lazy_single(int rows, int cols, int depth) VERIFY_IS_APPROX(C+=A.lazyProduct(B), ref_prod(D,A,B)); } +template +void test_dynamic_exact() +{ + int rows = internal::random(1,64); + int cols = internal::random(1,64); + int depth = internal::random(1,65); + + typedef Matrix MatrixX; + MatrixX A(rows,depth); A.setRandom(); + MatrixX B(depth,cols); B.setRandom(); + MatrixX C(rows,cols); C.setRandom(); + MatrixX D(C); + for(Index i=0;i typename internal::enable_if< ( (Rows ==1&&Depth!=1&&OA==ColMajor) || (Depth==1&&Rows !=1&&OA==RowMajor) @@ -78,7 +103,7 @@ void test_lazy_all_layout(int rows=Rows, int cols=Cols, int depth=Depth) CALL_SUBTEST(( test_lazy_single(rows,cols,depth) )); CALL_SUBTEST(( test_lazy_single(rows,cols,depth) )); CALL_SUBTEST(( test_lazy_single(rows,cols,depth) )); -} +} template void test_lazy_l1() @@ -291,6 +316,8 @@ EIGEN_DECLARE_TEST(product_small) CALL_SUBTEST_6( bug_1311<3>() ); CALL_SUBTEST_6( bug_1311<5>() ); + + CALL_SUBTEST_9( test_dynamic_exact() ); } CALL_SUBTEST_6( product_small_regressions<0>() ); -- cgit v1.2.3