From da32df99b4f6df462dc30e09f6716c47858a9b67 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Wed, 3 Jul 2019 14:18:43 -0500 Subject: [PATCH 1/2] Silence a spurious write race warning --- pytential/qbx/direct.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pytential/qbx/direct.py b/pytential/qbx/direct.py index 496259c9..aef21800 100644 --- a/pytential/qbx/direct.py +++ b/pytential/qbx/direct.py @@ -70,6 +70,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 +93,17 @@ 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)]) loopy_knl = lp.tag_inames(loopy_knl, "idim*:unr") for expn in self.expansions: -- GitLab From 42a72bb77bd7eb58e314d826515dc258dbdb1b4f Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Wed, 3 Jul 2019 14:22:40 -0500 Subject: [PATCH 2/2] Also add lang_version to kernel --- pytential/qbx/direct.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pytential/qbx/direct.py b/pytential/qbx/direct.py index aef21800..d4e8f89d 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 @@ -103,7 +104,8 @@ class LayerPotentialOnTargetAndCenterSubset(LayerPotentialBase): fixed_parameters=dict(dim=self.dim), silenced_warnings=[ "write_race(write_result_%d)" % i - for i in range(nexpansions)]) + 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: -- GitLab