From 71d55c554b5a05d15a355c00cfaaaf4641b62e59 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl <alexfikl@gmail.com> Date: Sat, 8 Feb 2025 11:13:58 +0200 Subject: [PATCH] feat: remove force_device_scalars=True from examples --- examples/from_firedrake.py | 2 +- examples/moving-geometry.py | 2 +- examples/plot-connectivity.py | 2 +- examples/simple-dg.py | 2 +- examples/to_firedrake.py | 2 +- examples/tp-lagrange-stl.py | 2 +- meshmode/__init__.py | 2 +- test/test_partition.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/from_firedrake.py b/examples/from_firedrake.py index e6e39ea..2ac2328 100644 --- a/examples/from_firedrake.py +++ b/examples/from_firedrake.py @@ -57,7 +57,7 @@ def main(visualize=True): # Make connections cl_ctx = cl.create_some_context() queue = cl.CommandQueue(cl_ctx) - actx = PyOpenCLArrayContext(queue, force_device_scalars=True) + actx = PyOpenCLArrayContext(queue) fd_connection = build_connection_from_firedrake(actx, fd_fspace) fd_bdy_connection = \ diff --git a/examples/moving-geometry.py b/examples/moving-geometry.py index ee1228b..7f21b5c 100644 --- a/examples/moving-geometry.py +++ b/examples/moving-geometry.py @@ -245,7 +245,7 @@ def run(actx, *, if __name__ == "__main__": cl_ctx = cl.create_some_context() queue = cl.CommandQueue(cl_ctx) - actx = PyOpenCLArrayContext(queue, force_device_scalars=True) + actx = PyOpenCLArrayContext(queue) from pytools import ProcessTimer for _ in range(1): diff --git a/examples/plot-connectivity.py b/examples/plot-connectivity.py index 7d3bbd5..ce27d5d 100644 --- a/examples/plot-connectivity.py +++ b/examples/plot-connectivity.py @@ -11,7 +11,7 @@ order = 4 def main(): cl_ctx = cl.create_some_context() queue = cl.CommandQueue(cl_ctx) - actx = PyOpenCLArrayContext(queue, force_device_scalars=True) + actx = PyOpenCLArrayContext(queue) from meshmode.mesh.generation import ( # noqa: F401 generate_icosahedron, diff --git a/examples/simple-dg.py b/examples/simple-dg.py index 26722f1..51da62f 100644 --- a/examples/simple-dg.py +++ b/examples/simple-dg.py @@ -464,7 +464,7 @@ def main(lazy=False): cl_ctx = cl.create_some_context() queue = cl.CommandQueue(cl_ctx) - actx_outer = PyOpenCLArrayContext(queue, force_device_scalars=True) + actx_outer = PyOpenCLArrayContext(queue) if lazy: actx_rhs = PytatoPyOpenCLArrayContext(queue) else: diff --git a/examples/to_firedrake.py b/examples/to_firedrake.py index 8027a8f..08e2e60 100644 --- a/examples/to_firedrake.py +++ b/examples/to_firedrake.py @@ -52,7 +52,7 @@ def main(): cl_ctx = cl.create_some_context() queue = cl.CommandQueue(cl_ctx) - actx = PyOpenCLArrayContext(queue, force_device_scalars=True) + actx = PyOpenCLArrayContext(queue) nel_1d = 16 from meshmode.mesh.generation import generate_regular_rect_mesh diff --git a/examples/tp-lagrange-stl.py b/examples/tp-lagrange-stl.py index 063efa5..e048a52 100644 --- a/examples/tp-lagrange-stl.py +++ b/examples/tp-lagrange-stl.py @@ -18,7 +18,7 @@ from meshmode.mesh import BTAG_ALL, make_mesh def main(): cl_ctx = cl.create_some_context() queue = cl.CommandQueue(cl_ctx) - actx = PyOpenCLArrayContext(queue, force_device_scalars=True) + actx = PyOpenCLArrayContext(queue) npts1d = 100 # use 300 for actual print rs_coords = np.linspace(-1, 1, npts1d) diff --git a/meshmode/__init__.py b/meshmode/__init__.py index 1ba90f1..d891e8f 100644 --- a/meshmode/__init__.py +++ b/meshmode/__init__.py @@ -85,4 +85,4 @@ def _acf(): context = cl._csc() queue = cl.CommandQueue(context) - return PyOpenCLArrayContext(queue, force_device_scalars=True) + return PyOpenCLArrayContext(queue) diff --git a/test/test_partition.py b/test/test_partition.py index e57fac5..7b33e76 100644 --- a/test/test_partition.py +++ b/test/test_partition.py @@ -408,7 +408,7 @@ def _test_mpi_boundary_swap(dim, order, num_groups): from meshmode.array_context import PyOpenCLArrayContext cl_ctx = cl.create_some_context() queue = cl.CommandQueue(cl_ctx) - actx = PyOpenCLArrayContext(queue, force_device_scalars=True) + actx = PyOpenCLArrayContext(queue) from meshmode.discretization import Discretization vol_discr = Discretization(actx, local_mesh, group_factory) -- GitLab