Skip to content

Commit 67c35f2

Browse files
alexfiklinducer
authored andcommitted
do not use out_host=True
1 parent d1b10c7 commit 67c35f2

2 files changed

Lines changed: 11 additions & 28 deletions

File tree

sumpy/toys.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,6 @@ def _p2e(psource, center, rscale, order, p2e, expn_class, expn_kwargs):
226226
rscale=rscale,
227227
nboxes=1,
228228
tgt_base_ibox=0,
229-
230-
out_host=True,
231229
**toy_ctx.extra_source_and_kernel_kwargs)
232230

233231
return expn_class(toy_ctx, center, rscale, order, coeffs[0].get(queue),
@@ -264,8 +262,6 @@ def _e2p(psource, targets, e2p):
264262
centers=centers,
265263
rscale=psource.rscale,
266264
targets=vector_to_device(queue, make_obj_array(targets)),
267-
268-
out_host=True,
269265
**toy_ctx.extra_kernel_kwargs)
270266

271267
return pot.get(queue)
@@ -311,8 +307,7 @@ def _e2e(psource, to_center, to_rscale, to_order, e2e, expn_class, expn_kwargs):
311307

312308
src_rscale=psource.rscale,
313309
tgt_rscale=to_rscale,
314-
315-
out_host=True, **toy_ctx.extra_kernel_kwargs)
310+
**toy_ctx.extra_kernel_kwargs)
316311

317312
return expn_class(
318313
toy_ctx, to_center, to_rscale, to_order, to_coeffs[1].get(queue),
@@ -467,7 +462,6 @@ def eval(self, targets: np.ndarray) -> np.ndarray:
467462
cl.array.to_device(queue, targets),
468463
cl.array.to_device(queue, self.points),
469464
[cl.array.to_device(queue, self.weights)],
470-
out_host=True,
471465
**self.toy_ctx.extra_source_and_kernel_kwargs)
472466

473467
return potential.get(queue)

test/test_kernels.py

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_p2p(actx_factory, exclude_self):
9090
actx.from_numpy(targets),
9191
actx.from_numpy(sources),
9292
[actx.from_numpy(strengths)],
93-
out_host=True, **extra_kwargs)
93+
**extra_kwargs)
9494
potential = actx.to_numpy(potential)
9595

9696
potential_ref = np.empty_like(potential)
@@ -194,8 +194,6 @@ def test_p2e_multiple(actx_factory, base_knl, expn_class):
194194
nboxes=1,
195195
tgt_base_ibox=0,
196196
rscale=rscale,
197-
198-
out_host=True,
199197
dir_vec=dir_vec,
200198
**extra_kwargs)
201199

@@ -221,8 +219,7 @@ def test_p2e_multiple(actx_factory, base_knl, expn_class):
221219
nboxes=1,
222220
tgt_base_ibox=0,
223221
rscale=rscale,
224-
225-
out_host=True, **extra_source_kwargs)
222+
**extra_source_kwargs)
226223
mpoles = actx.to_numpy(mpoles)
227224

228225
expected_result += mpoles
@@ -358,8 +355,7 @@ def test_p2e2p(actx_factory, base_knl, expn_class, order, with_source_derivative
358355
nboxes=1,
359356
tgt_base_ibox=0,
360357
rscale=rscale,
361-
362-
out_host=True, **extra_source_kwargs)
358+
**extra_source_kwargs)
363359

364360
# }}}
365361

@@ -381,8 +377,7 @@ def test_p2e2p(actx_factory, base_knl, expn_class, order, with_source_derivative
381377
centers=centers,
382378
targets=targets,
383379
rscale=rscale,
384-
385-
out_host=True, **extra_kwargs)
380+
**extra_kwargs)
386381
pot = actx.to_numpy(pot)
387382
grad_x = actx.to_numpy(grad_x)
388383

@@ -393,7 +388,6 @@ def test_p2e2p(actx_factory, base_knl, expn_class, order, with_source_derivative
393388
evt, (pot_direct, grad_x_direct, ) = p2p(
394389
actx.queue,
395390
targets, sources, (strengths,),
396-
out_host=True,
397391
**extra_source_kwargs)
398392
pot_direct = actx.to_numpy(pot_direct)
399393
grad_x_direct = actx.to_numpy(grad_x_direct)
@@ -581,8 +575,7 @@ def eval_at(e2p, source_box_nr, rscale):
581575
targets=targets,
582576

583577
rscale=rscale,
584-
585-
out_host=True, **extra_kwargs
578+
**extra_kwargs
586579
)
587580
pot = actx.to_numpy(pot)
588581

@@ -611,7 +604,7 @@ def eval_at(e2p, source_box_nr, rscale):
611604
evt, (pot_direct,) = p2p(
612605
actx.queue,
613606
targets, sources, (strengths,),
614-
out_host=True, **extra_kwargs)
607+
**extra_kwargs)
615608
pot_direct = actx.to_numpy(pot_direct)
616609

617610
# }}}
@@ -642,8 +635,7 @@ def eval_at(e2p, source_box_nr, rscale):
642635
rscale=m1_rscale,
643636

644637
tgt_base_ibox=0,
645-
646-
out_host=True, **extra_kwargs)
638+
**extra_kwargs)
647639

648640
# }}}
649641

@@ -674,8 +666,7 @@ def eval_at(e2p, source_box_nr, rscale):
674666

675667
src_rscale=m1_rscale,
676668
tgt_rscale=m2_rscale,
677-
678-
out_host=True, **extra_kwargs)
669+
**extra_kwargs)
679670

680671
# }}}
681672

@@ -705,8 +696,7 @@ def eval_at(e2p, source_box_nr, rscale):
705696

706697
src_rscale=m2_rscale,
707698
tgt_rscale=l1_rscale,
708-
709-
out_host=True, **extra_kwargs)
699+
**extra_kwargs)
710700

711701
# }}}
712702

@@ -736,8 +726,7 @@ def eval_at(e2p, source_box_nr, rscale):
736726

737727
src_rscale=l1_rscale,
738728
tgt_rscale=l2_rscale,
739-
740-
out_host=True, **extra_kwargs)
729+
**extra_kwargs)
741730

742731
# }}}
743732

0 commit comments

Comments
 (0)