From 4ff930e3597b5e4d4e89c6ea5d56d0708e84f26f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20He=C3=9F?= <rene.hess@iwr.uni-heidelberg.de>
Date: Tue, 17 Jan 2017 09:48:47 +0100
Subject: [PATCH] Make permutation and vectorization possible

---
 python/dune/perftool/sumfact/sumfact.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/python/dune/perftool/sumfact/sumfact.py b/python/dune/perftool/sumfact/sumfact.py
index 0ee51952..e2b1b6ed 100644
--- a/python/dune/perftool/sumfact/sumfact.py
+++ b/python/dune/perftool/sumfact/sumfact.py
@@ -546,25 +546,24 @@ def sum_factorization_kernel(a_matrices,
         # * an input temporary (default)
         # * a global data structure (if FastDGGridOperator is in use)
         # * a value from a global data structure, broadcasted to a vector type (vectorized + FastDGGridOperator)
+        input_inames = (k_expr,) + tuple(prim.Variable(j) for j in out_inames[1:])
         if l == 0 and direct_input is not None:
+            # See comment bellow
+            input_inames = _permute_backward(input_inames, perm)
+
             globalarg(direct_input, dtype=np.float64, shape=inp_shape)
             if a_matrix.vectorized:
-                # palpo TODO
-                assert(False)
                 input_summand = prim.Call(prim.Variable("Vec4d"),
                                           (prim.Subscript(prim.Variable(direct_input),
-                                                          (k_expr,) + tuple(prim.Variable(j) for j in out_inames[1:])),))
+                                                          input_inames)))
             else:
-                # palpo TODO
-                assert(False)
                 input_summand = prim.Subscript(prim.Variable(direct_input),
-                                               palpo + vec_iname)
+                                               input_inames + vec_iname)
         else:
             # If we did permute the order of a matrices above we also
             # permuted the order of out_inames. Unfortunately the
             # order of our input is from 0 to d-1. This means we need
             # to permute _back_ to get the right coefficients.
-            input_inames = (k_expr,) + tuple(prim.Variable(j) for j in out_inames[1:])
             if l == 0:
                 inp_shape = _permute_backward(inp_shape, perm)
                 input_inames = _permute_backward(input_inames, perm)
-- 
GitLab