From d610a61b9709b3ed6387783e72c19abd17b57d76 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Sat, 13 Jul 2024 16:04:24 +0300 Subject: [PATCH] fix some deprecations in examples --- examples/moving-geometry.py | 2 +- examples/plot-connectivity.py | 2 +- examples/simple-dg.py | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/moving-geometry.py b/examples/moving-geometry.py index efec9fe3..81fe086d 100644 --- a/examples/moving-geometry.py +++ b/examples/moving-geometry.py @@ -245,7 +245,7 @@ def source(t, x): if __name__ == "__main__": cl_ctx = cl.create_some_context() queue = cl.CommandQueue(cl_ctx) - actx = PyOpenCLArrayContext(queue) + actx = PyOpenCLArrayContext(queue, force_device_scalars=True) from pytools import ProcessTimer for _ in range(1): diff --git a/examples/plot-connectivity.py b/examples/plot-connectivity.py index ce27d5db..7d3bbd59 100644 --- a/examples/plot-connectivity.py +++ b/examples/plot-connectivity.py @@ -11,7 +11,7 @@ def main(): cl_ctx = cl.create_some_context() queue = cl.CommandQueue(cl_ctx) - actx = PyOpenCLArrayContext(queue) + actx = PyOpenCLArrayContext(queue, force_device_scalars=True) from meshmode.mesh.generation import ( # noqa: F401 generate_icosahedron, diff --git a/examples/simple-dg.py b/examples/simple-dg.py index f8752698..52ae4547 100644 --- a/examples/simple-dg.py +++ b/examples/simple-dg.py @@ -439,7 +439,9 @@ def bump(actx, discr, t=0): / source_width**2)) -@with_container_arithmetic(bcast_obj_array=True, rel_comparison=True) +@with_container_arithmetic(bcast_obj_array=True, + rel_comparison=True, + _cls_has_array_context_attr=True) @dataclass_array_container @dataclass(frozen=True) class WaveState: