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
64f43157
There was a problem fetching the pipeline summary.
Commit
64f43157
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Automatic axis assignment: Detect, avoid unbounded axes
parent
8b29c09a
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/kernel/tools.py
+14
-3
14 additions, 3 deletions
loopy/kernel/tools.py
with
14 additions
and
3 deletions
loopy/kernel/tools.py
+
14
−
3
View file @
64f43157
...
@@ -28,6 +28,7 @@ import six
...
@@ -28,6 +28,7 @@ import six
from
six.moves
import
intern
from
six.moves
import
intern
import
numpy
as
np
import
numpy
as
np
import
islpy
as
isl
from
islpy
import
dim_type
from
islpy
import
dim_type
from
loopy.diagnostic
import
LoopyError
from
loopy.diagnostic
import
LoopyError
...
@@ -768,7 +769,13 @@ def assign_automatic_axes(kernel, axis=0, local_size=None):
...
@@ -768,7 +769,13 @@ def assign_automatic_axes(kernel, axis=0, local_size=None):
If *axis* is None, find a suitable axis automatically.
If *axis* is None, find a suitable axis automatically.
"""
"""
desired_length
=
kernel
.
get_constant_iname_length
(
iname
)
try
:
desired_length
=
kernel
.
get_constant_iname_length
(
iname
)
except
isl
.
Error
:
# Likely unbounded, automatic assignment is not
# going to happen for this iname
return
assign_automatic_axes
(
kernel
,
axis
=
recursion_axis
,
local_size
=
local_size
)
if
axis
is
None
:
if
axis
is
None
:
# {{{ find a suitable axis
# {{{ find a suitable axis
...
@@ -870,10 +877,14 @@ def assign_automatic_axes(kernel, axis=0, local_size=None):
...
@@ -870,10 +877,14 @@ def assign_automatic_axes(kernel, axis=0, local_size=None):
# "invalid" pass: There are still unassigned axis after the
# "invalid" pass: There are still unassigned axis after the
# numbered "valid" passes--assign the remainder by length.
# numbered "valid" passes--assign the remainder by length.
def
get_iname_length
(
iname
):
try
:
return
kernel
.
get_constant_iname_length
(
iname
)
except
isl
.
Error
:
return
-
1
# assign longest auto axis inames first
# assign longest auto axis inames first
auto_axis_inames
.
sort
(
auto_axis_inames
.
sort
(
key
=
lambda
iname
:
(
key
=
get_iname_length
,
kernel
.
get_constant_iname_length
(
iname
),
iname
),
reverse
=
True
)
reverse
=
True
)
if
auto_axis_inames
:
if
auto_axis_inames
:
...
...
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