From 4c1f0eff742f97ca1865dbfbe48c011dfafc8431 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Tue, 17 Oct 2023 11:07:18 +0300 Subject: [PATCH] fix porting --- pytential/unregularized.py | 5 +++-- test/test_cost_model.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pytential/unregularized.py b/pytential/unregularized.py index abf92c032..4a46a2b60 100644 --- a/pytential/unregularized.py +++ b/pytential/unregularized.py @@ -33,7 +33,7 @@ from meshmode.dof_array import DOFArray from pytools import memoize_method -from pytential.array_context import PyOpenCLArrayContext +from pytential.array_context import PyOpenCLArrayContext, dataclass_array_container from pytential.source import LayerPotentialSourceBase logger = logging.getLogger(__name__) @@ -322,7 +322,7 @@ def copy_targets_kernel(self): knl = lp.tag_array_axes(knl, "targets", "stride:auto, stride:1") knl = lp.tag_inames(knl, {"dim": "ilp"}) - return knl.executor(self.cl_context) + return knl.executor(self.array_context.context) @property @memoize_method @@ -337,6 +337,7 @@ def build_traversal(self): return FMMTraversalBuilder(self.array_context) +@dataclass_array_container @dataclass(frozen=True) class _TargetInfo: """ diff --git a/test/test_cost_model.py b/test/test_cost_model.py index 3160fd086..0b04423f5 100644 --- a/test/test_cost_model.py +++ b/test/test_cost_model.py @@ -383,9 +383,9 @@ def test_cost_model(actx_factory, dim, use_target_specific_qbx, per_box): op_S = bind(places, sym_op_S) if per_box: - cost_S, _ = op_S.cost_per_box("constant_one", sigma=sigma) + _cost_S, _ = op_S.cost_per_box("constant_one", sigma=sigma) else: - cost_S, _ = op_S.cost_per_stage("constant_one", sigma=sigma) + _cost_S, _ = op_S.cost_per_stage("constant_one", sigma=sigma) sym_op_S_plus_D = ( sym.S(k_sym, sigma_sym, qbx_forced_limit=+1) @@ -393,11 +393,11 @@ def test_cost_model(actx_factory, dim, use_target_specific_qbx, per_box): op_S_plus_D = bind(places, sym_op_S_plus_D) if per_box: - cost_S_plus_D, _ = op_S_plus_D.cost_per_box( + _cost_S_plus_D, _ = op_S_plus_D.cost_per_box( "constant_one", sigma=sigma ) else: - cost_S_plus_D, _ = op_S_plus_D.cost_per_stage( + _cost_S_plus_D, _ = op_S_plus_D.cost_per_stage( "constant_one", sigma=sigma )