Skip to content
Snippets Groups Projects
Commit 430c8d85 authored by Matthias Diener's avatar Matthias Diener
Browse files

deprecate transform_loopy_program

parent 4cefcf9d
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
...@@ -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,
_PytestPytatoPyOpenCLArrayContextFactory, _PytatoPyOpenCLArrayContextForTestsFactory,
]) ])
# }}} # }}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment