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
Ben Sepanski
loopy
Commits
7882e8ef
Commit
7882e8ef
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Add store_instruction=False to buffer_array
parent
1980520b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/transform/buffer.py
+17
-8
17 additions, 8 deletions
loopy/transform/buffer.py
with
17 additions
and
8 deletions
loopy/transform/buffer.py
+
17
−
8
View file @
7882e8ef
...
...
@@ -136,8 +136,11 @@ def buffer_array(kernel, var_name, buffer_inames, init_expression=None,
array should be read) or an expression optionally involving the
variable
'
base
'
(which references the associated location in the array
being buffered).
:arg store_expression: Either *None* or an expression involving
:arg store_expression: Either *None*
, *False*,
or an expression involving
variables
'
base
'
and
'
buffer
'
(without array indices).
(*None* indicates that a default storage instruction should be used,
*False* indicates that no storing of the temporary should occur
at all.)
"""
# {{{ process arguments
...
...
@@ -426,19 +429,25 @@ def buffer_array(kernel, var_name, buffer_inames, init_expression=None,
"
buffer
"
:
buf_var_store
,
}))(
store_expression
)
from
loopy.kernel.data
import
Assignment
store_instruction
=
Assignment
(
id
=
kernel
.
make_unique_instruction_id
(
based_on
=
"
store_
"
+
var_name
),
depends_on
=
frozenset
(
aar
.
modified_insn_ids
),
assignee
=
store_target
,
expression
=
store_expression
,
forced_iname_deps
=
frozenset
(
within_inames
))
if
store_expression
is
not
False
:
from
loopy.kernel.data
import
Assignment
store_instruction
=
Assignment
(
id
=
kernel
.
make_unique_instruction_id
(
based_on
=
"
store_
"
+
var_name
),
depends_on
=
frozenset
(
aar
.
modified_insn_ids
),
assignee
=
store_target
,
expression
=
store_expression
,
forced_iname_deps
=
frozenset
(
within_inames
))
else
:
did_write
=
False
# }}}
new_insns
.
append
(
init_instruction
)
if
did_write
:
new_insns
.
append
(
store_instruction
)
else
:
for
iname
in
store_inames
:
del
new_iname_to_tag
[
iname
]
kernel
=
kernel
.
copy
(
domains
=
new_kernel_domains
,
...
...
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