diff --git a/pytential/qbx/direct.py b/pytential/qbx/direct.py index 496259c921f7e6a6fdba59ceb42eda48a805bcd1..d4e8f89de40e8e45f1982d86dad45e8f213b4023 100644 --- a/pytential/qbx/direct.py +++ b/pytential/qbx/direct.py @@ -27,6 +27,7 @@ import numpy as np from sumpy.qbx import LayerPotentialBase +from loopy.version import MOST_RECENT_LANGUAGE_VERSION from pytential.version import PYTENTIAL_KERNEL_VERSION @@ -70,6 +71,8 @@ class LayerPotentialOnTargetAndCenterSubset(LayerPotentialBase): shape="ntargets_total", order="C") for i in range(len(self.kernels))]) + nexpansions = len(self.expansions) + loopy_knl = lp.make_kernel([ "{[itgt]: 0 <= itgt < ntargets}", "{[isrc]: 0 <= isrc < nsources}", @@ -91,14 +94,18 @@ class LayerPotentialOnTargetAndCenterSubset(LayerPotentialBase): + [""" result_{i}[itgt_overall] = knl_{i}_scaling * \ simul_reduce(sum, isrc, pair_result_{i}) \ - {{inames=itgt}} + {{id=write_result_{i},inames=itgt}} """.format(i=iknl) - for iknl in range(len(self.expansions))] + for iknl in range(nexpansions)] + ["end"], arguments, name=self.name, assumptions="ntargets>=1 and nsources>=1", - fixed_parameters=dict(dim=self.dim)) + fixed_parameters=dict(dim=self.dim), + silenced_warnings=[ + "write_race(write_result_%d)" % i + for i in range(nexpansions)], + lang_version=MOST_RECENT_LANGUAGE_VERSION) loopy_knl = lp.tag_inames(loopy_knl, "idim*:unr") for expn in self.expansions: