diff --git a/pytential/qbx/direct.py b/pytential/qbx/direct.py index 496259c921f7e6a6fdba59ceb42eda48a805bcd1..eac3c7fc8d667ef6b48a7f3509ade5b2f21878e2 100644 --- a/pytential/qbx/direct.py +++ b/pytential/qbx/direct.py @@ -25,8 +25,8 @@ THE SOFTWARE. import loopy as lp import numpy as np +from loopy.version import MOST_RECENT_LANGUAGE_VERSION from sumpy.qbx import LayerPotentialBase - from pytential.version import PYTENTIAL_KERNEL_VERSION @@ -98,7 +98,8 @@ class LayerPotentialOnTargetAndCenterSubset(LayerPotentialBase): arguments, name=self.name, assumptions="ntargets>=1 and nsources>=1", - fixed_parameters=dict(dim=self.dim)) + fixed_parameters=dict(dim=self.dim), + lang_version=MOST_RECENT_LANGUAGE_VERSION) loopy_knl = lp.tag_inames(loopy_knl, "idim*:unr") for expn in self.expansions: diff --git a/pytential/unregularized.py b/pytential/unregularized.py index fc39217e21293d8cc94b2a089ee0c9847dad1cf9..4e8e3098e79e7211c2727be5472e2ed9c0d5bc7f 100644 --- a/pytential/unregularized.py +++ b/pytential/unregularized.py @@ -255,9 +255,8 @@ class UnregularizedLayerPotentialSource(LayerPotentialSourceBase): # }}} from boxtree.fmm import drive_fmm - timing_data = {} all_potentials_on_every_tgt = drive_fmm( - geo_data.traversal(), wrangler, strengths, timing_data) + geo_data.traversal(), wrangler, strengths, timing_data=None) # {{{ postprocess fmm @@ -274,6 +273,7 @@ class UnregularizedLayerPotentialSource(LayerPotentialSourceBase): # }}} + timing_data = {} return result, timing_data # }}} diff --git a/test/test_cost_model.py b/test/test_cost_model.py index 7b24f56713dcd338cebbdcef7bb9d59c4e5cbcbf..55bf804f95cd8def1972297691e9d92ce0e1d645 100644 --- a/test/test_cost_model.py +++ b/test/test_cost_model.py @@ -101,12 +101,12 @@ def get_density(queue, lpot_source): # {{{ test that timing data gathering can execute succesfully -def test_timing_data_gathering(ctx_getter): +def test_timing_data_gathering(ctx_factory): """Test that timing data gathering can execute succesfully.""" pytest.importorskip("pyfmmlib") - cl_ctx = ctx_getter() + cl_ctx = ctx_factory() queue = cl.CommandQueue(cl_ctx, properties=cl.command_queue_properties.PROFILING_ENABLE) @@ -133,9 +133,9 @@ def test_timing_data_gathering(ctx_getter): (2, False), (3, False), (3, True))) -def test_cost_model(ctx_getter, dim, use_target_specific_qbx): +def test_cost_model(ctx_factory, dim, use_target_specific_qbx): """Test that cost model gathering can execute successfully.""" - cl_ctx = ctx_getter() + cl_ctx = ctx_factory() queue = cl.CommandQueue(cl_ctx) lpot_source = ( @@ -156,7 +156,7 @@ def test_cost_model(ctx_getter, dim, use_target_specific_qbx): sym_op_S_plus_D = ( sym.S(k_sym, sigma_sym, qbx_forced_limit=+1) - + sym.D(k_sym, sigma_sym)) + + sym.D(k_sym, sigma_sym, qbx_forced_limit="avg")) op_S_plus_D = bind(lpot_source, sym_op_S_plus_D) cost_S_plus_D = op_S_plus_D.get_modeled_cost(queue, sigma=sigma) assert len(cost_S_plus_D) == 2 @@ -166,9 +166,9 @@ def test_cost_model(ctx_getter, dim, use_target_specific_qbx): # {{{ test cost model metadata gathering -def test_cost_model_metadata_gathering(ctx_getter): +def test_cost_model_metadata_gathering(ctx_factory): """Test that the cost model correctly gathers metadata.""" - cl_ctx = ctx_getter() + cl_ctx = ctx_factory() queue = cl.CommandQueue(cl_ctx) from sumpy.expansion.level_to_order import SimpleExpansionOrderFinder @@ -425,10 +425,10 @@ class OpCountingTranslationCostModel(object): (3, False, True), (3, True, False), (3, True, True))) -def test_cost_model_correctness(ctx_getter, dim, off_surface, +def test_cost_model_correctness(ctx_factory, dim, off_surface, use_target_specific_qbx): """Check that computed cost matches that of a constant-one FMM.""" - cl_ctx = ctx_getter() + cl_ctx = ctx_factory() queue = cl.CommandQueue(cl_ctx) cost_model = ( @@ -516,12 +516,12 @@ CONSTANT_ONE_PARAMS = dict( ) -def test_cost_model_order_varying_by_level(ctx_getter): +def test_cost_model_order_varying_by_level(ctx_factory): """For FMM order varying by level, this checks to ensure that the costs are different. The varying-level case should have larger cost. """ - cl_ctx = ctx_getter() + cl_ctx = ctx_factory() queue = cl.CommandQueue(cl_ctx) # {{{ constant level to order diff --git a/test/test_target_specific_qbx.py b/test/test_target_specific_qbx.py index 34091af9a91e26f526ea3f2b371515b0c8992029..258a4d75a716b0b7b8f3068b35861ba941c0d4d3 100644 --- a/test/test_target_specific_qbx.py +++ b/test/test_target_specific_qbx.py @@ -133,10 +133,10 @@ def test_spherical_hankel_functions(): @pytest.mark.parametrize("op", ["S", "D", "Sp"]) @pytest.mark.parametrize("helmholtz_k", [0, 1.2, 12 + 1.2j]) @pytest.mark.parametrize("qbx_order", [0, 1, 5]) -def test_target_specific_qbx(ctx_getter, op, helmholtz_k, qbx_order): +def test_target_specific_qbx(ctx_factory, op, helmholtz_k, qbx_order): logging.basicConfig(level=logging.INFO) - cl_ctx = ctx_getter() + cl_ctx = ctx_factory() queue = cl.CommandQueue(cl_ctx) target_order = 4