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
66c6a5bc
Commit
66c6a5bc
authored
6 years ago
by
Kaushik Kulkarni
Browse files
Options
Downloads
Patches
Plain Diff
Added unpicklability testing in function_scopers
parent
f1ac1bfa
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Draft: Kernel callables: self review
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/transform/register_callable.py
+10
-1
10 additions, 1 deletion
loopy/transform/register_callable.py
with
10 additions
and
1 deletion
loopy/transform/register_callable.py
+
10
−
1
View file @
66c6a5bc
...
...
@@ -38,6 +38,8 @@ from loopy.kernel.function_interface import (get_kw_pos_association,
__doc__
=
"""
.. currentmodule:: loopy
.. autofunction:: register_function_lookup
.. autofunction:: register_callable_kernel
"""
...
...
@@ -53,7 +55,14 @@ def register_function_lookup(kernel, function_lookup):
"""
# adding the function lookup to the set of function lookers in the kernel.
new_function_scopers
=
kernel
.
function_scopers
+
[
function_lookup
]
if
function_lookup
not
in
kernel
.
function_scopers
:
from
loopy.tools
import
unpickles_equally
if
not
unpickles_equally
(
function_lookup
):
raise
LoopyError
(
"
function
'
%s
'
does not
"
"
compare equally after being upickled
"
"
and would disrupt loopy
'
s caches
"
%
function_lookup
)
new_function_scopers
=
kernel
.
function_scopers
+
[
function_lookup
]
registered_kernel
=
kernel
.
copy
(
function_scopers
=
new_function_scopers
)
from
loopy.kernel.creation
import
scope_functions
...
...
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