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
6ca0d8aa
Commit
6ca0d8aa
authored
3 years ago
by
Kaushik Kulkarni
Committed by
Andreas Klöckner
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
define :meth:`InKernelCallable.with_name`
parent
e7c09088
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!426
Discussion: kernel_callables_v3-edit2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
loopy/kernel/function_interface.py
+15
-0
15 additions, 0 deletions
loopy/kernel/function_interface.py
loopy/translation_unit.py
+1
-1
1 addition, 1 deletion
loopy/translation_unit.py
with
16 additions
and
1 deletion
loopy/kernel/function_interface.py
+
15
−
0
View file @
6ca0d8aa
...
...
@@ -314,6 +314,7 @@ class InKernelCallable(ImmutableRecord):
.. automethod:: get_hw_axes_sizes
.. automethod:: get_used_hw_axes
.. automethod:: get_called_callables
.. automethod:: with_name
.. note::
...
...
@@ -492,6 +493,13 @@ class InKernelCallable(ImmutableRecord):
"""
raise
NotImplementedError
def
with_name
(
self
,
name
):
"""
Returns a copy of *self* so that it could be referred by *name*
in a :attr:`loopy.TranslationUnit.callables_table`
'
s namespace.
"""
raise
NotImplementedError
# }}}
...
...
@@ -655,6 +663,9 @@ class ScalarCallable(InKernelCallable):
"""
return
frozenset
()
def
with_name
(
self
,
name
):
return
self
# }}}
...
...
@@ -949,6 +960,10 @@ class CallableKernel(InKernelCallable):
return
get_resolved_callable_ids_called_by_knl
(
self
.
subkernel
,
callables_table
)
def
with_name
(
self
,
name
):
new_knl
=
self
.
subkernel
.
copy
(
name
=
name
)
return
self
.
copy
(
subkernel
=
new_knl
)
# }}}
...
...
This diff is collapsed.
Click to expand it.
loopy/translation_unit.py
+
1
−
1
View file @
6ca0d8aa
...
...
@@ -715,7 +715,7 @@ def add_callable_to_table(callables_table, clbl_id, clbl):
new_clbl_id
=
ung
(
clbl_id
)
new_callables_table
=
callables_table
.
copy
()
new_callables_table
[
new_clbl_id
]
=
clbl
new_callables_table
[
new_clbl_id
]
=
clbl
.
with_name
(
new_clbl_id
)
return
new_clbl_id
,
new_callables_table
...
...
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