From 04cd0ac65a98180f2bf43c19b8645cddffbfa0dd Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Wed, 2 Nov 2011 13:14:21 -0400
Subject: [PATCH] Generate the shapes of ILP accumulators in the correct type.

---
 MEMO                | 4 ++--
 loopy/preprocess.py | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/MEMO b/MEMO
index 6fa8a95c5..19e54706d 100644
--- a/MEMO
+++ b/MEMO
@@ -39,8 +39,6 @@ Things to consider
 To-do
 ^^^^^
 
-- Automatically generate testing code vs. sequential.
-
 - Fix all tests
 
 - Deal with equality constraints.
@@ -83,6 +81,8 @@ Future ideas
 Dealt with
 ^^^^^^^^^^
 
+- Automatically generate testing code vs. sequential.
+
 - If isl can prove that all operands are positive, may use '/' instead of
   'floor_div'.
 
diff --git a/loopy/preprocess.py b/loopy/preprocess.py
index 06807c2e1..a08c2fb3e 100644
--- a/loopy/preprocess.py
+++ b/loopy/preprocess.py
@@ -99,8 +99,10 @@ def realize_reduction(kernel):
         for iname in ilp_inames:
             bounds = kernel.get_iname_bounds(iname)
 
+            from loopy.symbolic import pw_aff_to_expr
             ilp_iname_lengths.append(
-                static_max_of_pw_aff(bounds.size, constants_only=True))
+                    int(pw_aff_to_expr(
+                        static_max_of_pw_aff(bounds.size, constants_only=True))))
 
         # }}}
 
-- 
GitLab