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
8ec4984d
Commit
8ec4984d
authored
7 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
get_access_range: Be more robust/consistent about catching and reporting errors
parent
498f8eb0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
loopy/check.py
+4
-6
4 additions, 6 deletions
loopy/check.py
loopy/symbolic.py
+22
-4
22 additions, 4 deletions
loopy/symbolic.py
with
26 additions
and
10 deletions
loopy/check.py
+
4
−
6
View file @
8ec4984d
...
...
@@ -279,7 +279,8 @@ class _AccessCheckMapper(WalkMapper):
if
not
isinstance
(
subscript
,
tuple
):
subscript
=
(
subscript
,)
from
loopy.symbolic
import
get_dependencies
,
get_access_range
from
loopy.symbolic
import
(
get_dependencies
,
get_access_range
,
UnableToDetermineAccessRange
)
available_vars
=
set
(
self
.
domain
.
get_var_dict
())
shape_deps
=
set
()
...
...
@@ -300,11 +301,8 @@ class _AccessCheckMapper(WalkMapper):
try
:
access_range
=
get_access_range
(
self
.
domain
,
subscript
,
self
.
kernel
.
assumptions
)
except
isl
.
Error
:
# Likely: index was non-linear, nothing we can do.
return
except
TypeError
:
# Likely: index was non-linear, nothing we can do.
except
UnableToDetermineAccessRange
:
# Likely: index was non-affine, nothing we can do.
return
shape_domain
=
isl
.
BasicSet
.
universe
(
access_range
.
get_space
())
...
...
This diff is collapsed.
Click to expand it.
loopy/symbolic.py
+
22
−
4
View file @
8ec4984d
...
...
@@ -1537,6 +1537,10 @@ class PrimeAdder(IdentityMapper):
# {{{ get access range
class
UnableToDetermineAccessRange
(
Exception
):
pass
def
get_access_range
(
domain
,
subscript
,
assumptions
):
domain
,
assumptions
=
isl
.
align_two
(
domain
,
assumptions
)
...
...
@@ -1558,8 +1562,17 @@ def get_access_range(domain, subscript, assumptions):
access_map
=
access_map
.
insert_dims
(
dim_type
.
set
,
dn
,
dims
)
for
idim
in
range
(
dims
):
idx_aff
=
aff_from_expr
(
access_map
.
get_space
(),
subscript
[
idim
])
sub_idim
=
subscript
[
idim
]
with
isl
.
SuppressedWarnings
(
domain
.
get_ctx
()):
try
:
idx_aff
=
aff_from_expr
(
access_map
.
get_space
(),
sub_idim
)
except
TypeError
as
e
:
raise
UnableToDetermineAccessRange
(
"
%s: %s
"
%
(
type
(
e
).
__name__
,
str
(
e
)))
except
isl
.
Error
as
e
:
raise
UnableToDetermineAccessRange
(
"
%s: %s
"
%
(
type
(
e
).
__name__
,
str
(
e
)))
idx_aff
=
idx_aff
.
set_coefficient_val
(
dim_type
.
in_
,
dn
+
idim
,
-
1
)
...
...
@@ -1604,7 +1617,12 @@ class BatchedAccessRangeMapper(WalkMapper):
self
.
bad_subscripts
[
arg_name
].
append
(
expr
)
return
access_range
=
get_access_range
(
domain
,
subscript
,
self
.
kernel
.
assumptions
)
try
:
access_range
=
get_access_range
(
domain
,
subscript
,
self
.
kernel
.
assumptions
)
except
UnableToDetermineAccessRange
:
self
.
bad_subscripts
[
arg_name
].
append
(
expr
)
return
if
self
.
access_ranges
[
arg_name
]
is
None
:
self
.
access_ranges
[
arg_name
]
=
access_range
...
...
@@ -1652,7 +1670,7 @@ class AccessRangeMapper(object):
# }}}
# {{{ do_access_ranges_overlap
# {{{ do_access_ranges_overlap
_conservative
def
_get_access_range_conservative
(
kernel
,
insn_id
,
access_dir
,
var_name
):
insn
=
kernel
.
id_to_insn
[
insn_id
]
...
...
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