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
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
Andreas Klöckner
loopy
Commits
fb8e9afb
Commit
fb8e9afb
authored
13 years ago
by
Tim Warburton
Browse files
Options
Downloads
Patches
Plain Diff
Provide better error messages in a few situations.
parent
85194627
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
MEMO
+2
-0
2 additions, 0 deletions
MEMO
loopy/__init__.py
+1
-6
1 addition, 6 deletions
loopy/__init__.py
loopy/kernel.py
+5
-4
5 additions, 4 deletions
loopy/kernel.py
loopy/symbolic.py
+4
-1
4 additions, 1 deletion
loopy/symbolic.py
with
12 additions
and
11 deletions
MEMO
+
2
−
0
View file @
fb8e9afb
...
...
@@ -58,6 +58,8 @@ Things to consider
TODO
^^^^
- assert dependencies <= parent_inames in loopy/__init__.py
???
- FIXME: Deal with insns losing a seq iname dep in a CSE realization
...
...
This diff is collapsed.
Click to expand it.
loopy/__init__.py
+
1
−
6
View file @
fb8e9afb
...
...
@@ -15,11 +15,6 @@ import numpy as np
# TODO list moved to MEMO in root
class
LoopyAdvisory
(
UserWarning
):
pass
...
...
@@ -284,7 +279,7 @@ def realize_cse(kernel, cse_tag, dtype, duplicate_inames=[], parallel_inames=Non
# the iname is *not* a dependency of the fetch expression
if
iname
in
duplicate_inames
:
raise
RuntimeError
(
"
duplicating an iname (
'
%s
'
)
"
raise
RuntimeError
(
"
duplicating an iname (
'
%s
'
)
"
"
that the CSE (
'
%s
'
) does not depend on
"
"
does not make sense
"
%
(
iname
,
expr
.
child
))
...
...
This diff is collapsed.
Click to expand it.
loopy/kernel.py
+
5
−
4
View file @
fb8e9afb
...
...
@@ -625,8 +625,9 @@ class LoopKernel(Record):
all_inames_by_insns
|=
insn
.
all_inames
()
if
all_inames_by_insns
!=
self
.
all_inames
():
raise
RuntimeError
(
"
inames collected from instructions
"
"
do not match domain inames
"
)
raise
RuntimeError
(
"
inames collected from instructions (%s)
"
"
do not match domain inames (%s)
"
%
(
"
,
"
.
join
(
all_inames_by_insns
),
"
,
"
.
join
(
self
.
all_inames
())))
global_sizes
=
{}
local_sizes
=
{}
...
...
@@ -676,8 +677,8 @@ class LoopKernel(Record):
while
cur_axis
>
len
(
size_list
):
from
loopy
import
LoopyAdvisory
from
warnings
import
warn
warn
(
"
%s axis %d unassigned--assuming length 1
"
%
len
(
size_list
),
LoopyAdvisory
)
warn
(
"
%s axis %d unassigned--assuming length 1
"
%
(
which
,
len
(
size_list
)),
LoopyAdvisory
)
size_list
.
append
(
1
)
size_list
.
append
(
size_dict
[
cur_axis
])
...
...
This diff is collapsed.
Click to expand it.
loopy/symbolic.py
+
4
−
1
View file @
fb8e9afb
...
...
@@ -336,12 +336,15 @@ class LoopyCCodeMapper(CCodeMapper):
ary_strides
,
index_expr
))),
enclosing_prec
)
if
expr
.
aggregate
.
name
in
self
.
kernel
.
temporary_variables
:
el
if
expr
.
aggregate
.
name
in
self
.
kernel
.
temporary_variables
:
temp_var
=
self
.
kernel
.
temporary_variables
[
expr
.
aggregate
.
name
]
return
(
temp_var
.
name
+
""
.
join
(
"
[%s]
"
%
self
.
rec
(
idx
,
PREC_NONE
)
for
idx
in
expr
.
index
))
else
:
raise
RuntimeError
(
"
nothing known about variable
'
%s
'"
%
expr
.
aggregate
.
name
)
def
map_floor_div
(
self
,
expr
,
prec
):
if
isinstance
(
expr
.
denominator
,
int
)
and
expr
.
denominator
>
0
:
return
(
"
int_floor_div_pos_b(%s, %s)
"
...
...
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