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
Kaushik Kulkarni
loopy
Commits
5ac94e9e
Commit
5ac94e9e
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Try two strategies for finding base indices/lengths
parent
f8fcbec2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
loopy/diagnostic.py
+4
-0
4 additions, 0 deletions
loopy/diagnostic.py
loopy/isl_helpers.py
+1
-1
1 addition, 1 deletion
loopy/isl_helpers.py
loopy/kernel/tools.py
+36
-8
36 additions, 8 deletions
loopy/kernel/tools.py
with
41 additions
and
9 deletions
loopy/diagnostic.py
+
4
−
0
View file @
5ac94e9e
...
@@ -78,6 +78,10 @@ class AutomaticTestFailure(LoopyError):
...
@@ -78,6 +78,10 @@ class AutomaticTestFailure(LoopyError):
pass
pass
class
StaticValueFindingError
(
LoopyError
):
pass
class
DependencyTypeInferenceFailure
(
TypeInferenceFailure
):
class
DependencyTypeInferenceFailure
(
TypeInferenceFailure
):
def
__init__
(
self
,
message
,
symbol
):
def
__init__
(
self
,
message
,
symbol
):
TypeInferenceFailure
.
__init__
(
self
,
message
)
TypeInferenceFailure
.
__init__
(
self
,
message
)
...
...
This diff is collapsed.
Click to expand it.
loopy/isl_helpers.py
+
1
−
1
View file @
5ac94e9e
...
@@ -196,7 +196,7 @@ def static_extremum_of_pw_aff(pw_aff, constants_only, set_method, what, context)
...
@@ -196,7 +196,7 @@ def static_extremum_of_pw_aff(pw_aff, constants_only, set_method, what, context)
# }}}
# }}}
raise
Value
Error
(
"
a static %s was not found for PwAff
'
%s
'"
raise
StaticValueFinding
Error
(
"
a static %s was not found for PwAff
'
%s
'"
%
(
what
,
pw_aff
))
%
(
what
,
pw_aff
))
...
...
This diff is collapsed.
Click to expand it.
loopy/kernel/tools.py
+
36
−
8
View file @
5ac94e9e
...
@@ -292,21 +292,49 @@ class SetOperationCacheManager:
...
@@ -292,21 +292,49 @@ class SetOperationCacheManager:
lower_bound_pw_aff
=
self
.
dim_min
(
set
,
idx
)
lower_bound_pw_aff
=
self
.
dim_min
(
set
,
idx
)
upper_bound_pw_aff
=
self
.
dim_max
(
set
,
idx
)
upper_bound_pw_aff
=
self
.
dim_max
(
set
,
idx
)
from
loopy.isl_helpers
import
static_max_of_pw_aff
,
static_value_of_pw_aff
from
loopy.diagnostic
import
StaticValueFindingError
from
loopy.isl_helpers
import
(
static_max_of_pw_aff
,
static_min_of_pw_aff
,
static_value_of_pw_aff
)
from
loopy.symbolic
import
pw_aff_to_expr
from
loopy.symbolic
import
pw_aff_to_expr
# {{{ first: try to find static lower bound value
try
:
base_index_aff
=
static_value_of_pw_aff
(
lower_bound_pw_aff
,
constants_only
=
False
,
context
=
context
)
except
StaticValueFindingError
:
base_index_aff
=
None
if
base_index_aff
is
not
None
:
base_index
=
pw_aff_to_expr
(
base_index_aff
)
size
=
pw_aff_to_expr
(
static_max_of_pw_aff
(
upper_bound_pw_aff
-
base_index_aff
+
1
,
constants_only
=
False
,
context
=
context
))
return
base_index
,
size
# }}}
# {{{ if that didn't work, try finding a lower bound
base_index_aff
=
static_min_of_pw_aff
(
lower_bound_pw_aff
,
constants_only
=
False
,
context
=
context
)
base_index
=
pw_aff_to_expr
(
base_index_aff
)
size
=
pw_aff_to_expr
(
static_max_of_pw_aff
(
size
=
pw_aff_to_expr
(
static_max_of_pw_aff
(
upper_bound_pw_aff
-
lower_bound_pw
_aff
+
1
,
constants_only
=
False
,
upper_bound_pw_aff
-
base_index
_aff
+
1
,
constants_only
=
False
,
context
=
context
))
context
=
context
))
try
:
base_index
=
pw_aff_to_expr
(
static_value_of_pw_aff
(
lower_bound_pw_aff
,
constants_only
=
False
,
context
=
context
))
except
Exception
as
e
:
raise
type
(
e
)(
"
while finding lower bound of
'
%s
'
: %s
"
%
(
iname
,
str
(
e
)))
return
base_index
,
size
return
base_index
,
size
# }}}
# }}}
# }}}
...
...
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