Skip to content
Snippets Groups Projects
Commit 988b59f1 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Use latest loopy and modify patch

parent aa238252
No related branches found
No related tags found
No related merge requests found
diff --git a/loopy/check.py b/loopy/check.py diff --git a/loopy/check.py b/loopy/check.py
index 12f2366..1898c27 100644 index 2f48211..1446d07 100644
--- a/loopy/check.py --- a/loopy/check.py
+++ b/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) shape_domain = shape_domain.intersect(slab)
...@@ -10,71 +10,10 @@ index 12f2366..1898c27 100644 ...@@ -10,71 +10,10 @@ index 12f2366..1898c27 100644
- raise LoopyError("'%s' in instruction '%s' " - raise LoopyError("'%s' in instruction '%s' "
- "accesses out-of-bounds array element" - "accesses out-of-bounds array element"
- % (expr, self.insn_id)) - % (expr, self.insn_id))
+# if not access_range.is_subset(shape_domain): +# if not access_range.is_subset(shape_domain):
+# raise LoopyError("'%s' in instruction '%s' " +# raise LoopyError("'%s' in instruction '%s' "
+# "accesses out-of-bounds array element" +# "accesses out-of-bounds array element"
+# % (expr, self.insn_id)) +# % (expr, self.insn_id))
def check_bounds(kernel): 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,
Subproject commit 4b6e96459ee01ed88a94ef704f17a439a0d4df2e Subproject commit dfecf6a789b1bb6a605908dedb2f5177ec94d5d2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment