From 22407db2072149db204328e5e7953138f1c82d60 Mon Sep 17 00:00:00 2001
From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de>
Date: Mon, 25 Jul 2016 18:22:23 +0200
Subject: [PATCH] Use the new iname duplication strategies!

---
 python/dune/perftool/pdelab/localoperator.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/python/dune/perftool/pdelab/localoperator.py b/python/dune/perftool/pdelab/localoperator.py
index 28c46c33..bbd7daf4 100644
--- a/python/dune/perftool/pdelab/localoperator.py
+++ b/python/dune/perftool/pdelab/localoperator.py
@@ -204,6 +204,13 @@ def generate_kernel(integrals):
 
     kernel = preprocess_kernel(kernel)
 
+    # see whether we need iname duplication to make this thing schedulable!
+    # TODO: Use a clever strategy here, instead of random transformation until the problem is resolved
+    from loopy import needs_iname_duplication, get_iname_duplication_options, duplicate_inames
+    while needs_iname_duplication(kernel):
+        inames, within = next(get_iname_duplication_options(kernel))
+        kernel = duplicate_inames(kernel, inames, within)
+
     # Loopy might have introduced some temporary variables during preprocessing. As I want to have my own
     # temporary declaration code right now, I call the declaration preamble manually.
     for added_tv in set(kernel.temporary_variables.keys()) - set(temporaries.keys()):
-- 
GitLab