Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-codegen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Christian Heinigk
dune-codegen
Commits
59709b52
Commit
59709b52
authored
8 years ago
by
Dominic Kempf
Browse files
Options
Downloads
Patches
Plain Diff
Update current patching
parent
b2bce5c2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
patches/loopy/0001-Some-modification-to-index-code-generation.patch
+0
-89
0 additions, 89 deletions
...opy/0001-Some-modification-to-index-code-generation.patch
patches/loopy/Current.patch
+80
-0
80 additions, 0 deletions
patches/loopy/Current.patch
with
80 additions
and
89 deletions
patches/loopy/0001-Some-modification-to-index-code-generation.patch
deleted
100644 → 0
+
0
−
89
View file @
b2bce5c2
From 8e23fd619d75ec67446052b1e5779e49718b3ec7 Mon Sep 17 00:00:00 2001
From: Dominic Kempf <dominic.r.kempf@gmail.com>
Date: Wed, 30 Dec 2015 17:34:09 +0100
Subject: Some modification to index code generation
---
loopy/target/c/codegen/expression.py | 66 +++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 31 deletions(-)
diff --git a/loopy/target/c/codegen/expression.py b/loopy/target/c/codegen/expression.py
index 71844cf..9e4452e 100644
--- a/loopy/target/c/codegen/expression.py
+++ b/loopy/target/c/codegen/expression.py
@@ -191,37 +191,41 @@
class LoopyCCodeMapper(RecursiveMapper):
"non-floating-point images not supported for now")
elif isinstance(ary, (GlobalArg, TemporaryVariable)):
- if len(access_info.subscripts) == 0:
- if isinstance(ary, GlobalArg):
- # unsubscripted global args are pointers
- if vec_member is not None:
- return "%s->%s" % (
- access_info.array_name,
- vec_member)
- else:
- return "*" + access_info.array_name
-
- else:
- # unsubscripted temp vars are scalars
- if vec_member is not None:
- return "%s.%s" % (
- access_info.array_name,
- vec_member)
- else:
- return access_info.array_name
-
- else:
- subscript, = access_info.subscripts
- result = self.parenthesize_if_needed(
- "%s[%s]" % (
- access_info.array_name,
- self.rec(subscript, PREC_NONE, 'i')),
- enclosing_prec, PREC_CALL)
-
- if vec_member:
- result += "."+vec_member
-
- return result
+ result = access_info.array_name
+ for i in expr.index:
+ result = result + "[{}]".format(i.name)
+ return result
+# if len(access_info.subscripts) == 0:
+# if isinstance(ary, GlobalArg):
+# # unsubscripted global args are pointers
+# if vec_member is not None:
+# return "%s->%s" % (
+# access_info.array_name,
+# vec_member)
+# else:
+# return "*" + access_info.array_name
+#
+# else:
+# # unsubscripted temp vars are scalars
+# if vec_member is not None:
+# return "%s.%s" % (
+# access_info.array_name,
+# vec_member)
+# else:
+# return access_info.array_name
+#
+# else:
+# subscript, = access_info.subscripts
+# result = self.parenthesize_if_needed(
+# "%s[%s]" % (
+# access_info.array_name,
+# self.rec(subscript, PREC_NONE, 'i')),
+# enclosing_prec, PREC_CALL)
+#
+# if vec_member:
+# result += "."+vec_member
+#
+# return result
else:
assert False
--
1.9.1
This diff is collapsed.
Click to expand it.
patches/loopy/Current.patch
0 → 100644
+
80
−
0
View file @
59709b52
diff --git a/loopy/check.py b/loopy/check.py
index 12f2366..1898c27 100644
--- a/loopy/check.py
+++ b/loopy/check.py
@@ -262,10 +262,10 @@
class _AccessCheckMapper(WalkMapper):
shape_domain = shape_domain.intersect(slab)
- 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,
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment