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
a3e18078
Commit
a3e18078
authored
8 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Use proper attribute to override get_grid_sizes_for_insn_ids
parent
6a8191ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
loopy/kernel/__init__.py
+9
-6
9 additions, 6 deletions
loopy/kernel/__init__.py
loopy/kernel/tools.py
+2
-1
2 additions, 1 deletion
loopy/kernel/tools.py
with
11 additions
and
7 deletions
loopy/kernel/__init__.py
+
9
−
6
View file @
a3e18078
...
@@ -199,7 +199,7 @@ class LoopKernel(ImmutableRecordWithoutPickling):
...
@@ -199,7 +199,7 @@ class LoopKernel(ImmutableRecordWithoutPickling):
# When kernels get intersected in slab decomposition,
# When kernels get intersected in slab decomposition,
# their grid sizes shouldn't change. This provides
# their grid sizes shouldn't change. This provides
# a way to forward sub-kernel grid size requests.
# a way to forward sub-kernel grid size requests.
get_grid_sizes_for_insn_ids
=
None
):
overridden_
get_grid_sizes_for_insn_ids
=
None
):
if
cache_manager
is
None
:
if
cache_manager
is
None
:
from
loopy.kernel.tools
import
SetOperationCacheManager
from
loopy.kernel.tools
import
SetOperationCacheManager
...
@@ -265,10 +265,6 @@ class LoopKernel(ImmutableRecordWithoutPickling):
...
@@ -265,10 +265,6 @@ class LoopKernel(ImmutableRecordWithoutPickling):
if
np
.
iinfo
(
index_dtype
.
numpy_dtype
).
min
>=
0
:
if
np
.
iinfo
(
index_dtype
.
numpy_dtype
).
min
>=
0
:
raise
TypeError
(
"
index_dtype must be signed
"
)
raise
TypeError
(
"
index_dtype must be signed
"
)
if
get_grid_sizes_for_insn_ids
is
not
None
:
# overwrites method down below
self
.
get_grid_sizes_for_insn_ids
=
get_grid_sizes_for_insn_ids
if
state
not
in
[
if
state
not
in
[
kernel_state
.
INITIAL
,
kernel_state
.
INITIAL
,
kernel_state
.
PREPROCESSED
,
kernel_state
.
PREPROCESSED
,
...
@@ -302,7 +298,9 @@ class LoopKernel(ImmutableRecordWithoutPickling):
...
@@ -302,7 +298,9 @@ class LoopKernel(ImmutableRecordWithoutPickling):
index_dtype
=
index_dtype
,
index_dtype
=
index_dtype
,
options
=
options
,
options
=
options
,
state
=
state
,
state
=
state
,
target
=
target
)
target
=
target
,
overridden_get_grid_sizes_for_insn_ids
=
(
overridden_get_grid_sizes_for_insn_ids
))
self
.
_kernel_executor_cache
=
{}
self
.
_kernel_executor_cache
=
{}
...
@@ -923,6 +921,11 @@ class LoopKernel(ImmutableRecordWithoutPickling):
...
@@ -923,6 +921,11 @@ class LoopKernel(ImmutableRecordWithoutPickling):
*global_size* and *local_size* are :class:`islpy.PwAff` objects.
*global_size* and *local_size* are :class:`islpy.PwAff` objects.
"""
"""
if
self
.
overridden_get_grid_sizes_for_insn_ids
:
return
self
.
overridden_get_grid_sizes_for_insn_ids
(
insn_ids
,
ignore_auto
=
ignore_auto
)
all_inames_by_insns
=
set
()
all_inames_by_insns
=
set
()
for
insn_id
in
insn_ids
:
for
insn_id
in
insn_ids
:
all_inames_by_insns
|=
self
.
insn_inames
(
insn_id
)
all_inames_by_insns
|=
self
.
insn_inames
(
insn_id
)
...
...
This diff is collapsed.
Click to expand it.
loopy/kernel/tools.py
+
2
−
1
View file @
a3e18078
...
@@ -439,7 +439,8 @@ class DomainChanger:
...
@@ -439,7 +439,8 @@ class DomainChanger:
# Changing the domain might look like it wants to change grid
# Changing the domain might look like it wants to change grid
# sizes. Not true.
# sizes. Not true.
# (Relevant for 'slab decomposition')
# (Relevant for 'slab decomposition')
get_grid_sizes_for_insn_ids
=
self
.
kernel
.
get_grid_sizes_for_insn_ids
)
overridden_get_grid_sizes_for_insn_ids
=
(
self
.
kernel
.
get_grid_sizes_for_insn_ids
))
# }}}
# }}}
...
...
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