Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arraycontext
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Alexandru Fikl
arraycontext
Commits
430c8d85
Commit
430c8d85
authored
3 years ago
by
Matthias Diener
Browse files
Options
Downloads
Patches
Plain Diff
deprecate transform_loopy_program
parent
4cefcf9d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arraycontext/impl/pytato/__init__.py
+11
-0
11 additions, 0 deletions
arraycontext/impl/pytato/__init__.py
test/test_arraycontext.py
+11
-1
11 additions, 1 deletion
test/test_arraycontext.py
with
22 additions
and
1 deletion
arraycontext/impl/pytato/__init__.py
+
11
−
0
View file @
430c8d85
...
@@ -133,6 +133,17 @@ class PytatoPyOpenCLArrayContext(ArrayContext):
...
@@ -133,6 +133,17 @@ class PytatoPyOpenCLArrayContext(ArrayContext):
return
LazilyCompilingFunctionCaller
(
self
,
f
)
return
LazilyCompilingFunctionCaller
(
self
,
f
)
def
transform_loopy_program
(
self
,
prg
):
def
transform_loopy_program
(
self
,
prg
):
from
warnings
import
warn
warn
(
"
Using arraycontext.PytatoPyOpenCLArrayContext.transform_loopy_program
"
"
to transform a program. This is deprecated and will stop working
"
"
in 2022. Instead, subclass PytatoPyOpenCLArrayContext and implement
"
"
the specific logic required to transform the program for your
"
"
package or application. Check higher-level packages
"
"
(e.g. meshmode), which may already have subclasses you may want
"
"
to build on.
"
,
DeprecationWarning
,
stacklevel
=
2
)
from
loopy.translation_unit
import
for_each_kernel
from
loopy.translation_unit
import
for_each_kernel
nwg
=
48
nwg
=
48
...
...
This diff is collapsed.
Click to expand it.
test/test_arraycontext.py
+
11
−
1
View file @
430c8d85
...
@@ -66,10 +66,20 @@ class _PyOpenCLArrayContextForTestsFactory(
...
@@ -66,10 +66,20 @@ class _PyOpenCLArrayContextForTestsFactory(
force_device_scalars
=
True
force_device_scalars
=
True
class
_PytatoPyOpenCLArrayContextForTestsFactory
(
_PytestPytatoPyOpenCLArrayContextFactory
):
"""
Like :class:`PytatoPyOpenCLArrayContext`, but applies no program transformations
whatsoever. Only to be used for testing internal to :mod:`arraycontext`.
"""
def
transform_loopy_program
(
self
,
t_unit
):
return
t_unit
pytest_generate_tests
=
pytest_generate_tests_for_array_contexts
([
pytest_generate_tests
=
pytest_generate_tests_for_array_contexts
([
_PyOpenCLArrayContextForTestsFactory
,
_PyOpenCLArrayContextForTestsFactory
,
_PyOpenCLArrayContextWithHostScalarsForTestsFactory
,
_PyOpenCLArrayContextWithHostScalarsForTestsFactory
,
_
Pytest
PytatoPyOpenCLArrayContextFactory
,
_PytatoPyOpenCLArrayContextF
orTestsF
actory
,
])
])
# }}}
# }}}
...
...
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