From 67c35f2a7f420421dbe97e32b98abcfe57636926 Mon Sep 17 00:00:00 2001
From: Alexandru Fikl <alexfikl@gmail.com>
Date: Fri, 4 Aug 2023 15:00:49 +0300
Subject: [PATCH] do not use out_host=True

---
 sumpy/toys.py        |  8 +-------
 test/test_kernels.py | 31 ++++++++++---------------------
 2 files changed, 11 insertions(+), 28 deletions(-)

diff --git a/sumpy/toys.py b/sumpy/toys.py
index 931e96e5..a794ff15 100644
--- a/sumpy/toys.py
+++ b/sumpy/toys.py
@@ -226,8 +226,6 @@ def _p2e(psource, center, rscale, order, p2e, expn_class, expn_kwargs):
             rscale=rscale,
             nboxes=1,
             tgt_base_ibox=0,
-
-            out_host=True,
             **toy_ctx.extra_source_and_kernel_kwargs)
 
     return expn_class(toy_ctx, center, rscale, order, coeffs[0].get(queue),
@@ -264,8 +262,6 @@ def _e2p(psource, targets, e2p):
             centers=centers,
             rscale=psource.rscale,
             targets=vector_to_device(queue, make_obj_array(targets)),
-
-            out_host=True,
             **toy_ctx.extra_kernel_kwargs)
 
     return pot.get(queue)
@@ -311,8 +307,7 @@ def _e2e(psource, to_center, to_rscale, to_order, e2e, expn_class, expn_kwargs):
 
             src_rscale=psource.rscale,
             tgt_rscale=to_rscale,
-
-            out_host=True, **toy_ctx.extra_kernel_kwargs)
+            **toy_ctx.extra_kernel_kwargs)
 
     return expn_class(
             toy_ctx, to_center, to_rscale, to_order, to_coeffs[1].get(queue),
@@ -467,7 +462,6 @@ class PointSources(PotentialSource):
                 cl.array.to_device(queue, targets),
                 cl.array.to_device(queue, self.points),
                 [cl.array.to_device(queue, self.weights)],
-                out_host=True,
                 **self.toy_ctx.extra_source_and_kernel_kwargs)
 
         return potential.get(queue)
diff --git a/test/test_kernels.py b/test/test_kernels.py
index 018a0f0f..2ddbd9c5 100644
--- a/test/test_kernels.py
+++ b/test/test_kernels.py
@@ -90,7 +90,7 @@ def test_p2p(actx_factory, exclude_self):
             actx.from_numpy(targets),
             actx.from_numpy(sources),
             [actx.from_numpy(strengths)],
-            out_host=True, **extra_kwargs)
+            **extra_kwargs)
     potential = actx.to_numpy(potential)
 
     potential_ref = np.empty_like(potential)
@@ -194,8 +194,6 @@ def test_p2e_multiple(actx_factory, base_knl, expn_class):
             nboxes=1,
             tgt_base_ibox=0,
             rscale=rscale,
-
-            out_host=True,
             dir_vec=dir_vec,
             **extra_kwargs)
 
@@ -221,8 +219,7 @@ def test_p2e_multiple(actx_factory, base_knl, expn_class):
             nboxes=1,
             tgt_base_ibox=0,
             rscale=rscale,
-
-            out_host=True, **extra_source_kwargs)
+            **extra_source_kwargs)
         mpoles = actx.to_numpy(mpoles)
 
         expected_result += mpoles
@@ -358,8 +355,7 @@ def test_p2e2p(actx_factory, base_knl, expn_class, order, with_source_derivative
                 nboxes=1,
                 tgt_base_ibox=0,
                 rscale=rscale,
-
-                out_host=True, **extra_source_kwargs)
+                **extra_source_kwargs)
 
         # }}}
 
@@ -381,8 +377,7 @@ def test_p2e2p(actx_factory, base_knl, expn_class, order, with_source_derivative
                 centers=centers,
                 targets=targets,
                 rscale=rscale,
-
-                out_host=True, **extra_kwargs)
+                **extra_kwargs)
         pot = actx.to_numpy(pot)
         grad_x = actx.to_numpy(grad_x)
 
@@ -393,7 +388,6 @@ def test_p2e2p(actx_factory, base_knl, expn_class, order, with_source_derivative
         evt, (pot_direct, grad_x_direct, ) = p2p(
                 actx.queue,
                 targets, sources, (strengths,),
-                out_host=True,
                 **extra_source_kwargs)
         pot_direct = actx.to_numpy(pot_direct)
         grad_x_direct = actx.to_numpy(grad_x_direct)
@@ -581,8 +575,7 @@ def test_translations(actx_factory, knl, local_expn_class, mpole_expn_class,
                 targets=targets,
 
                 rscale=rscale,
-
-                out_host=True, **extra_kwargs
+                **extra_kwargs
                 )
         pot = actx.to_numpy(pot)
 
@@ -611,7 +604,7 @@ def test_translations(actx_factory, knl, local_expn_class, mpole_expn_class,
         evt, (pot_direct,) = p2p(
                 actx.queue,
                 targets, sources, (strengths,),
-                out_host=True, **extra_kwargs)
+                **extra_kwargs)
         pot_direct = actx.to_numpy(pot_direct)
 
         # }}}
@@ -642,8 +635,7 @@ def test_translations(actx_factory, knl, local_expn_class, mpole_expn_class,
                 rscale=m1_rscale,
 
                 tgt_base_ibox=0,
-
-                out_host=True, **extra_kwargs)
+                **extra_kwargs)
 
         # }}}
 
@@ -674,8 +666,7 @@ def test_translations(actx_factory, knl, local_expn_class, mpole_expn_class,
 
                 src_rscale=m1_rscale,
                 tgt_rscale=m2_rscale,
-
-                out_host=True, **extra_kwargs)
+                **extra_kwargs)
 
         # }}}
 
@@ -705,8 +696,7 @@ def test_translations(actx_factory, knl, local_expn_class, mpole_expn_class,
 
                 src_rscale=m2_rscale,
                 tgt_rscale=l1_rscale,
-
-                out_host=True, **extra_kwargs)
+                **extra_kwargs)
 
         # }}}
 
@@ -736,8 +726,7 @@ def test_translations(actx_factory, knl, local_expn_class, mpole_expn_class,
 
                 src_rscale=l1_rscale,
                 tgt_rscale=l2_rscale,
-
-                out_host=True, **extra_kwargs)
+                **extra_kwargs)
 
         # }}}
 
-- 
GitLab