From 988b59f13bb70d29728288e829d29fc53d2f8236 Mon Sep 17 00:00:00 2001 From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de> Date: Wed, 5 Oct 2016 14:55:25 +0200 Subject: [PATCH] Use latest loopy and modify patch --- patches/loopy/Current.patch | 73 +++---------------------------------- python/loopy | 2 +- 2 files changed, 7 insertions(+), 68 deletions(-) diff --git a/patches/loopy/Current.patch b/patches/loopy/Current.patch index 4549a2f9..efb0a773 100644 --- a/patches/loopy/Current.patch +++ b/patches/loopy/Current.patch @@ -1,8 +1,8 @@ diff --git a/loopy/check.py b/loopy/check.py -index 12f2366..1898c27 100644 +index 2f48211..1446d07 100644 --- a/loopy/check.py +++ b/loopy/check.py -@@ -262,10 +262,10 @@ class _AccessCheckMapper(WalkMapper): +@@ -286,10 +286,10 @@ class _AccessCheckMapper(WalkMapper): shape_domain = shape_domain.intersect(slab) @@ -10,71 +10,10 @@ index 12f2366..1898c27 100644 - raise LoopyError("'%s' in instruction '%s' " - "accesses out-of-bounds array element" - % (expr, self.insn_id)) -+# if not access_range.is_subset(shape_domain): -+# raise LoopyError("'%s' in instruction '%s' " -+# "accesses out-of-bounds array element" -+# % (expr, self.insn_id)) ++# if not access_range.is_subset(shape_domain): ++# raise LoopyError("'%s' in instruction '%s' " ++# "accesses out-of-bounds array element" ++# % (expr, self.insn_id)) def check_bounds(kernel): -diff --git a/loopy/kernel/data.py b/loopy/kernel/data.py -index a884fb0..1349be3 100644 ---- a/loopy/kernel/data.py -+++ b/loopy/kernel/data.py -@@ -1376,7 +1376,10 @@ class CallInstruction(MultiAssignmentBase): - for a in self.assignees) - - def with_transformed_expressions(self, f, *args): -- return self.copy( -+ if len(self.assignees) == 0: -+ return self.copy(assignees=[], expression=f(self.expression, *args)) -+ else: -+ return self.copy( - assignees=f(self.assignees, *args), - expression=f(self.expression, *args)) - -diff --git a/loopy/preprocess.py b/loopy/preprocess.py -index 9738777..cc2f140 100644 ---- a/loopy/preprocess.py -+++ b/loopy/preprocess.py -@@ -871,13 +871,23 @@ def realize_reduction(kernel, insn_id_filter=None, unknown_types_ok=True): - kwargs.pop("temp_var_type", None) - kwargs.pop("temp_var_types", None) - -- replacement_insns = [ -+ if isinstance(insn, lp.Assignment): -+ replacement_insns = [ - lp.Assignment( - id=insn_id_gen(insn.id), - assignee=assignee, - expression=new_expr, - **kwargs) - for assignee, new_expr in zip(insn.assignees, new_expressions)] -+ -+ if isinstance(insn, lp.CallInstruction): -+ assert len(new_expressions) == 1 -+ replacement_insns = [ -+ lp.CallInstruction( -+ id=insn_id_gen(insn.id), -+ assignees=insn.assignees, -+ expression=new_expressions[0], -+ **kwargs)] - - insn_id_replacements[insn.id] = [ - rinsn.id for rinsn in replacement_insns] -diff --git a/loopy/target/c/__init__.py b/loopy/target/c/__init__.py -index e7c8aba..7580038 100644 ---- a/loopy/target/c/__init__.py -+++ b/loopy/target/c/__init__.py -@@ -553,6 +553,11 @@ class CASTBuilder(ASTBuilderBase): - - result = "%s(%s)" % (mangle_result.target_name, ", ".join(str_parameters)) - -+ # In case of no assignees, we are done -+ if len(mangle_result.result_dtypes) == 0: -+ from cgen import Line -+ return Line(result + ';') -+ - result = ecm.wrap_in_typecast( - mangle_result.result_dtypes[0], - assignee_var_descriptors[0].dtype, diff --git a/python/loopy b/python/loopy index 4b6e9645..dfecf6a7 160000 --- a/python/loopy +++ b/python/loopy @@ -1 +1 @@ -Subproject commit 4b6e96459ee01ed88a94ef704f17a439a0d4df2e +Subproject commit dfecf6a789b1bb6a605908dedb2f5177ec94d5d2 -- GitLab