diff --git a/arraycontext/impl/pytato/__init__.py b/arraycontext/impl/pytato/__init__.py index 4d987a4aa566ba5a578b659764efc766c5ce3c74..3e3339f40d4681d3ef52c47a94bf4b53267ebb9c 100644 --- a/arraycontext/impl/pytato/__init__.py +++ b/arraycontext/impl/pytato/__init__.py @@ -133,6 +133,17 @@ class PytatoPyOpenCLArrayContext(ArrayContext): return LazilyCompilingFunctionCaller(self, f) 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 nwg = 48 diff --git a/test/test_arraycontext.py b/test/test_arraycontext.py index 1bfaef431e28552a76bbb72582507c8381795aed..5f34113cdd1dbb2a853da923955050f2a6d9bfa1 100644 --- a/test/test_arraycontext.py +++ b/test/test_arraycontext.py @@ -66,10 +66,20 @@ class _PyOpenCLArrayContextForTestsFactory( 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([ _PyOpenCLArrayContextForTestsFactory, _PyOpenCLArrayContextWithHostScalarsForTestsFactory, - _PytestPytatoPyOpenCLArrayContextFactory, + _PytatoPyOpenCLArrayContextForTestsFactory, ]) # }}}