From c3934245e1383c1ae2a9114c933e232870fac9c4 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Mon, 19 Feb 2018 14:33:31 -0600 Subject: [PATCH 1/6] Silence loopy language version warnings --- sumpy/e2e.py | 1 + sumpy/e2p.py | 1 + sumpy/p2e.py | 1 + sumpy/p2p.py | 1 + sumpy/qbx.py | 1 + 5 files changed, 5 insertions(+) diff --git a/sumpy/e2e.py b/sumpy/e2e.py index 9ecaa7af..20d8b311 100644 --- a/sumpy/e2e.py +++ b/sumpy/e2e.py @@ -27,6 +27,7 @@ from six.moves import range import numpy as np import loopy as lp +from loopy.version import MOST_RECENT_LANGUAGE_VERSION # noqa import sumpy.symbolic as sym from sumpy.tools import KernelCacheWrapper diff --git a/sumpy/e2p.py b/sumpy/e2p.py index cfa30952..87ddbc2a 100644 --- a/sumpy/e2p.py +++ b/sumpy/e2p.py @@ -27,6 +27,7 @@ from six.moves import range import numpy as np import loopy as lp +from loopy.version import MOST_RECENT_LANGUAGE_VERSION # noqa import sumpy.symbolic as sym from sumpy.tools import KernelCacheWrapper diff --git a/sumpy/p2e.py b/sumpy/p2e.py index 8fc3a773..f3ea1c72 100644 --- a/sumpy/p2e.py +++ b/sumpy/p2e.py @@ -27,6 +27,7 @@ from six.moves import range import numpy as np import loopy as lp +from loopy.version import MOST_RECENT_LANGUAGE_VERSION # noqa from sumpy.tools import KernelCacheWrapper import logging diff --git a/sumpy/p2p.py b/sumpy/p2p.py index 4b91b85e..8a07295d 100644 --- a/sumpy/p2p.py +++ b/sumpy/p2p.py @@ -27,6 +27,7 @@ from six.moves import range import numpy as np import loopy as lp +from loopy.version import MOST_RECENT_LANGUAGE_VERSION # noqa from sumpy.tools import KernelComputation, KernelCacheWrapper diff --git a/sumpy/qbx.py b/sumpy/qbx.py index e0a3ea83..8b5d94d0 100644 --- a/sumpy/qbx.py +++ b/sumpy/qbx.py @@ -27,6 +27,7 @@ import six from six.moves import range, zip import numpy as np import loopy as lp +from loopy.version import MOST_RECENT_LANGUAGE_VERSION # noqa import sumpy.symbolic as sym from pytools import memoize_method from pymbolic import parse, var -- GitLab From 32fe661958d7d48d30dac445b7741885337ec2a2 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Mon, 19 Feb 2018 15:55:24 -0600 Subject: [PATCH 2/6] Fix language version usage --- sumpy/e2e.py | 12 ++++++++---- sumpy/e2p.py | 9 ++++++--- sumpy/p2e.py | 3 ++- sumpy/qbx.py | 5 +++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/sumpy/e2e.py b/sumpy/e2e.py index 20d8b311..2c309200 100644 --- a/sumpy/e2e.py +++ b/sumpy/e2e.py @@ -27,8 +27,9 @@ from six.moves import range import numpy as np import loopy as lp -from loopy.version import MOST_RECENT_LANGUAGE_VERSION # noqa import sumpy.symbolic as sym + +from loopy.version import MOST_RECENT_LANGUAGE_VERSION from sumpy.tools import KernelCacheWrapper import logging @@ -218,7 +219,8 @@ class E2EFromCSR(E2EBase): assumptions="ntgt_boxes>=1", silenced_warnings="write_race(write_expn*)", default_offset=lp.auto, - fixed_parameters=dict(dim=self.dim)) + fixed_parameters=dict(dim=self.dim), + lang_version=MOST_RECENT_LANGUAGE_VERSION) for expn in [self.src_expansion, self.tgt_expansion]: loopy_knl = expn.prepare_loopy_kernel(loopy_knl) @@ -337,7 +339,8 @@ class E2EFromChildren(E2EBase): name=self.name, assumptions="ntgt_boxes>=1", silenced_warnings="write_race(write_expn*)", - fixed_parameters=dict(dim=self.dim, nchildren=2**self.dim)) + fixed_parameters=dict(dim=self.dim, nchildren=2**self.dim), + lang_version=MOST_RECENT_LANGUAGE_VERSION) for expn in [self.src_expansion, self.tgt_expansion]: loopy_knl = expn.prepare_loopy_kernel(loopy_knl) @@ -440,7 +443,8 @@ class E2EFromParent(E2EBase): ] + gather_loopy_arguments([self.src_expansion, self.tgt_expansion]), name=self.name, assumptions="ntgt_boxes>=1", silenced_warnings="write_race(write_expn*)", - fixed_parameters=dict(dim=self.dim, nchildren=2**self.dim)) + fixed_parameters=dict(dim=self.dim, nchildren=2**self.dim), + lang_version=MOST_RECENT_LANGUAGE_VERSION) for expn in [self.src_expansion, self.tgt_expansion]: loopy_knl = expn.prepare_loopy_kernel(loopy_knl) diff --git a/sumpy/e2p.py b/sumpy/e2p.py index 87ddbc2a..d0d05cbf 100644 --- a/sumpy/e2p.py +++ b/sumpy/e2p.py @@ -27,9 +27,10 @@ from six.moves import range import numpy as np import loopy as lp -from loopy.version import MOST_RECENT_LANGUAGE_VERSION # noqa import sumpy.symbolic as sym + from sumpy.tools import KernelCacheWrapper +from loopy.version import MOST_RECENT_LANGUAGE_VERSION __doc__ = """ @@ -188,7 +189,8 @@ class E2PFromSingleBox(E2PBase): assumptions="ntgt_boxes>=1", silenced_warnings="write_race(write_result*)", default_offset=lp.auto, - fixed_parameters=dict(dim=self.dim, nresults=len(result_names))) + fixed_parameters=dict(dim=self.dim, nresults=len(result_names)), + lang_version=MOST_RECENT_LANGUAGE_VERSION) loopy_knl = lp.tag_inames(loopy_knl, "idim*:unr") loopy_knl = self.expansion.prepare_loopy_kernel(loopy_knl) @@ -295,7 +297,8 @@ class E2PFromCSR(E2PBase): default_offset=lp.auto, fixed_parameters=dict( dim=self.dim, - nresults=len(result_names))) + nresults=len(result_names)), + lang_version=MOST_RECENT_LANGUAGE_VERSION) loopy_knl = lp.tag_inames(loopy_knl, "idim*:unr") loopy_knl = lp.prioritize_loops(loopy_knl, "itgt_box,itgt,isrc_box") diff --git a/sumpy/p2e.py b/sumpy/p2e.py index f3ea1c72..1d2e63a2 100644 --- a/sumpy/p2e.py +++ b/sumpy/p2e.py @@ -27,7 +27,8 @@ from six.moves import range import numpy as np import loopy as lp -from loopy.version import MOST_RECENT_LANGUAGE_VERSION # noqa + +from loopy.version import MOST_RECENT_LANGUAGE_VERSION from sumpy.tools import KernelCacheWrapper import logging diff --git a/sumpy/qbx.py b/sumpy/qbx.py index 8b5d94d0..cde20ef2 100644 --- a/sumpy/qbx.py +++ b/sumpy/qbx.py @@ -27,7 +27,7 @@ import six from six.moves import range, zip import numpy as np import loopy as lp -from loopy.version import MOST_RECENT_LANGUAGE_VERSION # noqa +from loopy.version import MOST_RECENT_LANGUAGE_VERSION import sumpy.symbolic as sym from pytools import memoize_method from pymbolic import parse, var @@ -181,7 +181,8 @@ class LayerPotentialBase(KernelComputation, KernelCacheWrapper): assumptions="nsources>=1 and ntargets>=1", default_offset=lp.auto, silenced_warnings="write_race(write_lpot*)", - 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") -- GitLab From 653ce44ca3aeac28aa269486bb7b2c4914b1ee4b Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Mon, 19 Feb 2018 16:01:50 -0600 Subject: [PATCH 3/6] Add nosync to all write statements --- sumpy/e2e.py | 6 +++--- sumpy/p2e.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sumpy/e2e.py b/sumpy/e2e.py index 2c309200..724903fd 100644 --- a/sumpy/e2e.py +++ b/sumpy/e2e.py @@ -196,7 +196,7 @@ class E2EFromCSR(E2EBase): """] + [""" tgt_expansions[tgt_ibox - tgt_base_ibox, {coeffidx}] = \ simul_reduce(sum, isrc_box, coeff{coeffidx}) \ - {{id_prefix=write_expn}} + {{id_prefix=write_expn,nosync=write_expn*}} """.format(coeffidx=i) for i in range(ncoeff_tgt)] + [""" end """], @@ -314,7 +314,7 @@ class E2EFromChildren(E2EBase): tgt_expansions[tgt_ibox - tgt_base_ibox, {i}] \ + coeff{i} \ {{id_prefix=write_expn,dep=compute_coeff*, - nosync=read_coeff*}} + nosync=read_coeff*:write_expn*}} """.format(i=i) for i in range(ncoeffs)] + [""" end end @@ -422,7 +422,7 @@ class E2EFromParent(E2EBase): tgt_expansions[tgt_ibox - tgt_base_ibox, {i}] = \ tgt_expansions[tgt_ibox - tgt_base_ibox, {i}] + coeff{i} \ - {{id_prefix=write_expn,nosync=read_expn*}} + {{id_prefix=write_expn,nosync=read_expn*:write_expn*}} """.format(i=i) for i in range(ncoeffs)] + [""" end """], diff --git a/sumpy/p2e.py b/sumpy/p2e.py index 1d2e63a2..19db841f 100644 --- a/sumpy/p2e.py +++ b/sumpy/p2e.py @@ -138,7 +138,7 @@ class P2EFromSingleBox(P2EBase): """] + [""" tgt_expansions[src_ibox-tgt_base_ibox, {coeffidx}] = \ simul_reduce(sum, isrc, strength*coeff{coeffidx}) \ - {{id_prefix=write_expn}} + {{id_prefix=write_expn,nosync=write_expn*}} """.format(coeffidx=i) for i in range(ncoeffs)] + [""" end """], @@ -256,7 +256,8 @@ class P2EFromCSR(P2EBase): """] + [""" tgt_expansions[tgt_ibox - tgt_base_ibox, {coeffidx}] = \ simul_reduce(sum, (isrc_box, isrc), - strength*coeff{coeffidx}) {{id_prefix=write_expn}} + strength*coeff{coeffidx}) \ + {{id_prefix=write_expn,nosync=write_expn*}} """.format(coeffidx=i) for i in range(ncoeffs)] + [""" end """], -- GitLab From 1813cde4ec8c4b3ab7eded3a1bea61a2b443fa8c Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Mon, 19 Feb 2018 16:05:32 -0600 Subject: [PATCH 4/6] Revert unused import --- sumpy/p2p.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sumpy/p2p.py b/sumpy/p2p.py index 31970844..8c37b0e0 100644 --- a/sumpy/p2p.py +++ b/sumpy/p2p.py @@ -30,8 +30,6 @@ from six.moves import range import numpy as np import loopy as lp - -from loopy.version import MOST_RECENT_LANGUAGE_VERSION # noqa from pymbolic import var from sumpy.tools import KernelComputation, KernelCacheWrapper -- GitLab From 90c65434652ce77b7cc8c39f99d86fae4c6f4ebb Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Mon, 19 Feb 2018 16:06:55 -0600 Subject: [PATCH 5/6] Revert another unused import --- sumpy/p2e.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sumpy/p2e.py b/sumpy/p2e.py index 19db841f..ba60c38c 100644 --- a/sumpy/p2e.py +++ b/sumpy/p2e.py @@ -28,7 +28,6 @@ from six.moves import range import numpy as np import loopy as lp -from loopy.version import MOST_RECENT_LANGUAGE_VERSION from sumpy.tools import KernelCacheWrapper import logging -- GitLab From a011bef39389d32267750e8c148161fb5d08bc22 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Mon, 19 Feb 2018 16:40:22 -0600 Subject: [PATCH 6/6] Bump kernel version --- sumpy/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sumpy/version.py b/sumpy/version.py index 24df01b4..178a9771 100644 --- a/sumpy/version.py +++ b/sumpy/version.py @@ -25,4 +25,4 @@ VERSION = (2016, 1) VERSION_STATUS = "beta1" VERSION_TEXT = ".".join(str(x) for x in VERSION) + VERSION_STATUS -KERNEL_VERSION = 25 +KERNEL_VERSION = 26 -- GitLab