From bc9a8014ec4ba823105badcbce02aa63d1c38aad Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sat, 25 Jul 2015 21:13:10 -0500
Subject: [PATCH] Fix boxify to return domain with only box_inames modified,
 not the entire domain replaced by a box on those iname

---
 loopy/isl_helpers.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/loopy/isl_helpers.py b/loopy/isl_helpers.py
index a3a2a8d88..e3996ec6b 100644
--- a/loopy/isl_helpers.py
+++ b/loopy/isl_helpers.py
@@ -324,10 +324,12 @@ def boxify(cache_manager, domain, box_inames, context):
     domain = domain.move_dims(
             dim_type.param, n_old_parameters, dim_type.set, 0, n_nonbox_inames)
 
-    result = domain.universe(domain.space)
+    result = domain
     zero = isl.Aff.zero_on_domain(result.space)
 
     for i in range(len(box_iname_indices)):
+        result = result.eliminate(dim_type.set, i, 1)
+
         iname_aff = zero.add_coefficient_val(dim_type.in_, i, 1)
 
         def add_in_dims(aff):
-- 
GitLab