Skip to content

Commit

Permalink
fix porting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed Jul 19, 2024
1 parent d4aaa1a commit 4c1f0ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pytential/unregularized.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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
Expand All @@ -337,6 +337,7 @@ def build_traversal(self):
return FMMTraversalBuilder(self.array_context)


@dataclass_array_container
@dataclass(frozen=True)
class _TargetInfo:
"""
Expand Down
8 changes: 4 additions & 4 deletions test/test_cost_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,21 +383,21 @@ 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)
+ sym.D(k_sym, sigma_sym, qbx_forced_limit="avg"))
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
)

Expand Down

0 comments on commit 4c1f0ef

Please sign in to comment.