From d21c936f052074a8030f42cca93dc7f381b1e3f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20He=C3=9F?= <rene.hess@iwr.uni-heidelberg.de>
Date: Mon, 19 Dec 2016 14:31:24 +0100
Subject: [PATCH] Avoid direct vector acces for gradvec

At the moment loopy tries to acces a vector class variable and throws
a not implemented error. Probably needs some changes in the horizontal
add code.
---
 python/dune/perftool/sumfact/sumfact.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/python/dune/perftool/sumfact/sumfact.py b/python/dune/perftool/sumfact/sumfact.py
index 1d665e56..41134538 100644
--- a/python/dune/perftool/sumfact/sumfact.py
+++ b/python/dune/perftool/sumfact/sumfact.py
@@ -245,7 +245,11 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
                                )
 
         # In the case of FastDGGridOperator we can write directly into the resiudal/jacobi
-        if get_option('fastdg'):
+        #
+        # TODO: At the moment this only works if we do not vectorize
+        # (over gradients) because loopy tries to acces a vectorclass
+        # variable.
+        if get_option('fastdg') and not index:
             ft = get_global_context_value("form_type")
             if ft=='residual':
                 accum = accum + ".data()"
@@ -255,7 +259,7 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
                 expression = prim.Sum((assignee,result))
                 instruction(assignee=assignee,
                             expression=expression,
-                            forced_iname_deps=frozenset(inames + visitor.inames + vecinames),
+                            forced_iname_deps=frozenset(inames),
                             forced_iname_deps_is_final=True,
                             depends_on=insn_dep,
                             )
@@ -268,7 +272,7 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
                 expression = prim.Sum((assignee,result))
                 instruction(assignee=assignee,
                             expression=expression,
-                            forced_iname_deps=frozenset(inames + visitor.inames + vecinames),
+                            forced_iname_deps=frozenset(inames + visitor.inames),
                             forced_iname_deps_is_final=True,
                             depends_on=insn_dep,
                             )
-- 
GitLab