Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loopy
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
Model registry
Operate
Environments
Monitor
Incidents
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
Show more breadcrumbs
Timothy Smith
loopy
Commits
45e9c3e7
Commit
45e9c3e7
authored
7 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Allow names, exprs, and lp.auto for array offsets
parent
255ad96e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/kernel/array.py
+12
-5
12 additions, 5 deletions
loopy/kernel/array.py
with
12 additions
and
5 deletions
loopy/kernel/array.py
+
12
−
5
View file @
45e9c3e7
...
@@ -1036,7 +1036,9 @@ class ArrayBase(ImmutableRecord):
...
@@ -1036,7 +1036,9 @@ class ArrayBase(ImmutableRecord):
is_written
=
is_written
)
is_written
=
is_written
)
if
self
.
offset
:
import
loopy
as
lp
if
self
.
offset
is
lp
.
auto
:
offset_name
=
full_name
+
"
_offset
"
offset_name
=
full_name
+
"
_offset
"
yield
ImplementedDataInfo
(
yield
ImplementedDataInfo
(
target
=
target
,
target
=
target
,
...
@@ -1202,12 +1204,17 @@ def get_access_info(target, ary, index, eval_expr, vectorization_info):
...
@@ -1202,12 +1204,17 @@ def get_access_info(target, ary, index, eval_expr, vectorization_info):
return
result
return
result
def
apply_offset
(
sub
):
def
apply_offset
(
sub
):
import
loopy
as
lp
if
ary
.
offset
:
if
ary
.
offset
:
offset_name
=
ary
.
offset
if
ary
.
offset
is
lp
.
auto
:
if
offset_name
is
lp
.
auto
:
offset_name
=
array_name
+
"
_offset
"
offset_name
=
array_name
+
"
_offset
"
elif
isinstance
(
ary
.
offset
,
str
):
return
var
(
offset_name
)
+
sub
offset_name
=
ary
.
offset
return
var
(
offset_name
)
+
sub
else
:
# assume it's an expression
return
ary
.
offset
+
sub
else
:
else
:
return
sub
return
sub
...
...
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